@eox/layercontrol 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,19 +9,78 @@ npm install @eox/layercontrol
9
9
  ```
10
10
  import "@eox/layercontrol"
11
11
 
12
- <eox-layercontrol></eox-layercontrol>
12
+ <eox-layercontrol for="eox-map"></eox-layercontrol>
13
13
  ```
14
14
 
15
- // TODO: add documentation
15
+ ## Attributes
16
+
17
+ ### `for: string = "eox-map"` (when used with `eox-map`)
18
+
19
+ The query selector of the `eox-map` you wish to attch the layer control to. When used with a vanilla OpenLayer map, see the [`attachTo` method](#attachtomapobject-map-when-used-with-a-vanilla-openlayer-map) instead.
20
+
21
+ ### `layerIdentifier: string = "id"`
22
+
23
+ The layer identifier property of the layers. Fallback is set automatically based on `ol_uid` if not provided.
24
+
25
+ ### `layerTitle: string = "title"`
26
+
27
+ The layer title property of the layers. "title" by default, fallback is set automatically based on "layer" + `ol_uid` if not provided.
28
+
29
+ ### `layerConfig: Array<string> = ["opacity"]`
30
+
31
+ // TODO
32
+
33
+ ### `externalLayerConfig: Boolean = undefined`
34
+
35
+ // TODO
36
+
37
+ ### `unstyled: Boolean`
38
+
39
+ Display the unstyled version of the layer control.
40
+
41
+ ## Methods
42
+
43
+ ### `attachTo(mapObject: Map)` (when used with a vanilla OpenLayer map)
44
+
45
+ Attach the layer control to an OpenLayer map instance. When used with an `eox-map`, see the [`for` attribute](#for-when-used-with-eox-map) instead.
46
+
47
+ ## Layer properties
48
+ In order to be displayed correctly, the OpenLayers map layers need some custom properties (using e.g. `layer.set(property, value)`).
49
+
50
+ ### `id?: string`
51
+
52
+ The layer id. Not required but recommended (see [automatic fallback](#layeridentifier-string--id)).
53
+
54
+ ### `title?: string`
55
+
56
+ The title of the layer displayed in the layer control. Not required (see [automatic fallback](#layertitle-string--title)), but recommended in order to display human-readable layer titles.
57
+
58
+ ### `layerControlHide?: Boolean`
59
+
60
+ Completely hide a layer from the layer control.
61
+ ### `layerControlOptional?: Boolean`
62
+
63
+ Initially hide a layer from the layer control, but make it available as an optional layer. If the layer is selected and added, it will be set to visible and pushed to the top of the layer list or (if originally configured within a layer group) to the top of the layer group.
64
+
65
+ ### `layerControlExclusive?: Boolean`
66
+
67
+ Make layers mutually exclusive. If two or more layers (on the same level, i.e. at root or inside a layer group) have this property, then only one of them can be visualized at a time.
68
+
16
69
 
17
70
  ## Contribute
18
71
 
72
+ ### Setup
73
+
19
74
  ```
20
- npm watch
21
- (on root) npm run cypress
22
- (on root) npm run format
75
+ npm install
76
+ npm start
77
+ npm run format
23
78
 
24
79
  npm version <new version>
25
80
  npm run build
26
81
  npm publish (requires OTP)
27
82
  ```
83
+
84
+ ### Testing
85
+
86
+ // TODO