From bf2ea7d1e3c5d7a58e0081bfb040a8493ca76a05 Mon Sep 17 00:00:00 2001 From: mikeprimm Date: Fri, 13 May 2011 14:14:50 -0700 Subject: [PATCH] Fix zoom so that markers are placed properly --- web/js/flatmap.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/js/flatmap.js b/web/js/flatmap.js index 8817bf5a..8035a94e 100644 --- a/web/js/flatmap.js +++ b/web/js/flatmap.js @@ -1,13 +1,13 @@ function FlatProjection() {} FlatProjection.prototype = { fromLatLngToPoint: function(latLng) { - return new google.maps.Point(latLng.lat()*128.0, latLng.lng()*128.0); + return new google.maps.Point(latLng.lat()*config.tileWidth, latLng.lng()*config.tileHeight); }, fromPointToLatLng: function(point) { - return new google.maps.LatLng(point.x/128.0, point.y/128.0); + return new google.maps.LatLng(point.x/config.tileWidth, point.y/config.tileHeight); }, fromWorldToLatLng: function(x, y, z) { - return new google.maps.LatLng(-z / 128.0, x / 128.0); + return new google.maps.LatLng(-z / config.tileWidth, x / config.tileHeight); } }; @@ -27,7 +27,7 @@ FlatMapType.prototype = $.extend(new DynMapType(), { tileName = this.prefix + '_128_' + coord.x + '_' + coord.y + '.png'; - imgSize = Math.pow(2, 6+zoom); + imgSize = Math.pow(2, 7+zoom); var tile = $('
') .addClass('tile') .css({ @@ -51,7 +51,7 @@ FlatMapType.prototype = $.extend(new DynMapType(), { }, updateTileSize: function(zoom) { var size; - size = Math.pow(2, 6+zoom); + size = Math.pow(2, 7+zoom); this.tileSize = new google.maps.Size(size, size); } });