Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zoomOffset and tileSize options #75

Merged
merged 2 commits into from
Mar 18, 2022
Merged

Conversation

saesh
Copy link
Contributor

@saesh saesh commented Mar 16, 2022

LeafletJS offers an option for an offset which is applied to the zoom level given in the URL. This is helpful when big tile sizes are used and the zoom level needs to be adjusted for the increased tile size. Bigger tile sizes can be beneficial to decrease the amount of requests to fetch all map tiles.

From the Mapbox documentation on 512px tiles:

Note that 512×512 image tiles are offset by one zoom level compared to 256×256 tiles. For example, 512×512 tiles at zoom level 4 are equivalent to 256×256 tiles at zoom level 5.

When bigger tile sizes are used LTileLayer has to be configured as well using the tileSize prop.

A setting of tileSize=512 and zoomOffset=-1 will result in an identical map image to using tileSize=256 and zoomOffset=0 but with a quarter of tile requests.

Copy link
Member

@linusg linusg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the options alphabetically sorted in the docs & config.

@saesh saesh requested a review from linusg March 17, 2022 19:28
Copy link
Member

@linusg linusg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, instead of adding another commit to fix the previous ones, amend them so they're correct in the first place. Let's aim for a clean commit history. :)

I.e. one commit adding the zoomOffset option + docs, and one doing the same for tileSize.

@saesh saesh requested a review from linusg March 18, 2022 07:34
Copy link
Member

@linusg linusg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@linusg linusg merged commit 5a64c06 into owntracks:main Mar 18, 2022
@saesh saesh deleted the add-zoomoffset branch March 18, 2022 16:26
@linusg
Copy link
Member

linusg commented Sep 6, 2022

Released in v2.12.0 just now, sorry it took so long!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants