mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-25 03:35:18 +01:00
Fixed previous maptype/layer being visible in the background.
This commit is contained in:
parent
90acf73976
commit
b944b3b729
@ -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');
|
||||||
|
Loading…
Reference in New Issue
Block a user