added center to config.js, lets you set map center in world coords
By default, it is set to spawn. Also I changed defaultZoom to 2, which looks better (the world used to show up as *tiny* by default).
This commit is contained in:
@@ -2,8 +2,11 @@
|
|||||||
var config = {
|
var config = {
|
||||||
fileExt: '{imgformat}',
|
fileExt: '{imgformat}',
|
||||||
tileSize: 384,
|
tileSize: 384,
|
||||||
defaultZoom: 1,
|
defaultZoom: 2,
|
||||||
maxZoom: {maxzoom},
|
maxZoom: {maxzoom},
|
||||||
|
// center on this point, in world coordinates, ex:
|
||||||
|
//center: [0,0,0],
|
||||||
|
center: {spawn_coords},
|
||||||
cacheMinutes: 0, // Change this to have browsers automatically request new images every x minutes
|
cacheMinutes: 0, // Change this to have browsers automatically request new images every x minutes
|
||||||
bg_color: '#1A1A1A',
|
bg_color: '#1A1A1A',
|
||||||
debug: false
|
debug: false
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ class MapGen(object):
|
|||||||
config = config.replace(
|
config = config.replace(
|
||||||
"{imgformat}", str(imgformat))
|
"{imgformat}", str(imgformat))
|
||||||
|
|
||||||
|
config = config.replace("{spawn_coords}",
|
||||||
|
json.dumps(list(self.world.spawn)))
|
||||||
|
|
||||||
# create generated map type data, from given quadtrees
|
# create generated map type data, from given quadtrees
|
||||||
maptypedata = map(lambda q: {'label' : q.rendermode.capitalize(),
|
maptypedata = map(lambda q: {'label' : q.rendermode.capitalize(),
|
||||||
'path' : q.tiledir}, self.quadtrees)
|
'path' : q.tiledir}, self.quadtrees)
|
||||||
|
|||||||
@@ -256,8 +256,12 @@ function initialize() {
|
|||||||
|
|
||||||
var query = location.search.substring(1);
|
var query = location.search.substring(1);
|
||||||
|
|
||||||
var lat = 0.5;
|
var defaultCenter = fromWorldToLatLng(config.center[0],
|
||||||
var lng = 0.5;
|
config.center[1],
|
||||||
|
config.center[2]);
|
||||||
|
var lat = defaultCenter.lat();
|
||||||
|
var lng = defaultCenter.lng();
|
||||||
|
|
||||||
var zoom = config.defaultZoom;
|
var zoom = config.defaultZoom;
|
||||||
var pairs = query.split("&");
|
var pairs = query.split("&");
|
||||||
for (var i=0; i<pairs.length; i++) {
|
for (var i=0; i<pairs.length; i++) {
|
||||||
|
|||||||
1
world.py
1
world.py
@@ -226,6 +226,7 @@ class World(object):
|
|||||||
|
|
||||||
self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ,
|
self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ,
|
||||||
msg="Spawn", type="spawn", chunk=(inChunkX,inChunkZ)))
|
msg="Spawn", type="spawn", chunk=(inChunkX,inChunkZ)))
|
||||||
|
self.spawn = (spawnX, spawnY, spawnZ)
|
||||||
|
|
||||||
def go(self, procs):
|
def go(self, procs):
|
||||||
"""Scan the world directory, to fill in
|
"""Scan the world directory, to fill in
|
||||||
|
|||||||
Reference in New Issue
Block a user