From c7b72dac999197e87cb01eab3891f51d784d0a41 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 26 Feb 2020 19:34:50 +0200 Subject: [PATCH] Update style.js (#9347) --- src/style/style.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/style/style.js b/src/style/style.js index 02bbf786ee1..fdf3274d95c 100644 --- a/src/style/style.js +++ b/src/style/style.js @@ -776,8 +776,7 @@ class Style extends Evented { * @returns {boolean} a boolean specifying if the given layer is present */ hasLayer(id: string): boolean { - const layerIds = Object.keys(this._layers); - return layerIds.includes(id, 0); + return id in this._layers; } setLayerZoomRange(layerId: string, minzoom: ?number, maxzoom: ?number) {