[openstreetmap/openstreetmap-website] Consolidate leaflet marker creation in OSM.getMarker (PR #5860)

Marwin Hochfelsner notifications at github.com
Sat Mar 29 00:26:28 UTC 2025


@hlfan commented on this pull request.



> @@ -391,13 +391,17 @@ OSM.isDarkMap = function () {
   return window.matchMedia("(prefers-color-scheme: dark)").matches;
 };
 
-OSM.getUserIcon = function (url) {
-  return L.icon({
-    iconUrl: url || OSM.MARKER_RED,
-    iconSize: [25, 41],
-    iconAnchor: [12, 41],
-    popupAnchor: [1, -34],
-    shadowUrl: OSM.MARKER_SHADOW,
-    shadowSize: [41, 41]
-  });
+OSM.getMarker = function ({ icon = "MARKER_RED", shadow = true }) {
+  const height = icon.includes("NOTE") ? 40 : 41;

Probably including height in the parameters is a better solution. #5854 which I wrote this im mind with would remove that change anyway so I didn't think about that.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5860#discussion_r2019619306
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5860/review/2727110303 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250328/0790e5c1/attachment.htm>


More information about the rails-dev mailing list