From 11d932001ed65fed690b835e5eef504f90845533 Mon Sep 17 00:00:00 2001 From: Jakub Hampl Date: Wed, 1 Aug 2018 09:38:06 +0100 Subject: Misc fixes --- src/js/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/js') diff --git a/src/js/main.js b/src/js/main.js index 255396e..eff72ed 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -108,6 +108,7 @@ function wrapElmApplication(elmApp, settings = {}) { return this._featureState; } set featureState(value) { + // TODO: Clean this up function makeId({id, source, sourceLayer}) { return `${id}::${source}::${sourceLayer}`; @@ -171,7 +172,7 @@ function wrapElmApplication(elmApp, settings = {}) { ) { wrapped = e => { e.features = this._map.queryRenderedFeatures( - [e.lngLat.lng, e.lngLat.lat], + e.point, { layers: this.eventFeaturesLayers, filter: this.eventFeaturesFilter @@ -182,14 +183,14 @@ function wrapElmApplication(elmApp, settings = {}) { } else if (["touchend", "touchmove", "touchcancel"].includes(type)) { wrapped = e => { e.features = this._map.queryRenderedFeatures( - [e.lngLat.lng, e.lngLat.lat], + [e.point], { layers: this.eventFeaturesLayers, filter: this.eventFeaturesFilter } ); - e.perPointFeatures = e.lngLats.map(({ lng, lat }) => - this._map.queryRenderedFeatures([lng, lat], { + e.perPointFeatures = e.points.map(point => + this._map.queryRenderedFeatures(point, { layers: this.eventFeaturesLayers, filter: this.eventFeaturesFilter }) -- cgit v1.2.3