Fixed previous maptype/layer being visible in the background.

This commit is contained in:
FrozenCow 2011-07-21 23:59:14 +02:00
parent 90acf73976
commit b944b3b729

View File

@ -315,16 +315,18 @@ DynMap.prototype = {
} }
me.world = mapWorld; me.world = mapWorld;
me.maptype = map; me.maptype = map;
me.map.addLayer(me.maptype);
if (projectionChanged || worldChanged) {
var centerLocation = $.extend({ x: 0, y: 64, z: 0 }, mapWorld.center);
var centerPoint = me.getProjection().fromLocationToLatLng(centerLocation);
me.map.setView(centerPoint, 0, true);
}
me.map.addLayer(me.maptype, false);
if (worldChanged) { if (worldChanged) {
$(me).trigger('worldchanged'); $(me).trigger('worldchanged');
} }
if (projectionChanged || worldChanged) {
var centerLocation = $.extend({ x: 0, y: 64, z: 0 }, mapWorld.center);
var centerPoint = map.getProjection().fromLocationToLatLng(centerLocation);
me.map.setView(centerPoint, 0, true);
}
$(me).trigger('mapchanged'); $(me).trigger('mapchanged');
$('.map', me.worldlist).removeClass('selected'); $('.map', me.worldlist).removeClass('selected');