You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/core/CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,11 @@
6
6
- Breaking: Remove support for marking client CSS via `data-polar="true"`. Please use the configuration parameter `stylePath` instead.
7
7
- Feature: Add new state parameter `mapHasDimensions` to let plugins have a "hook" to react on when the map is ready.
8
8
- Feature: Add `deviceIsHorizontal` as a getter to have a more central place to check if the device is in landscape mode.
9
+
- Feature: Add clearer documentation regarding `@masterportal/masterportalapi` related configuration parameters including examples.
10
+
- Feature: Officially add support for WMTS layers.
11
+
- Feature: Add reasonable default values for configuration parameters `epsg`, `options`, `namedProjections` and `startResolution`.
12
+
- Fix: Document `rawLayerList.initializeLayerList` as an essential step when creating a client.
13
+
- Fix: Move basic documentation of `layers` from `@polar/plugin-layer-chooser` to `@polar/core`.
9
14
- Fix: Adjust documentation to properly describe optionality of configuration parameters.
10
15
- Fix: Add package `events` as a dependency to fix issue with `xml2js`. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/697 for more information.
@@ -21,7 +21,7 @@ It is important to note that the behaviour will be desktop-like on larger touchs
21
21
22
22
It depends on the client how exactly the initialization will take place for the embedding programmer. However, the core mechanism remains the same.
23
23
24
-
The exported default object is an extended masterportalAPI, adding the `addPlugins` and extending the `createMap` functions. For masterportalAPI details, [see their repository](https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/src/master/).
24
+
The exported default object is an extended masterportalapi, adding the `addPlugins` and extending the `createMap` functions. For masterportalapi details, [see their repository](https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/src/master/).
If the storeModule features a `setupModule` action, it will be executed automatically after initialization.
50
50
51
+
### initializeLayerList
52
+
53
+
Layers intended to be used in the map have to be initialized by calling `initializeLayerList` with a service register.
54
+
This register may either be a link to a predefined service register like [the Hamburg service register](https://geodienste.hamburg.de/services-internet.json), or the custom service register that is also used in [mapConfiguration.layerConf](#mapconfigurationlayerconf).
[createMap](#createmap) is usually called inside the callback or directly after this function call.
61
+
51
62
### createMap
52
63
53
64
The map is created by calling the `createMap` method. Depending on how you use POLAR, this may already have been done, as some clients come as ready-made standalone HTML pages that do this for you.
@@ -69,11 +80,10 @@ The mapConfiguration allows controlling many client instance details.
69
80
70
81
| fieldName | type | description |
71
82
| - | - | - |
72
-
| language | enum["de", "en"]| Initial language. |
73
-
| layerConf | LayerConf | Layer configuration as required by masterportalAPI. |
74
-
| <...masterportalAPI.fields> | various | The object is also used to initialize the masterportalAPI. Please refer to their documentation for options. |
83
+
| <...masterportalapi.fields> | various | Multiple different parameters are required by the masterportalapi to be able to create the map. Also, some fields are optional but relevant and thus described here as well. For all additional options, refer to the documentation of the masterportalapi itself. |
75
84
| checkServiceAvailability | boolean? | If set to `true`, all services' availability will be checked with head requests. |
76
-
| extendedMasterportalapiMarkers | extendedMasterportalapiMarkers? | Optional. If set, all configured visible vector layers' features can be hovered and selected by mouseover and click respectively. They are available as features in the store. Layers with `clusterDistance` will be clustered to a multi-marker that supports the same features. Please mind that this only works properly if you configure nothing but point marker vector layers styled by the masterportalAPI. |
85
+
| extendedMasterportalapiMarkers | extendedMasterportalapiMarkers? | Optional. If set, all configured visible vector layers' features can be hovered and selected by mouseover and click respectively. They are available as features in the store. Layers with `clusterDistance` will be clustered to a multi-marker that supports the same features. Please mind that this only works properly if you configure nothing but point marker vector layers styled by the masterportalapi. |
86
+
| language | enum["de", "en"]? | Initial language. |
77
87
| locales | LanguageOption[]? | All locales in POLAR's plugins can be overridden to fit your needs.|
78
88
| <plugin.fields> | various? | Fields for configuring plugins added with `addPlugins`. Refer to each plugin's documentation for specific fields and options. Global plugin parameters are described [below](#global-plugin-parameters). |
79
89
| renderFaToLightDom | boolean? | POLAR requires FontAwesome in the Light/Root DOM due to an [unfixed bug in many browsers](https://bugs.chromium.org/p/chromium/issues/detail?id=336876). This value defaults to `true`. POLAR will, by default, just add the required CSS by itself. Should you have a version of Fontawesome already included, you can try to set this to `false` to check whether the versions are interoperable. |
@@ -220,16 +230,65 @@ A full documentation of the masterportalapiPolygonFillHatch is available at the
220
230
>|patternColor|no|Number[]|`[255, 255, 255, 1]`|Fill color of pattern drawn on polygon.|
221
231
>|size|no|Number|`30`|Edge length of a singular repeated pattern element.|
222
232
223
-
##### mapConfiguration.LayerConf
233
+
##### <...masterportalapi.fields>
234
+
235
+
The `<...masterportalapi.fields>` means that any masterportalapi field may also be used here _directly_ in the mapConfiguration. The fields described here are fields that are interesting for the usage of POLAR.
236
+
Fields that are not set as required have default values.
237
+
238
+
| fieldName | type | description |
239
+
| - | - | - |
240
+
| layerConf | layerConf | Layer configuration of all available layers as a service register. Layers defined here are not directly shown in a client, see `mapconfiguration.layers` for that. |
241
+
| layers | layer[]| Configuration of layers that are supposed to be used in the respective client. All layers defined here have to have an entry in `mapConfiguration.layerConf`. If `@polar/plugin-layer-chooser` is installed and configured, all these layers will be displayed in that menu. |
242
+
| startCenter | number[]| Initial center coordinate. Needs to be defined in the chosen leading coordinate system. |
243
+
| epsg |`EPSG:${string}`? | Leading coordinate system. The coordinate system has to be defined in `mapConfiguration.namedProjections` as well. Changing this value should also lead to changes in `mapConfiguration.startCenter`, `mapConfiguration.extent`, `mapConfiguration.options` and `mapConfiguration.startResolution` as they are described in or related to the leading coordinate system. Defaults to `'EPSG:25832'`. |
244
+
| extent | number[]? | Map movement will be restricted to the rectangle described by the given coordinates. Unrestricted by default. |
245
+
| namedProjections | Array<[string,string]>? | Array of usable coordinated systems mapped to a projection as a proj4 string. Defines `'EPSG:25832'`, `'EPSG:3857'`, `'EPSG:4326'`, `'EPSG:31467'` and `'EPSG:4647'` by default. If you set a value, please mind that all pre-configured projections are overridden, and requiring e.g. `'EPSG:4326'` will only work if it is also defined in your override. |
246
+
| options | zoomOption[]? | Defines all available zoom levels mapped to the respective resolution and related scale. Defines 10 zoomLevels for `'EPSG:25832'` by default. |
247
+
| startResolution | number? | Initial resolution; must be described in `mapConfiguration.options`. Defaults to `15.874991427504629` which is zoom level to in the default of `mapConfiguration.options`. |
The layer configuration (or: service register) is read by the masterportalAPI. The full definition can be read [here](https://bitbucket.org/geowerkstatt-hamburg/masterportal/src/dev/doc/services.json.md).
281
+
##### mapConfiguration.layerConf
226
282
227
-
However, not all listed services have been implemented in the masterportalAPI yet, and no documentation regarding implemented properties exists there yet.
283
+
The layer configuration (or: service register) is read by the masterportalapi. The full definition can be read [here](https://bitbucket.org/geowerkstatt-hamburg/masterportal/src/dev/doc/services.json.md).
284
+
285
+
However, not all listed services have been implemented in the masterportalapi yet, and no documentation regarding implemented properties exists there yet.
@@ -253,48 +312,70 @@ Whitelisted and confirmed parameters include:
253
312
"version": "1.3.0",
254
313
"transparent": true,
255
314
"layers": ["A", "B"]
315
+
},
316
+
{
317
+
"id": "my-self-defined-wmts",
318
+
"urls": [
319
+
"url1/{TileMatrix}/{TileCol}/{TileRow}.png",
320
+
"url2/{TileMatrix}/{TileCol}/{TileRow}.png",
321
+
"url3/{TileMatrix}/{TileCol}/{TileRow}.png"
322
+
],
323
+
"typ": "WMTS",
324
+
"format": "image/png",
325
+
"coordinateSystem": "EPSG:3857",
326
+
"origin": [-20037508.3428, 20037508.3428],
327
+
"transparent": false,
328
+
"tileSize": "256",
329
+
"minScale": "1",
330
+
"maxScale": "2500000",
331
+
"tileMatrixSet": "google3857",
332
+
"requestEncoding": "REST",
333
+
"resLength": "20"
334
+
},
335
+
{
336
+
"id": "my-capabilities-wmts",
337
+
"capabilitiesUrl": "WMTS capabilities url",
338
+
"urls": "WMTS url",
339
+
"optionsFromCapabilities": true,
340
+
"tileMatrixSet": "EU_EPSG_25832_TOPPLUS",
341
+
"typ": "WMTS",
342
+
"layers": "layer-name",
343
+
"legendURL": "my-legend-url"
256
344
}
257
345
]
258
346
```
259
347
260
-
Since this is the base for many functions, the service ID set in this is used to reference map material in many places of the map client.
348
+
Since this is the base for many functions, the service id set in this is used to reference map material in many places of the map client.
261
349
262
-
#####<...masterportalAPI.fields>
350
+
###### zoomOption
263
351
264
-
The `<...masterportalAPI.fields>` means that any masterportalAPI field may also be used here _directly_. The most common fields are the following ones; for more, see masterportalAPI.
352
+
| fieldName | type | description |
353
+
| - | - | - |
354
+
| resolution | number | Size of 1 pixel on the screen converted to map units (e.g. meters) depending on the used projection (`epsg`). |
355
+
| scale | number | Scale in meters. |
356
+
| zoomLevel | number | Zoom level. |
357
+
358
+
##### layer
265
359
266
360
| fieldName | type | description |
267
361
| - | - | - |
268
-
| epsg | string | Leading coordinate system, e.g. `"EPSG:25832"`. |
269
-
| extent | number[]| Map movement will be restricted to this rectangle. |
270
-
| namedProjections | Array | Array of usable projections by proj4 string. |
271
-
| options | Array | Defines all available zoomLevels. Entries define `resolution`, `scale`, and `zoomLevel`. See masterportalAPI for details. |
272
-
| startCenter | number[]| Initial center coordinate. |
273
-
| startResolution | number | Initial resolution; must be in options. See below. |
362
+
| id | string | Service register id in `mapConfiguration.layerConf`. |
0 commit comments