Fixed previous maptype/layer being visible in the background.
This commit is contained in:
parent
7c87539f46
commit
219ab39e40
1 changed files with 8 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue