diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-11-03 13:58:38 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-11-03 14:36:15 +0800 |
commit | f4910b66e74034db14619ee384dc261423dc19fc (patch) | |
tree | 78382b3bb600b61a43b48d417cfbe3873d8da623 /src/Link.mjs | |
parent | 3086cc484857dea32a33f829ec173adaf0cf8fbe (diff) |
feat: use bbox to update camera for result of Geocoding
* show markers from all Geocoding Results
* update mapclay for latest updateCamera method
* 3 steps for camera animation:
1. zoom out to bbox which contains all Geocoding Result
2. pan to marker of hovered result
3. zoom in to bbox from nonimatim query
* remove markers except selected Geocoding Result
Diffstat (limited to 'src/Link.mjs')
-rw-r--r-- | src/Link.mjs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Link.mjs b/src/Link.mjs index 7678f3a..685de3a 100644 --- a/src/Link.mjs +++ b/src/Link.mjs | |||
@@ -227,7 +227,7 @@ const isAnchorVisible = anchor => { | |||
227 | */ | 227 | */ |
228 | export const updateMapCameraByMarker = lonLat => marker => { | 228 | export const updateMapCameraByMarker = lonLat => marker => { |
229 | const renderer = marker.closest('.mapclay')?.renderer | 229 | const renderer = marker.closest('.mapclay')?.renderer |
230 | renderer.updateCamera({ center: lonLat }, true) | 230 | renderer?.updateCamera?.({ center: lonLat, animation: true }) |
231 | } | 231 | } |
232 | 232 | ||
233 | /** | 233 | /** |