@opensystemslab/map 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -68,7 +68,7 @@ staticMode = false;
68
68
 
69
69
  `hideResetControl` hides the `↻` button, which when clicked would re-center your map if you've zoomed or panned away from the default view. `staticMode` additionally hides the `+/-` buttons, and disables mouse and keyboard zoom and pan/drag interactions.
70
70
 
71
- #### Example: draw a custom polygon & calculate its' area
71
+ #### Example: draw a custom polygon & calculate its area
72
72
 
73
73
  ```html
74
74
  <body>
package/dist/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  />
15
15
  </head>
16
16
  <body>
17
- <my-map zoom="18" maxZoom="20" drawMode />
17
+ <my-map zoom="18" maxZoom="23" drawMode drawPointer="dot" />
18
18
 
19
19
  <script>
20
20
  const map = document.querySelector("my-map");
@@ -22,12 +22,27 @@
22
22
  map.addEventListener("ready", (event) => {
23
23
  console.log("map ready");
24
24
  });
25
+
26
+ // applicable when drawMode is enabled
25
27
  map.addEventListener("areaChange", ({ detail: area }) => {
26
28
  console.debug({ area });
27
29
  });
28
30
  map.addEventListener("geojsonChange", ({ detail: geojson }) => {
29
31
  console.debug({ geojson });
30
32
  });
33
+
34
+ // applicable when showFeaturesAtPoint is enabled
35
+ map.addEventListener("featuresAreaChange", ({ detail: featuresArea }) => {
36
+ console.debug({ featuresArea });
37
+ });
38
+ map.addEventListener("featuresGeojsonChange", ({ detail: featuresGeojson }) => {
39
+ console.debug({ featuresGeojson });
40
+ });
41
+
42
+ // applicable when geojsonData is provided
43
+ map.addEventListener("geojsonDataArea", ({ detail: geojsonDataArea }) => {
44
+ console.debug({ geojsonDataArea });
45
+ });
31
46
  </script>
32
47
  </body>
33
48
  </html>