@orbat-mapper/tactical-draw-adapter-maplibre 0.3.17 → 0.3.19

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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -1
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -28,6 +28,12 @@ function sameOrder(a, b) {
28
28
  for (let index = 0; index < a.length; index++) if (a[index] !== b[index]) return false;
29
29
  return true;
30
30
  }
31
+ /** Absent and empty geometries have no entry in MapLibre's tile index to update. */
32
+ function hasGeometryCoordinates(geometry) {
33
+ if (!geometry) return false;
34
+ if (geometry.type === "GeometryCollection") return geometry.geometries.some(hasGeometryCoordinates);
35
+ return geometry.coordinates.length > 0;
36
+ }
31
37
  /**
32
38
  * Replace the contents of shared-id features while adding/removing ids that
33
39
  * entered or left a stable group bundle. Remove stale keys explicitly instead
@@ -47,7 +53,7 @@ function buildGeoJSONSourceDiff(previousFeatures, nextFeatures) {
47
53
  add.push(feature);
48
54
  continue;
49
55
  }
50
- if (feature.geometry === null) {
56
+ if (!hasGeometryCoordinates(feature.geometry) || !hasGeometryCoordinates(previous.geometry)) {
51
57
  remove.push(feature.id);
52
58
  add.push(feature);
53
59
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbat-mapper/tactical-draw-adapter-maplibre",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "description": "MapLibre GL JS engine adapter for @orbat-mapper/tactical-draw. Draw and edit tactical control measures (MIL-STD-2525 / APP-6) on a MapLibre map.",
5
5
  "license": "MIT",
6
6
  "author": "Orbat Mapper",
@@ -37,8 +37,8 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@orbat-mapper/control-measures": "^0.22.0",
41
- "@orbat-mapper/tactical-draw": "^0.6.2"
40
+ "@orbat-mapper/tactical-draw": "^0.7.0",
41
+ "@orbat-mapper/control-measures": "^0.23.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "maplibre-gl": ">=5.8.0 <7.0.0"