Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#639 Support marker bearings with configurable icons #640

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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