[openstreetmap/openstreetmap-website] More precise marker position (PR #6249)
Roman Deev
notifications at github.com
Fri Jul 25 16:35:28 UTC 2025
### Description
The marker is currently described as follows:
https://github.com/openstreetmap/openstreetmap-website/blob/9c8467e7ed9d38260077eaf64bb270b2acf18679/app/assets/javascripts/leaflet.map.js#L369-L373
Instead of 12 in `iconAnchor` it should be 12.5 because the marker is symmetrical. This is, of course, a small thing, but on Retina displays it can be noticed if, for example, the marker is set at the end point of the way.
The following screenshots can be reproduced using the following snippet for the browser console:
```javascript
L.marker(([42, 42]), ({ draggable: false, icon: OSM.getMarker({ color: "var(--marker-blue)" }) })).addTo(map);
L.circleMarker(L.latLng(42, 42), { weight: 2.5, radius: 3, fillOpacity: 0, color: "red" }).addTo(map);
```
<table>
<td>
Before
<td>
After
<tr>
<td>
<img width="50" height="60" src="https://github.com/user-attachments/assets/23afbded-0234-4586-9f76-483b1b538fba" />
<td>
<img width="50" height="60" src="https://github.com/user-attachments/assets/a19f08e3-b509-46c5-8682-223bdd715f2c" />
</table>
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/6249
-- Commit Summary --
* more precise marker position
-- File Changes --
M app/assets/javascripts/embed.js.erb (2)
M app/assets/javascripts/leaflet.map.js (2)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/6249.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6249.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6249
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6249 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250725/62e8d5da/attachment.htm>
More information about the rails-dev
mailing list