Skip to content

Commit

Permalink
Zero char works now as a marker symbol. The marker-symbol field is al…
Browse files Browse the repository at this point in the history
…so validated - if it does not match the allowed values it goes back to circle.
  • Loading branch information
razdravan authored May 25, 2023
1 parent 2be30c2 commit e15941d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/ui/map/clickable_marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class ClickableMarker extends mapboxgl.Marker {
symbolColor = "#fff"
} = options

if (symbol && symbol != "circle") {
if (
symbol != "circle" &&
(makiNames.includes(symbol) || /^[a-z0-9]$/.test(symbol))
) {
const symbolPath = document.createElement('path');
this._element.querySelector('circle').replaceWith(symbolPath)

Expand Down
4 changes: 2 additions & 2 deletions src/ui/map/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ const addMarkers = (geojson, context, writable) => {
}
}

let symbol = 'circle'
if (d.properties && d.properties['marker-symbol']) {
let symbol;
if (!(d.properties['marker-symbol'] === undefined)) {
symbol = d.properties['marker-symbol']
}

Expand Down

0 comments on commit e15941d

Please sign in to comment.