Allow the icon URL to be only a full path (#223)

This commit is contained in:
Richard Wiseman 2023-03-09 16:55:09 +00:00 committed by GitHub
parent 8009d215e5
commit 77083c1ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1793,7 +1793,7 @@ function setMarker(data) {
marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag}); marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag});
labelOffset = [12,-4]; labelOffset = [12,-4];
} }
else if (data.icon.match(/^https?:.*$/)) { else if (data.icon.match(/^https?:.*$|^\//)) {
var sz = data.iconSize ?? 32; var sz = data.iconSize ?? 32;
myMarker = L.icon({ myMarker = L.icon({
iconUrl: data.icon, iconUrl: data.icon,