Written by Claude Code, Opus 4.6. Result of code review with @JeroenDeDauw. Context: the Maps extension codebase.
Issue
In resources/leaflet/FeatureBuilder.js, the pointToLayer callback in newGeoJsonLayer (lines 152-173) creates a marker and adds it to markerLayer, but never returns it. Leaflet receives undefined, so Point features are excluded from the GeoJSON layer bounds. This causes auto-zoom/fitContent to ignore point-only GeoJSON data.
Steps to reproduce
- Create a GeoJSON page with only Point features
- Display it on a map with
fitContent (the default)
- The map does not zoom to fit the points
Expected behavior
The map should auto-zoom to fit all GeoJSON features including Point features.
Root cause
The pointToLayer callback must return the created marker for Leaflet to include it in the layer's bounds calculation.
Written by Claude Code, Opus 4.6. Result of code review with @JeroenDeDauw. Context: the Maps extension codebase.
Issue
In
resources/leaflet/FeatureBuilder.js, thepointToLayercallback innewGeoJsonLayer(lines 152-173) creates a marker and adds it tomarkerLayer, but never returns it. Leaflet receivesundefined, so Point features are excluded from the GeoJSON layer bounds. This causes auto-zoom/fitContent to ignore point-only GeoJSON data.Steps to reproduce
fitContent(the default)Expected behavior
The map should auto-zoom to fit all GeoJSON features including Point features.
Root cause
The
pointToLayercallback must return the created marker for Leaflet to include it in the layer's bounds calculation.