0

Add "center" config option

This option allows you to specify your own initial center for a
tileset, which is useful if your map is extremely asymmetric or
you don't really care about what's around the spawn.

Future work needs to be done on the JS side in order to fix the
fromWorldToLatLng and friends, as they're currently off by -24 in X
and +24 in Z direction.

Closes #1350.
This commit is contained in:
Nicolas F
2019-07-06 19:06:15 +02:00
parent 5b0430f94b
commit 204bcd0310
7 changed files with 31 additions and 5 deletions

View File

@@ -589,7 +589,9 @@ class TileSet(object):
imgextension=self.imgextension,
isOverlay=isOverlay,
poititle=self.options.get("poititle"),
showlocationmarker=self.options.get("showlocationmarker")
showlocationmarker=self.options.get("showlocationmarker"),
center=(self.options.get("center") or self.options.get("spawn")
or [0, 64, 0])
)
d['maxZoom'] = self.options.get('maxzoom', self.treedepth)
if d['maxZoom'] < 0: