@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/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev