Skip to content

Commit

Permalink
#639 Support marker bearings with configurable icons
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Mar 5, 2025
1 parent 7c849b9 commit 69c5382
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
13 changes: 10 additions & 3 deletions configure/src/metaconfigs/layer-vector-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
{
"field": "style.shapeIcon",
"name": "Shape From Icon",
"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>",
"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>",
"type": "text",
"width": 3
},
Expand All @@ -270,6 +270,13 @@
"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.",
"type": "text",
"width": 3
},
{
"field": "style.shapeRotationOffset",
"name": "Shape Rotation Offset",
"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.",
"type": "number",
"width": 3
}
]
},
Expand Down Expand Up @@ -1156,7 +1163,7 @@
{
"field": "variables.markerAttachments.bearing.enabled",
"name": "Enabled",
"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.",
"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.",
"type": "switch",
"width": 3,
"defaultChecked": false
Expand All @@ -1183,7 +1190,7 @@
{
"field": "variables.markerAttachments.bearing.color",
"name": "Color",
"description": "A color for the directional arrow for non-markerIcon bearings.",
"description": "A color for the directional arrow for non-Shape-from-Icon and non-Marker-Icon bearings.",
"type": "colorpicker",
"width": 4
}
Expand Down
12 changes: 10 additions & 2 deletions src/essence/Basics/Layers_/LayerConstructors.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,13 @@ export const constructVectorLayer = (
((layerObj.style.radius || layerObj.radius || 8) *
2) /
24
}); text-shadow:
}) rotate(${
(layerObj.style.shapeRotationOffset != null
? parseFloat(layerObj.style.shapeRotationOffset)
: 0) + (yaw || 0)
}deg); ${
layerObj.style.weight != 0
? `text-shadow:
1px 1px 0px ${featureStyle.color},
-1px -1px 0px ${featureStyle.color},
1px -1px 0px ${featureStyle.color},
Expand All @@ -408,7 +414,9 @@ export const constructVectorLayer = (
0px 1px 0px ${featureStyle.color},
-1px 0px 0px ${featureStyle.color},
0px -1px 0px ${featureStyle.color},
1px 0px 0px ${featureStyle.color};
1px 0px 0px ${featureStyle.color}; `
: ''
}
display: block;
text-align: center;"
><i class='mdi mdi-${finalShape.replace(
Expand Down

0 comments on commit 69c5382

Please sign in to comment.