mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-13 22:05:12 +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:
|
worlds:
|
||||||
- title: World
|
- title: World
|
||||||
name: world
|
name: world
|
||||||
|
center:
|
||||||
|
x: 0
|
||||||
|
y: 64
|
||||||
|
z: 0
|
||||||
maps:
|
maps:
|
||||||
- type: FlatMapType
|
- type: FlatMapType
|
||||||
title: Flat
|
title: Flat
|
||||||
@ -145,6 +149,10 @@ web:
|
|||||||
prefix: ct
|
prefix: ct
|
||||||
- title: Nether
|
- title: Nether
|
||||||
name: nether
|
name: nether
|
||||||
|
center:
|
||||||
|
x: 0
|
||||||
|
y: 64
|
||||||
|
z: 0
|
||||||
maps:
|
maps:
|
||||||
- type: FlatMapType
|
- type: FlatMapType
|
||||||
title: Flat
|
title: Flat
|
||||||
|
@ -316,6 +316,11 @@ DynMap.prototype = {
|
|||||||
if (worldChanged) {
|
if (worldChanged) {
|
||||||
$(me).trigger('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');
|
$(me).trigger('mapchanged');
|
||||||
if (completed) {
|
if (completed) {
|
||||||
completed();
|
completed();
|
||||||
|
Loading…
Reference in New Issue
Block a user