@orbat-mapper/tactical-draw-adapter-maplibre 0.2.0-alpha.13 → 0.2.0-alpha.15

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 +17 -4
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -256,6 +256,11 @@ function buildSymbolLayer(symbolId, sourceId, text) {
256
256
  ],
257
257
  "#000"
258
258
  ];
259
+ const hasTextBackground = [
260
+ "boolean",
261
+ ["get", "textBackground"],
262
+ false
263
+ ];
259
264
  const textAnchor = text.labelProperty ? [
260
265
  "case",
261
266
  [
@@ -289,10 +294,18 @@ function buildSymbolLayer(symbolId, sourceId, text) {
289
294
  },
290
295
  paint: {
291
296
  "text-color": textColor,
292
- ...text.strokeColor ? {
293
- "text-halo-color": text.strokeColor,
294
- "text-halo-width": text.strokeWidth ?? 1
295
- } : {}
297
+ "text-halo-color": text.strokeColor ? text.strokeColor : [
298
+ "case",
299
+ hasTextBackground,
300
+ "#ffffff",
301
+ "rgba(255,255,255,0)"
302
+ ],
303
+ "text-halo-width": text.strokeColor ? text.strokeWidth ?? 1 : [
304
+ "case",
305
+ hasTextBackground,
306
+ 3,
307
+ 0
308
+ ]
296
309
  }
297
310
  };
298
311
  }
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.13",
3
+ "version": "0.2.0-alpha.15",
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.20",
41
- "@orbat-mapper/tactical-draw": "^0.2.0-alpha.28"
40
+ "@orbat-mapper/control-measures": "^0.2.0-alpha.22",
41
+ "@orbat-mapper/tactical-draw": "^0.2.0-alpha.30"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "maplibre-gl": ">=4.0.0 <6.0.0"