Move zoomPrecision function to the OSM namespace
This commit is contained in:
parent
665abc501c
commit
66039dedb0
6 changed files with 9 additions and 9 deletions
|
@ -153,7 +153,7 @@ OSM = {
|
|||
center = center.wrap();
|
||||
layers = layers.replace('M', '');
|
||||
|
||||
var precision = zoomPrecision(zoom),
|
||||
var precision = OSM.zoomPrecision(zoom),
|
||||
hash = '#map=' + zoom +
|
||||
'/' + center.lat.toFixed(precision) +
|
||||
'/' + center.lng.toFixed(precision);
|
||||
|
@ -163,5 +163,9 @@ OSM = {
|
|||
}
|
||||
|
||||
return hash;
|
||||
},
|
||||
|
||||
zoomPrecision: function (zoom) {
|
||||
return Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue