Fix map center consistency on map changes

This commit is contained in:
Mike Primm 2011-08-03 10:21:29 -05:00
parent 1d0b28c069
commit 64bd846115
5 changed files with 36 additions and 1 deletions

View file

@ -4,7 +4,13 @@ var FlatProjection = DynmapProjection.extend({
-location.z / (1 << this.options.mapzoomout),
location.x / (1 << this.options.mapzoomout),
true);
},
fromLatLngToLocation: function(latlon, y) {
var z = -latlon.lat * (1 << this.options.mapzoomout);
var x = latlon.lng * (1 << this.options.mapzoomout);
return { x: x, y: y, z: z };
}
});
var FlatMapType = DynmapTileLayer.extend({