[openstreetmap/openstreetmap-website] Migrate the user diary to be maplibre based (PR #6676)

Copilot notifications at github.com
Sun Jan 4 23:52:16 UTC 2026


@Copilot commented on this pull request.

## Pull request overview

This PR migrates the user diary page from Leaflet to MapLibre GL JS, aligning with the broader migration effort across the OpenStreetMap website. The migration updates map initialization, marker handling, and event management to use MapLibre's API while maintaining the same functionality and fixing two existing bugs.

**Key changes:**
- Replace Leaflet map with MapLibre GL JS implementation including proper rotation/pitch disabling
- Fix coordinate handling when using "use map" button after entering coordinates manually
- Adjust zoom level calculation to fix zoom button rounding issues





---

💡 <a href="/openstreetmap/openstreetmap-website/new/master/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

>      if ($("#latitude").val() && $("#longitude").val()) {
-      marker = L.marker(centre, { icon: OSM.getMarker({}) }).addTo(map)
-        .bindPopup(OSM.i18n.t("diary_entries.edit.marker_text"));
+      const lngLat = new maplibregl.LngLat($("#longitude").val(), $("#latitude").val());

The values retrieved from jQuery's `.val()` method return strings. The `maplibregl.LngLat` constructor expects numeric values. Consider parsing the values to numbers using `parseFloat()` or the unary plus operator to ensure proper type conversion.
```suggestion
      const lngLat = new maplibregl.LngLat(+$("#longitude").val(), +$("#latitude").val());
```

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

Message ID: <openstreetmap/openstreetmap-website/pull/6676/review/3625233149 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260104/a979840c/attachment-0001.htm>


More information about the rails-dev mailing list