diff options
author | Jakub Hampl <kopomir@gmail.com> | 2018-08-01 09:38:06 +0100 |
---|---|---|
committer | Jakub Hampl <kopomir@gmail.com> | 2018-08-01 09:38:06 +0100 |
commit | 11d932001ed65fed690b835e5eef504f90845533 (patch) | |
tree | a38fc395fbb9babfe0d3ab0127c0d44d1021dccf /src/js/main.js | |
parent | 1bf47c82dbf2849495db3ce9b586c14cb2819a8c (diff) |
Misc fixes
Diffstat (limited to 'src/js/main.js')
-rw-r--r-- | src/js/main.js | 9 |
1 files changed, 5 insertions, 4 deletions
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 }) |