Skip to content

Commit cb9a09e

Browse files
#702 Fix LayersTool filtering on non-dynamicExtent props-on-click geodatasets (#703)
1 parent 5df773f commit cb9a09e

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

src/essence/Basics/Layers_/Filtering/Filtering.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ const Filtering = {
8282
type: layerObj.type,
8383
needsToQueryGeodataset:
8484
layerObj?.url.startsWith('geodatasets:') &&
85-
layerObj?.variables?.dynamicExtent === true &&
8685
layerObj?.variables?.getFeaturePropertiesOnClick === true,
8786
}
8887

@@ -762,7 +761,6 @@ const Filtering = {
762761
// needsToQueryGeodataset (but pulled out so submit could be called standalone)
763762
if (
764763
layerObj?.url.startsWith('geodatasets:') &&
765-
layerObj?.variables?.dynamicExtent === true &&
766764
layerObj?.variables?.getFeaturePropertiesOnClick === true
767765
) {
768766
GeodatasetFilterer.filter(

src/essence/Basics/Layers_/Filtering/GeodatasetFilterer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const GeodatasetFilterer = {
110110
}
111111
}
112112
}
113-
L_.Map_.refreshLayer(L_.layers.data[layerName])
113+
L_.Map_.refreshLayer(L_.layers.data[layerName], null, null, true)
114114
},
115115
match: function (feature, filter) {
116116
if (filter.values.length === 0) return true

src/essence/Basics/Layers_/LayerCapturer.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ export const captureVector = (layerObj, options, cb, dynamicCb) => {
270270
}
271271
}
272272

273+
// filters
274+
if (layerData._filterEncoded?.filters)
275+
body.filters = layerData._filterEncoded.filters
276+
if (layerData._filterEncoded?.spatialFilter)
277+
body.spatialFilter =
278+
layerData._filterEncoded.spatialFilter
279+
273280
const dateNow = new Date().getTime()
274281

275282
_layerRequestLastTimestamp[layerObj.name] = Math.max(
@@ -404,6 +411,13 @@ export const captureVector = (layerObj, options, cb, dynamicCb) => {
404411
.concat(L_.getDynamicProps(layerData))
405412
.filter(Boolean)
406413
: null
414+
415+
// filters
416+
if (layerData._filterEncoded?.filters)
417+
body.filters = layerData._filterEncoded.filters
418+
if (layerData._filterEncoded?.spatialFilter)
419+
body.spatialFilter = layerData._filterEncoded.spatialFilter
420+
407421
layerData._lastGeodatasetRequestBody = body
408422
calls.api(
409423
'geodatasets_get',

src/essence/Basics/Map_/Map_.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,12 @@ let Map_ = {
460460
}
461461
})
462462
},
463-
refreshLayer: async function (layerObj, cb, skipOrderedBringToFront) {
463+
refreshLayer: async function (
464+
layerObj,
465+
cb,
466+
skipOrderedBringToFront,
467+
stopLoops
468+
) {
464469
// If it's a dynamic extent layer, just re-call its function
465470
if (
466471
L_._onSpecificLayerToggleSubscriptions[
@@ -495,7 +500,7 @@ let Map_ = {
495500

496501
// fake on
497502
L_.layers.on[layerObj.name] = true
498-
await makeLayer(layerObj, true, null)
503+
await makeLayer(layerObj, true, null, null, null, stopLoops)
499504
L_.addVisible(Map_, [layerObj.name])
500505

501506
// turn off if was off

src/essence/Tools/Layers/LayersTool.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@
165165
flex-flow: column;
166166
font-size: 14px;
167167
color: var(--color-f);
168-
overflow: hidden;
169168
}
170169
#layersToolList > li.forceOff {
171170
height: 0 !important;
@@ -365,7 +364,8 @@
365364
text-transform: capitalize;
366365
mix-blend-mode: difference;
367366
}
368-
#layersTool .tileCogColormap img, #layersTool .tileCogColormap #titlerCogColormapCSS {
367+
#layersTool .tileCogColormap img,
368+
#layersTool .tileCogColormap #titlerCogColormapCSS {
369369
width: 254px;
370370
height: 28px;
371371
transform: rotateZ(90deg) translateX(125px) translateY(-177px);
@@ -376,7 +376,7 @@
376376
display: flex;
377377
mix-blend-mode: normal;
378378
}
379-
#layersTool .tileCogColormap #titlerCogColormapCSS + #tileCogColormapMapLines {
379+
#layersTool .tileCogColormap #titlerCogColormapCSS + #tileCogColormapMapLines {
380380
margin-top: -2px;
381381
}
382382
#layersTool #layersToolList > li.download_on,

0 commit comments

Comments
 (0)