Skip to content

Commit 0001d31

Browse files
ltkumpakb
authored andcommitted
PB-1875: links with pre-selected features do not center correctly
- Issue: In some occasions, opening a link containing both a center and pre-selected features would prioritize centering on the features rather than centering on the pre-established center. This would only occur at startup. Once the application is running, changing the URL to the one we want would set all parameters correctly - Cause: On startup, we go through the store sync loop multiple times, and at one point, we set the features after the center, and thus override the center parameter - Fix: If there is a `center` parameter in the query, we don't set the center on the features extent.
1 parent 7adc470 commit 0001d31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/mapviewer/src/router/storeSync/LayerParamConfig.class.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ async function getAndDispatchFeatures(to, featuresPromise, store) {
237237
maxZoom: store.state.position.projection.get1_25000ZoomLevel(),
238238
dispatcher: STORE_DISPATCHER_ROUTER_PLUGIN,
239239
})
240-
} else {
240+
// if the center is not specifically set, we center on the middle of the extent
241+
} else if (!query.center) {
241242
const center = [
242243
[(extent[0][0] + extent[1][0]) / 2],
243244
[(extent[0][1] + extent[1][1]) / 2],

0 commit comments

Comments
 (0)