@orbat-mapper/tactical-draw-adapter-maplibre 0.4.1 → 0.4.2

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/dist/index.d.mts CHANGED
@@ -65,6 +65,8 @@ declare class PinLayer implements CustomLayerInterface {
65
65
  private version;
66
66
  private resourceRevision;
67
67
  private needsDepth;
68
+ /** Whether a pin hit outranks an overlapping ordinary graphic during selection. */
69
+ prioritizesSelection: boolean;
68
70
  private elevationCache;
69
71
  private pendingElevation;
70
72
  private removed;
package/dist/index.mjs CHANGED
@@ -495,6 +495,8 @@ var PinLayer = class {
495
495
  version = 0;
496
496
  resourceRevision = -1;
497
497
  needsDepth = false;
498
+ /** Whether a pin hit outranks an overlapping ordinary graphic during selection. */
499
+ prioritizesSelection = false;
498
500
  elevationCache = /* @__PURE__ */ new Map();
499
501
  pendingElevation = /* @__PURE__ */ new Set();
500
502
  removed = false;
@@ -638,6 +640,7 @@ var PinLayer = class {
638
640
  }
639
641
  }
640
642
  this.pins = pins;
643
+ this.prioritizesSelection = pins[0]?.presentation.prioritizePins ?? false;
641
644
  if (this.elevationCache.size > pins.length * 60 + 1e3) this.elevationCache.clear();
642
645
  if (!this.program) {
643
646
  this.onStatus?.({
@@ -2611,7 +2614,7 @@ var MapLibreAdapter = class extends BaseMapAdapter {
2611
2614
  bearing: this.getBearing()
2612
2615
  });
2613
2616
  const pinHit = this.pinHit(layerId, [x, y], tol);
2614
- if (pinHit && (!candidate || pinHit.order >= (this.getFeatureGroupOrder(layerId, candidate.feature.id) ?? -1))) {
2617
+ if (pinHit && (pinHit.prioritize || !candidate || pinHit.order >= (this.getFeatureGroupOrder(layerId, candidate.feature.id) ?? -1))) {
2615
2618
  handler({
2616
2619
  id: pinHit.id,
2617
2620
  feature: pinHit.feature,
@@ -2696,7 +2699,8 @@ var MapLibreAdapter = class extends BaseMapAdapter {
2696
2699
  if (feature) return {
2697
2700
  id,
2698
2701
  feature,
2699
- order: this.getFeatureGroupOrder(layerId, feature.id) ?? 0
2702
+ order: this.getFeatureGroupOrder(layerId, feature.id) ?? 0,
2703
+ prioritize: pinLayer.prioritizesSelection
2700
2704
  };
2701
2705
  }
2702
2706
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbat-mapper/tactical-draw-adapter-maplibre",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
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/tactical-draw": "^0.9.0",
41
- "@orbat-mapper/control-measures": "^0.27.0"
40
+ "@orbat-mapper/control-measures": "^0.27.0",
41
+ "@orbat-mapper/tactical-draw": "^0.9.2"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "maplibre-gl": ">=5.8.0 <7.0.0"