mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-12 05:24:39 +01:00
(Optionally) set map center in web config, automagically pan there on map change.
This commit is contained in:
parent
a1ccc876a3
commit
2b01db451d
@ -126,6 +126,10 @@ web:
|
||||
worlds:
|
||||
- title: World
|
||||
name: world
|
||||
center:
|
||||
x: 0
|
||||
y: 64
|
||||
z: 0
|
||||
maps:
|
||||
- type: FlatMapType
|
||||
title: Flat
|
||||
@ -145,6 +149,10 @@ web:
|
||||
prefix: ct
|
||||
- title: Nether
|
||||
name: nether
|
||||
center:
|
||||
x: 0
|
||||
y: 64
|
||||
z: 0
|
||||
maps:
|
||||
- type: FlatMapType
|
||||
title: Flat
|
||||
|
@ -316,6 +316,11 @@ DynMap.prototype = {
|
||||
if (worldChanged) {
|
||||
$(me).trigger('worldchanged');
|
||||
}
|
||||
if (map.world.center) {
|
||||
me.map.panTo(map.projection.fromWorldToLatLng(map.world.center.x||0,map.world.center.y||0,map.world.center.z||0));
|
||||
} else {
|
||||
me.map.panTo(map.projection.fromWorldToLatLng(0,64,0));
|
||||
}
|
||||
$(me).trigger('mapchanged');
|
||||
if (completed) {
|
||||
completed();
|
||||
|
Loading…
Reference in New Issue
Block a user