-
Notifications
You must be signed in to change notification settings - Fork 3
feat(addressSearch): migrate plugin #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
eea2927
faccb12
25215ac
95010c8
1e56a36
c9cd65a
c39604a
77c8bef
b8da24f
6fae14a
1c0c478
f20a697
624c62f
629ac2f
2e7a3c0
06ba0e8
0077f81
deefa51
64cc447
ac924b9
0a2308a
caeb7ad
61bbd59
8526a36
28f4ec5
d647740
ff73491
195b8c4
060699e
f0322c3
4786e44
8c061df
8a18204
ef931b6
b6fcb6f
3b98c4d
afc8b1e
7e0b8ff
a1d0fb3
84be7a9
d03069c
1706a6a
db78ce4
bf54909
5764cab
6003e2f
d17d646
d59e9e7
7f646bb
e85373c
9aeb7f3
e79eb92
1b12f50
f837d4b
935b73c
8d266e7
19b06c2
39e5142
700dd17
fc16e5e
8d23340
d9fdc55
9d54c08
446ca17
d878b3a
db63408
643924b
39f18a3
b138100
a467a12
2a937c0
dd52a7f
00e6087
806858c
3a9f729
59c2f73
042563d
4af7955
a7db025
6f3d08d
f7573d8
0a7f22f
5997abc
a60e5c5
c91dbb0
df3ebcf
49a0beb
f74c5e7
c051815
0acb8f8
054f5e5
3fc80ae
68eb05f
48e9b51
f2e371f
021edab
d7bea57
aef3c5e
9e656fa
066b4a8
9422fc9
4731b9d
724a7e4
b1552f7
fb9c796
4abc1e0
f277bec
908b1a7
b7eb0f4
224962b
bf7d8fa
65839a5
7dc9ce0
080ce6b
739a1fe
0dfc22e
798a644
9b30ec9
eda4bd2
37d5a76
55519cb
4242e2f
a86418a
27dd836
3e79222
2ec3b4a
474098e
4012763
b554e89
b0f6557
40df10e
94ead2d
b9b607f
5f282d8
11a871a
9b0df82
b4d2327
0d0945f
61410e3
5428eab
5a3fb1f
084009c
5d7d893
5ed0daf
0def8f2
0f442a6
f1e58a4
4222a76
130cd86
65d0ac2
253b28f
30e054e
bbabbc2
b08d4b0
2d062ca
52d69ad
8ff1b1b
1c38873
62c13da
57b928a
443b30c
a5f507d
db6862b
7fe72fe
0d75f4e
ca9e6bc
b6a1ff1
c2b922e
c157746
2f95bcb
c3c7c0e
73414bd
f91f4e6
10cff89
d6e2684
fb7f20b
bf3061f
74cbdf1
a698276
110b932
d29a774
2943896
6f11193
7c47c09
22dcc9b
981839f
659c97d
92a2353
c76e5d2
fab8e64
5f48ee6
6659597
42d9c6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,8 +29,12 @@ | |
| import type { PolarContainer } from '@polar/polar' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On my mobile device, when testing the snowbox, the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though this is a comment on
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed 621ba98 |
||
|
|
||
| import { addPlugins, getStore, subscribe } from '@polar/polar' | ||
| import pluginAddressSearch from '@polar/polar/plugins/addressSearch' | ||
| import pluginFullscreen from '@polar/polar/plugins/fullscreen' | ||
| import pluginIconMenu from '@polar/polar/plugins/iconMenu' | ||
| import pluginLayerChooser from '@polar/polar/plugins/layerChooser' | ||
| import pluginPins from '@polar/polar/plugins/pins' | ||
| import pluginReverseGeocoder from '@polar/polar/plugins/reverseGeocoder' | ||
| import pluginScale from '@polar/polar/plugins/scale' | ||
| import pluginToast from '@polar/polar/plugins/toast' | ||
| import { ref, useTemplateRef, watch } from 'vue' | ||
|
|
@@ -53,6 +57,10 @@ watch(map, (map) => { | |
| layoutTag: 'TOP_RIGHT', | ||
| menus: [ | ||
| [ | ||
| { | ||
| plugin: pluginLayerChooser({}), | ||
| icon: 'kern-icon-fill--layers', | ||
| }, | ||
| { | ||
| plugin: pluginFullscreen({ renderType: 'iconMenu' }), | ||
| }, | ||
|
|
@@ -64,6 +72,36 @@ watch(map, (map) => { | |
| layoutTag: 'BOTTOM_RIGHT', | ||
| showScaleSwitcher: false, | ||
| }), | ||
| pluginAddressSearch({ | ||
| displayComponent: true, | ||
| layoutTag: 'TOP_LEFT', | ||
| searchMethods: [], | ||
| }), | ||
| pluginPins({ | ||
| coordinateSources: [{ plugin: 'addressSearch', key: 'chosenAddress' }], | ||
| boundary: { | ||
| layerId: '1693', | ||
| }, | ||
| movable: 'drag', | ||
| style: { | ||
| fill: '#FF0019', | ||
| }, | ||
| toZoomLevel: 7, | ||
| }), | ||
| pluginReverseGeocoder({ | ||
| url: 'https://geodienste.hamburg.de/HH_WPS', | ||
| coordinateSources: [ | ||
| { | ||
| plugin: 'pins', | ||
| key: 'coordinate', | ||
| }, | ||
| ], | ||
| addressTarget: { | ||
| plugin: 'addressSearch', | ||
| key: 'selectResult', | ||
| }, | ||
| zoomTo: 7, | ||
| }), | ||
| pluginToast({ | ||
| displayComponent: true, | ||
| layoutTag: 'BOTTOM_MIDDLE', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| export default [ | ||
| { | ||
| id: '23420', | ||
| name: 'basemap.de Web Raster Farbe', | ||
| url: 'https://sgx.geodatenzentrum.de/wms_basemapde', | ||
| typ: 'WMS', | ||
| layers: 'de_basemapde_web_raster_farbe', | ||
| format: 'image/png', | ||
| version: '1.3.0', | ||
| singleTile: false, | ||
| transparent: true, | ||
| transparency: 0, | ||
| urlIsVisible: true, | ||
| tilesize: 512, | ||
| gutter: 0, | ||
| minScale: '0', | ||
| maxScale: '2500000', | ||
| legendURL: '', | ||
| cache: false, | ||
| featureCount: 5, | ||
| }, | ||
| { | ||
| id: '23421', | ||
| name: 'basemap.de Web Raster Grau', | ||
| url: 'https://sgx.geodatenzentrum.de/wms_basemapde', | ||
| typ: 'WMS', | ||
| layers: 'de_basemapde_web_raster_grau', | ||
| format: 'image/png', | ||
| version: '1.3.0', | ||
| singleTile: false, | ||
| transparent: true, | ||
| transparency: 0, | ||
| urlIsVisible: true, | ||
| tilesize: 512, | ||
| gutter: 0, | ||
| minScale: '0', | ||
| maxScale: '2500000', | ||
| legendURL: '', | ||
| cache: false, | ||
| featureCount: 5, | ||
| }, | ||
| { | ||
| id: '1454', | ||
| name: 'Ausgleichsflächen', | ||
| url: 'https://geodienste.hamburg.de/HH_WFS_Ausgleichsflaechen', | ||
| typ: 'WFS', | ||
| featureType: 'ausgleichsflaechen', | ||
| outputFormat: 'XML', | ||
| version: '1.1.0', | ||
| featureNS: 'https://registry.gdi-de.org/id/de.hh.up', | ||
| featurePrefix: 'de.hh.up', | ||
| legendURL: '', | ||
| }, | ||
| { | ||
| id: '6059', | ||
| name: 'MML Anliegen', | ||
| url: 'https://geodienste.hamburg.de/lgv-config/anliegen_extern.json', | ||
| typ: 'GeoJSON', | ||
| format: 'XML', | ||
| version: '1.0', | ||
| minScale: '0', | ||
| maxScale: '2500000', | ||
| legendURL: '', | ||
| urlIsVisible: true, | ||
| }, | ||
| { | ||
| id: 'denkmaelerWMS', | ||
| name: 'Denkmal WMS', | ||
| url: 'https://efi2-deegree.schleswig-holstein.de/dish-deegree/services/wms_shp', | ||
| typ: 'WMS', | ||
| layers: '0,1,2,3,4,6,24,25', | ||
| legendURL: 'ignore', | ||
| format: 'image/png', | ||
| version: '1.3.0', | ||
| transparent: true, | ||
| }, | ||
| { | ||
| id: '1693', | ||
| name: 'Landesgrenze', | ||
| url: 'https://geodienste.hamburg.de/HH_WFS_Verwaltungsgrenzen', | ||
| typ: 'WFS', | ||
| featureType: 'landesgrenze', | ||
| outputFormat: 'XML', | ||
| version: '1.1.0', | ||
| featureNS: 'http://www.deegree.org/app', | ||
| featurePrefix: 'app', | ||
| }, | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| import { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Differing to the snowbox configuration, the reverse geocoder is no longer configured in this example. It also no longer works in the snowbox, but previously did. I suggest you configure it in the iceberg client, too, to test whether the two plugins interoperate as expected. After all, AddressSearch♥Pins♥ReverseGeocoder are the three musketeers of figuring out what is where.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reverse geocoder only works for addresses in Hamburg, thus setting a pin anywhere else won't yield a result. However, I've added the layer for the boundary of Hamburg to remove confusion while also centering the map initally on Hamburg as otherwise the layer is not yet loaded and the pin would be set either way 22dcc9b However, I've added the reverse geocoder to |
||
| fetchServiceRegister, | ||
| type MapConfiguration, | ||
| type MasterportalApiServiceRegister, | ||
| } from '@polar/polar' | ||
| import { defineStore } from 'pinia' | ||
| import { ref, reactive, watch } from 'vue' | ||
| import { ref, reactive } from 'vue' | ||
|
|
||
| import type { MpapiParameters } from '@/lib/getFeatures/types' | ||
|
|
||
| import services from '../services' | ||
|
|
||
| export const useIcebergStore = defineStore('iceberg', () => { | ||
| const mapConfiguration = reactive<MapConfiguration>({ | ||
|
|
@@ -14,29 +17,92 @@ export const useIcebergStore = defineStore('iceberg', () => { | |
| id: '23420', | ||
| visibility: true, | ||
| type: 'background', | ||
| name: 'snowbox.layers.basemap', | ||
| name: 'Basemap.de (Farbe)', | ||
| }, | ||
| { | ||
| id: '23421', | ||
| visibility: true, | ||
| type: 'background', | ||
| name: 'Basemap.de (Grau)', | ||
| }, | ||
| { | ||
| id: '1454', | ||
| type: 'mask', | ||
| name: 'Ausgleichsflächen', | ||
| styleId: 'panda', | ||
| visibility: true, | ||
| minZoom: 5, | ||
| }, | ||
| { | ||
| id: '1693', | ||
| visibility: true, | ||
| hideInMenu: true, | ||
| type: 'mask', | ||
| name: 'Stadtgrenze Hamburg', | ||
| }, | ||
| { | ||
| id: 'denkmaelerWMS', | ||
| type: 'mask', | ||
| name: 'Kulturdenkmale', | ||
| visibility: true, | ||
| options: { | ||
| layers: { | ||
| order: '6,24,25,4,3,2,1,0', | ||
| title: { | ||
| /* eslint-disable @typescript-eslint/naming-convention */ | ||
| 6: 'Denkmalbereich', | ||
| 24: 'Mehrheit von baulichen Anlagen', | ||
| 25: 'Sachgesamtheit', | ||
| 4: 'Baudenkmal', | ||
| 3: 'Gründenkmal', | ||
| 2: 'Gewässer', | ||
| 1: 'Baudenkmal (Fläche)', | ||
| 0: 'Gründenkmal (Fläche)', | ||
| /* eslint-enable @typescript-eslint/naming-convention */ | ||
| }, | ||
| legend: true, | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| startCenter: [573364, 6028874], | ||
| startCenter: [565874, 5934140], | ||
| layout: 'nineRegions', | ||
| addressSearch: { | ||
| searchMethods: [ | ||
| { | ||
| queryParameters: { | ||
| searchStreets: true, | ||
| searchHouseNumbers: true, | ||
| } as MpapiParameters, | ||
| type: 'mpapi', | ||
| url: 'https://geodienste.hamburg.de/HH_WFS_GAGES?service=WFS&request=GetFeature&version=2.0.0', | ||
| }, | ||
| ], | ||
| minLength: 3, | ||
| waitMs: 300, | ||
| focusAfterSearch: true, | ||
| groupProperties: { | ||
| // @ts-expect-error | defaultGroup has a default label | ||
| defaultGroup: { | ||
| limitResults: 5, | ||
| }, | ||
| }, | ||
| }, | ||
| fullscreen: { | ||
| displayComponent: true, | ||
| layoutTag: 'TOP_RIGHT', | ||
| }, | ||
| pins: { | ||
| coordinateSources: [{ plugin: 'addressSearch', key: 'chosenAddress' }], | ||
| movable: 'drag', | ||
| style: { | ||
| fill: '#FF0019', | ||
| }, | ||
| toZoomLevel: 7, | ||
| }, | ||
| }) | ||
|
|
||
| const serviceRegisterUrl = ref( | ||
| 'https://geodienste.hamburg.de/services-internet.json' | ||
| ) | ||
|
|
||
| const serviceRegister = ref<MasterportalApiServiceRegister>([]) | ||
| watch( | ||
| serviceRegisterUrl, | ||
| async (url) => { | ||
| serviceRegister.value = await fetchServiceRegister(url) | ||
| }, | ||
| { immediate: true } | ||
| ) | ||
| const serviceRegister = ref<MasterportalApiServiceRegister>(services) | ||
|
|
||
| return { | ||
| mapConfiguration, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most parts of the map are currently not interactable with pointer devices. This becomes especially apparent when clicking a search result and trying to move the pin. However, it also occurs when trying to pan the map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #479 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 621ba98