@orbat-mapper/tactical-draw 0.36.0 → 0.36.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 +2 -0
- package/dist/index.mjs +6 -2
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -80,6 +80,8 @@ declare abstract class BaseMapAdapter<TLayerHandle, TEventToken, TViewToken> imp
|
|
|
80
80
|
protected destroyEngineResources(): void;
|
|
81
81
|
protected applyIconResources(resources: readonly IconResource[]): void;
|
|
82
82
|
protected getIconResource(id: string): IconResource | undefined;
|
|
83
|
+
/** The groups layer `layerId` draws: the ones last passed to `applyFeatureGroups`. */
|
|
84
|
+
protected getFeatureGroups(layerId: LayerId): readonly FeatureGroup[];
|
|
83
85
|
protected getFeatureGroupOrder(layerId: LayerId, featureId: string | number | undefined): number | undefined;
|
|
84
86
|
protected removeIconResource(id: string): void;
|
|
85
87
|
private pruneIconResources;
|
package/dist/index.mjs
CHANGED
|
@@ -361,13 +361,13 @@ function evaluateGeometry(feature, presentation, context) {
|
|
|
361
361
|
function evaluatePolygon(pixel, rings, presentation, context, pickInterior) {
|
|
362
362
|
const { tolerance, toPixel, viewport } = context;
|
|
363
363
|
const projectedRings = rings.map((ring) => ring.map(toPixel));
|
|
364
|
-
const
|
|
364
|
+
const visiblyFilled = (presentation.fill?.opacity ?? 0) > 0;
|
|
365
|
+
const distance = hasVisibleBoundary(presentation) || visiblyFilled ? minimum(projectedRings.map((points) => minVisibleSegmentDistance(pixel, points, viewport))) : null;
|
|
365
366
|
if (distance !== null && distance <= tolerance) return {
|
|
366
367
|
kind: "polygon-boundary",
|
|
367
368
|
distance
|
|
368
369
|
};
|
|
369
370
|
if (!(projectedRings.length > 0 && pointInProjectedRing(pixel, projectedRings[0]) && !projectedRings.slice(1).some((points) => pointInProjectedRing(pixel, points)))) return null;
|
|
370
|
-
const visiblyFilled = (presentation.fill?.opacity ?? 0) > 0;
|
|
371
371
|
const inwardReach = context.pointerType === "touch" ? 36 : 24;
|
|
372
372
|
if (pickInterior || visiblyFilled || distance !== null && distance <= inwardReach) return {
|
|
373
373
|
kind: "polygon-interior",
|
|
@@ -853,6 +853,10 @@ var BaseMapAdapter = class {
|
|
|
853
853
|
getIconResource(id) {
|
|
854
854
|
return this.iconResources.get(id);
|
|
855
855
|
}
|
|
856
|
+
/** The groups layer `layerId` draws: the ones last passed to `applyFeatureGroups`. */
|
|
857
|
+
getFeatureGroups(layerId) {
|
|
858
|
+
return this.featureGroupState.get(layerId)?.groups ?? [];
|
|
859
|
+
}
|
|
856
860
|
getFeatureGroupOrder(layerId, featureId) {
|
|
857
861
|
if (featureId === void 0) return void 0;
|
|
858
862
|
return this.featureGroupState.get(layerId)?.orderByFeatureId.get(featureId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbat-mapper/tactical-draw",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.2",
|
|
4
4
|
"description": "Engine-agnostic draw/edit core for tactical control measures (MIL-STD-2525 / APP-6). The MapAdapter ABI and bring-your-own-engine entry point for the tactical-draw package family.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Orbat Mapper",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@orbat-mapper/control-measures": "^0.
|
|
42
|
+
"@orbat-mapper/control-measures": "^0.47.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vitest": ">=4.0.0"
|