kopia lustrzana https://github.com/backface/turtlestitch
added parseFloat to maps module so it properly parses lat and long from strings
rodzic
e58328ebc7
commit
1da0ddef1f
|
@ -200,12 +200,12 @@ WorldMap.prototype.wrapTile = function (n) {
|
|||
};
|
||||
|
||||
WorldMap.prototype.tileXfromLon = function (lon) {
|
||||
return (lon + 180) / 360 * Math.pow(2, this.zoom);
|
||||
return (parseFloat(lon) + 180) / 360 * Math.pow(2, this.zoom);
|
||||
};
|
||||
|
||||
WorldMap.prototype.tileYfromLat = function (lat) {
|
||||
return (1 - Math.log(Math.tan(lat * Math.PI / 180) + 1 /
|
||||
Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 *
|
||||
return (1 - Math.log(Math.tan(parseFloat(lat) * Math.PI / 180) + 1 /
|
||||
Math.cos(parseFloat(lat) * Math.PI / 180)) / Math.PI) / 2 *
|
||||
Math.pow(2, this.zoom);
|
||||
};
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue