Created
October 8, 2013 00:03
-
-
Save honjo2/6877201 to your computer and use it in GitHub Desktop.
metersToEquatorPixels
This file contains 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
float meters = 100.f; | |
double latRadians = lat * Math.PI / 180; | |
double metersPerPixel = 40075016.68 / (256 * Math.pow(2, zoom); | |
float equatorPixels = (float) (meters / Math.cos(latRadians) / metersPerPixel); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment