Skip to content

Commit

Permalink
#505 [Bug]: Support dynamicExtentMoveThresholf for non-geodatasets
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Mar 8, 2024
1 parent e1a3180 commit 7d447b1
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/essence/Basics/Layers_/LayerCapturer.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,39 @@ export const captureVector = (layerObj, options, cb, dynamicCb) => {
delete data.Features
}

const lastLoc = _layerRequestLastLoc[layerObj.name]
const nowLoc = L_.Map_.map.getCenter()

if (
_layerRequestLastTimestamp[layerObj.name] ==
dateNow
dateNow &&
(lastLoc == null ||
layerData?.variables
?.dynamicExtentMoveThreshold == null ||
F_.lngLatDistBetween(
lastLoc.lng,
lastLoc.lat,
nowLoc.lng,
nowLoc.lat
) >
parseFloat(
layerData?.variables
?.dynamicExtentMoveThreshold
) /
(layerData?.variables
?.dynamicExtentMoveThreshold &&
layerData?.variables?.dynamicExtentMoveThreshold.indexOf(
'/z'
) > -1
? Math.pow(
2,
L_.Map_.map.getZoom()
)
: 1))
) {
L_.clearVectorLayer(layerObj.name)
L_.updateVectorLayer(layerObj.name, data)
_layerRequestLastLoc[layerObj.name] = nowLoc
}
}).fail(function (jqXHR, textStatus, errorThrown) {
//Tell the console council about what happened
Expand Down

0 comments on commit 7d447b1

Please sign in to comment.