@orbat-mapper/tactical-draw-adapter-maplibre 0.2.0-alpha.0 → 0.2.0-alpha.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
@@ -1,13 +1,11 @@
1
1
  # @orbat-mapper/tactical-draw-adapter-maplibre
2
2
 
3
- The [MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) engine adapter for
4
- the `@orbat-mapper/tactical-draw` toolkit. It implements the `MapAdapter` contract
5
- from `@orbat-mapper/tactical-draw` on top of MapLibre, so the engine-agnostic
6
- draw/edit controllers — sessions, draw rules, gestures, handle rendering — run
7
- unchanged against a MapLibre map.
3
+ [MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) bindings for
4
+ `@orbat-mapper/tactical-draw`. `MapLibreAdapter` implements the `MapAdapter`
5
+ contract, so the draw/edit sessions, draw rules, gestures, and handle
6
+ rendering from `tactical-draw` run unchanged on a MapLibre map.
8
7
 
9
- `maplibre-gl` is declared as a **peer dependency**, so you bring your own single
10
- copy and never install an engine you don't use.
8
+ `maplibre-gl` is a peer dependency — your app supplies the version.
11
9
 
12
10
  ## Installation
13
11
 
@@ -34,8 +32,11 @@ const adapter = new MapLibreAdapter(map);
34
32
  const draw = new TacticalDraw(adapter);
35
33
  ```
36
34
 
37
- Hand the adapter to `TacticalDraw` and drive draw/edit exactly as with any other
38
- engine adapter in the family.
35
+ ## Quick Links
36
+
37
+ - [`@orbat-mapper/tactical-draw`](https://www.npmjs.com/package/@orbat-mapper/tactical-draw) — the draw/edit core this adapter plugs into
38
+ - [`@orbat-mapper/control-measures`](https://www.npmjs.com/package/@orbat-mapper/control-measures) — generates the control measures as GeoJSON
39
+ - [GitHub repository](https://github.com/orbat-mapper/tactical-graphics)
39
40
 
40
41
  ## License
41
42
 
package/dist/index.mjs CHANGED
@@ -315,13 +315,17 @@ var MapLibreAdapter = class extends BaseMapAdapter {
315
315
  }
316
316
  attachViewChange(handler) {
317
317
  const fn = () => handler();
318
+ this.map.on("zoom", fn);
319
+ this.map.on("rotate", fn);
320
+ this.map.on("pitch", fn);
318
321
  this.map.on("moveend", fn);
319
- this.map.on("zoomend", fn);
320
322
  return { fn };
321
323
  }
322
324
  detachViewChange(token) {
325
+ this.map.off("zoom", token.fn);
326
+ this.map.off("rotate", token.fn);
327
+ this.map.off("pitch", token.fn);
323
328
  this.map.off("moveend", token.fn);
324
- this.map.off("zoomend", token.fn);
325
329
  }
326
330
  createEditPointerDriver() {
327
331
  const map = this.map;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbat-mapper/tactical-draw-adapter-maplibre",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.2.0-alpha.1",
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.2.0-alpha.0",
41
- "@orbat-mapper/tactical-draw": "^0.2.0-alpha.0"
40
+ "@orbat-mapper/control-measures": "^0.2.0-alpha.6",
41
+ "@orbat-mapper/tactical-draw": "^0.2.0-alpha.5"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "maplibre-gl": ">=4.0.0 <6.0.0"