Skip to content

Commit 764cec0

Browse files
use variable for map creation
1 parent b915637 commit 764cec0

File tree

1 file changed

+31
-33
lines changed

1 file changed

+31
-33
lines changed

packages/clients/dish/src/polar-client.ts

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,37 @@ export default {
2020
client.rawLayerList.initializeLayerList(layerConf)
2121
const mapConfiguration = getMapConfiguration(mode, urlParams)
2222

23-
await client
24-
.createMap({
25-
containerId,
26-
mapConfiguration: merge(
27-
{
28-
...mapConfiguration,
29-
layerConf,
30-
},
31-
configOverride || {}
32-
),
33-
})
34-
.then((map) => {
35-
const parameters = new URL(document.location as unknown as string)
36-
.searchParams
37-
// using naming from backend to avoid multiple names for same thing
38-
const objektId = parameters.get('ObjektID')
39-
if (mode === 'INTERN') {
40-
subscribeToExportedMap(map)
41-
if (typeof objektId === 'string' && objektId !== '') {
42-
zoomToInternalFeature(map, objektId, urlParams)
43-
}
44-
} else if (typeof objektId === 'string' && mode === 'EXTERN') {
45-
navigateToDenkmal(map, objektId)
46-
}
47-
// @ts-expect-error | intentionally expand window; no environment affected
48-
window.openBenutzungshinweise = function (isIntern = false) {
49-
map.$store.commit(
50-
'plugin/modal/setContent',
51-
isIntern ? CONTENT_ENUM.HINTSINTERN : CONTENT_ENUM.HINTS
52-
)
53-
map.$store.commit('plugin/modal/setClosed', false)
54-
}
55-
})
23+
const map = await client.createMap({
24+
containerId,
25+
mapConfiguration: merge(
26+
{
27+
...mapConfiguration,
28+
layerConf,
29+
},
30+
configOverride || {}
31+
),
32+
})
33+
34+
const parameters = new URL(document.location as unknown as string)
35+
.searchParams
36+
// using naming from backend to avoid multiple names for same thing
37+
const objektId = parameters.get('ObjektID')
38+
if (mode === 'INTERN') {
39+
subscribeToExportedMap(map)
40+
if (typeof objektId === 'string' && objektId !== '') {
41+
zoomToInternalFeature(map, objektId, urlParams)
42+
}
43+
} else if (typeof objektId === 'string' && mode === 'EXTERN') {
44+
navigateToDenkmal(map, objektId)
45+
}
46+
// @ts-expect-error | intentionally expand window; no environment affected
47+
window.openBenutzungshinweise = function (isIntern = false) {
48+
map.$store.commit(
49+
'plugin/modal/setContent',
50+
isIntern ? CONTENT_ENUM.HINTSINTERN : CONTENT_ENUM.HINTS
51+
)
52+
map.$store.commit('plugin/modal/setClosed', false)
53+
}
5654
},
5755
}
5856

0 commit comments

Comments
 (0)