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

Dynamic latitude in map scale calc #1618

Merged
merged 1 commit into from
Jul 7, 2023
Merged

Dynamic latitude in map scale calc #1618

merged 1 commit into from
Jul 7, 2023

Conversation

jdbcode
Copy link
Collaborator

@jdbcode jdbcode commented Jul 7, 2023

Map center latitude was hard-coded to 0 in calculation of approx map scale. Since latitude is non-linear in EPSG:3857, it'll be more accurate if we get the center latitude of the map and use it in the equation. At low zoom levels the scale is pretty meaningless, but at zooms of 10+ it can be useful.

I've tested the changes at +/- the same latitude around 0 and in progression from 0 to ~70 degrees and at varying zoom levels.

@jdbcode jdbcode requested a review from giswqs July 7, 2023 19:35
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

@github-actions github-actions bot temporarily deployed to pull request July 7, 2023 19:44 Inactive
Copy link
Member

@giswqs giswqs left a comment

Choose a reason for hiding this comment

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

This is great. Thanks for the fix.

@giswqs giswqs merged commit 1442d58 into master Jul 7, 2023
@giswqs giswqs deleted the map_scale branch July 7, 2023 20:05
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