Skip to content

Commit 88f2a87

Browse files
bugfix
1 parent 9ea626d commit 88f2a87

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/clients/dish/src/utils/watchSearchResultForAlkisSearch.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { alkisWms } from '../servicesConstants'
55
import { alkisMinZoom } from '../mapConfigurations/layerConfigIntern'
66

77
export function watchSearchResultForAlkisSearch(instance: MapInstance) {
8+
console.log('### watchSearchResultForAlkisSearch initialized')
89
instance.subscribe('plugin/addressSearch/chosenAddress', (chosenAddress) => {
910
if (chosenAddress === null) {
1011
return
@@ -27,9 +28,11 @@ export function watchSearchResultForAlkisSearch(instance: MapInstance) {
2728
)
2829
) {
2930
const zoomLevel = instance.$store.getters['plugin/zoom/zoomLevel']
30-
if (zoomLevel < alkisMinZoom) {
31-
instance.$store.getters.map.getView().setZoom(alkisMinZoom)
32-
}
31+
32+
instance.$store.getters.map
33+
.getView()
34+
.setZoom(zoomLevel <= alkisMinZoom ? alkisMinZoom : zoomLevel)
35+
3336
const activeMaskIds =
3437
instance.$store.getters['plugin/layerChooser/activeMaskIds']
3538
if (!activeMaskIds.includes(alkisWms)) {

0 commit comments

Comments
 (0)