Browse Source

Add custom map marker icon

master
Skylar Ittner 7 months ago
parent
commit
e492b36ead
2 changed files with 10 additions and 9 deletions
  1. 2
    0
      www/img/mapmarker.svg
  2. 8
    9
      www/js/map.js

+ 2
- 0
www/img/mapmarker.svg View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 25 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-1.0262 -5.5298)"><path d="m13.557 44.744c-0.85642-4.2055-2.3677-7.7061-4.197-10.95-1.3571-2.406-2.9293-4.6274-4.3839-6.9602-0.48562-0.77903-0.90472-1.6023-1.3714-2.4102-0.93304-1.6167-1.6895-3.4912-1.6414-5.9218 0.046946-2.3753 0.73387-4.2804 1.7246-5.8386 1.6292-2.5624 4.3584-4.6632 8.0202-5.2153 2.9941-0.4514 5.8012 0.31123 7.7916 1.4752 1.6266 0.95116 2.8865 2.2218 3.8438 3.7193 0.99947 1.5629 1.6877 3.4093 1.7453 5.8178 0.02962 1.2339-0.17239 2.3765-0.45706 3.3245-0.28798 0.95941-0.75122 1.7614-1.1634 2.6179-0.80471 1.6722-1.8134 3.2043-2.8258 4.7372-3.0155 4.5664-5.8458 9.2233-7.0852 15.604z" fill="#ff9800" fill-rule="evenodd" stroke="#f57c00" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.8694"/></g></svg>

+ 8
- 9
www/js/map.js View File

@@ -57,15 +57,14 @@ var leafletpeoplelayer = L.geoJson(
}
},
pointToLayer: function (feature, latlng) {
return L.marker(latlng);
// return L.circleMarker(latlng, {
// radius: 14,
// fillColor: "#f00",
// color: "#000",
// weight: 1,
// opacity: 1,
// fillOpacity: 0.6
// });
return L.marker(latlng, {
icon: L.icon({
iconUrl: "img/mapmarker.svg",
iconSize: [25, 41],
iconAnchor: [12.5, 40],
popupAnchor: [0, -28]
})
});
}
}
);

Loading…
Cancel
Save