Change zoom precision function
This changes the number of fractional digits to log10(pixels / degrees) with pixels = 2**(8 + zoom) and degrees = 180.
This commit is contained in:
parent
9b2db63a95
commit
1951ed2eb8
1 changed files with 3 additions and 1 deletions
|
@ -204,7 +204,9 @@ OSM = {
|
||||||
},
|
},
|
||||||
|
|
||||||
zoomPrecision: function(zoom) {
|
zoomPrecision: function(zoom) {
|
||||||
return Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
|
var pixels = Math.pow(2, 8 + zoom);
|
||||||
|
var degrees = 180;
|
||||||
|
return Math.ceil(Math.log10(pixels / degrees));
|
||||||
},
|
},
|
||||||
|
|
||||||
locationCookie: function(map) {
|
locationCookie: function(map) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue