Migrate map from Leaflet to MapLibre GL JS with PMTiles#138
Draft
Migrate map from Leaflet to MapLibre GL JS with PMTiles#138
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Replace Leaflet + OSM raster tiles with MapLibre GL JS using self-hosted PMTiles (Middle East extract on R2) and a warm Protomaps basemap flavor. Alert polygons are now a GeoJSON source with fill/stroke/hit layers. Popups replaced by a slide-in location panel (bottom-sheet on mobile, sidebar on desktop). Prediction mode migrated off Leaflet overlays to a MapLibre GeoJSON source. ensureOrefPoints consolidated into AppState.
101a646 to
102cf42
Compare
- Replace Leaflet layers/markers with maplibregl.Marker and GeoJSON sources - Add 4 GeoJSON sources (ellipse-overlays, ellipse-visual, ellipse-editing, algc-overlay) via setupLayers() - Replace map.distance() calls with haversineMeters() helper - Replace CRS project/unproject with Web Mercator math - Replace L.DomEvent.* with native event listeners - Replace map interaction handlers (dragging/scrollWheelZoom/...) with MapLibre equivalents - Replace getLocationPolygons with getFeatureMap (GeoJSON feature objects) - Replace polygonRings() to work with GeoJSON coordinates instead of Leaflet getLatLngs() - Add featureBbox() for bbox intersection check replacing getBounds().intersects() - Delegate ensureOrefPoints to window.AppState - Register dblclick handlers for cluster overlay (→ algC) and algC overlay (→ clear) via setupEventHandlers() - Add openLocationPanel to AppState for pin click callbacks
- Update architecture.md: replace Leaflet/Voronoi/d3-delaunay references with MapLibre GL JS + PMTiles + pre-computed GeoJSON polygons - Update CLAUDE.md project description - Update ellipse-feature.md: locationPolygons → featureMap (GeoJSON), Web Mercator projection note - Update ellipse-alg-C.md: remove Leaflet geometry reference - Extend maxBounds south to lat 11.0 (was 24.0) to cover Yemen
…streetmap.us is automatable
Road narrowing, border filters, and sub-regional boundary visibility are now applied to the Protomaps layer list before MapLibre is initialized, instead of patching post-load with setPaintProperty. Add future basemap style tweaks to customizeBasemapLayers().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary