Skip to content

Commit a237c0d

Browse files
#639 Support marker bearings with configurable icons (#640)
1 parent 7c849b9 commit a237c0d

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

configure/src/metaconfigs/layer-vector-config.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
{
261261
"field": "style.shapeIcon",
262262
"name": "Shape From Icon",
263-
"description": "Shape but taken from the Material Design Icon (mdi) library. akes priority over the value in the 'shape' field. See <a target='_blank' href='https://pictogrammers.com/library/mdi/'>https://pictogrammers.com/library/mdi/</a>",
263+
"description": "Shape but taken from the Material Design Icon (mdi) library. Takes priority over the value in the 'shape' field. See <a target='_blank' href='https://pictogrammers.com/library/mdi/'>https://pictogrammers.com/library/mdi/</a>",
264264
"type": "text",
265265
"width": 3
266266
},
@@ -270,6 +270,13 @@
270270
"description": "Shape but taken from each individual feature's property. For example 'shape' or 'path.to.prop.in.properties.object'. Takes priority over the value in the 'shape' and 'shape from icon' fields. Shape values are formatted like the dropdown options but all lowercase. Material Design Icon (mdi) icon names are also supported values.",
271271
"type": "text",
272272
"width": 3
273+
},
274+
{
275+
"field": "style.shapeRotationOffset",
276+
"name": "Shape Rotation Offset",
277+
"description": "A original offset by which the rotate the original shape/icon so that it is natively pointing up. Useful with Attachment - Marker Bearings where, for instance, a plane with a bearing is desired but the plane icon natively points leftward.",
278+
"type": "number",
279+
"width": 3
273280
}
274281
]
275282
},
@@ -1156,7 +1163,7 @@
11561163
{
11571164
"field": "variables.markerAttachments.bearing.enabled",
11581165
"name": "Enabled",
1159-
"description": "Sets a bearing direction (clockwise from north) of this layer's point markers (or markerIcons if set). Overrides the layer's shape dropdown value.",
1166+
"description": "Sets a bearing direction (clockwise from north) of this layer's point markers (or Shape from Icon or Marker Icons if set). Overrides the layer's shape dropdown value.",
11601167
"type": "switch",
11611168
"width": 3,
11621169
"defaultChecked": false
@@ -1183,7 +1190,7 @@
11831190
{
11841191
"field": "variables.markerAttachments.bearing.color",
11851192
"name": "Color",
1186-
"description": "A color for the directional arrow for non-markerIcon bearings.",
1193+
"description": "A color for the directional arrow for non-Shape-from-Icon and non-Marker-Icon bearings.",
11871194
"type": "colorpicker",
11881195
"width": 4
11891196
}

src/essence/Basics/Layers_/LayerConstructors.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,13 @@ export const constructVectorLayer = (
399399
((layerObj.style.radius || layerObj.radius || 8) *
400400
2) /
401401
24
402-
}); text-shadow:
402+
}) rotate(${
403+
(layerObj.style.shapeRotationOffset != null
404+
? parseFloat(layerObj.style.shapeRotationOffset)
405+
: 0) + (yaw || 0)
406+
}deg); ${
407+
layerObj.style.weight != 0
408+
? `text-shadow:
403409
1px 1px 0px ${featureStyle.color},
404410
-1px -1px 0px ${featureStyle.color},
405411
1px -1px 0px ${featureStyle.color},
@@ -408,7 +414,9 @@ export const constructVectorLayer = (
408414
0px 1px 0px ${featureStyle.color},
409415
-1px 0px 0px ${featureStyle.color},
410416
0px -1px 0px ${featureStyle.color},
411-
1px 0px 0px ${featureStyle.color};
417+
1px 0px 0px ${featureStyle.color}; `
418+
: ''
419+
}
412420
display: block;
413421
text-align: center;"
414422
><i class='mdi mdi-${finalShape.replace(

0 commit comments

Comments
 (0)