Repository navigation
Camelize MiniMap tile layer options - #2371
Open
KhadeerBasha1232 wants to merge 1 commit into
Open
KhadeerBasha1232 wants to merge 1 commit into
KhadeerBasha1232 wants to merge 1 commit into
Conversation
The MiniMap template serialized its tile layer's options with tojson, while TileLayer itself uses tojavascript. Leaflet ignored the resulting snake_case keys (tile_size, zoom_offset, max_native_zoom, detect_retina, no_wrap, ...), so the minimap didn't honour them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KhadeerBasha1232
temporarily deployed
to
pypi
November 20, 2026 14:48 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Camelize
MiniMaptile layer optionsThe problem
Options set on the tile layer passed to
MiniMapdon't reach the minimap. For example, with 512px tiles (common for Mapbox styles):The main map uses 512px tiles, but the minimap still loads 256px tiles from a different zoom level. In the browser, the minimap's layer has
tileSize: 256, zoomOffset: 0.The cause
TileLayerstores its options in snake_case and renders them withtojavascript, which camelizes the keys. TheMiniMaptemplate renders the same options withtojson:Leaflet ignores
tile_size,zoom_offset,max_native_zoom,max_zoom,min_zoom,detect_retina,no_wrapand any other multi-word key passed as a kwarg.The fix
Use
tojavascriptin theMiniMaptemplate, matchingTileLayer's own template.Before / after
The example above, opened in Chrome:
Tests
Added
test_minimap_tile_layer_options_are_camelizedtotests/plugins/test_minimap.py. It fails without the fix.