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

@@ -308,6 +308,20 @@ def validateManualPOIs(d):
return d
def validateCoords(c):
if not isinstance(c, (list, tuple)):
raise ValidationException("Your coordinates '{}' are not a list or a tuple.".format(c))
if len(c) not in [2, 3]:
raise ValidationException("'{}' is not a valid list or tuple of coordinates, "
"because we expect either 2 or 3 elements.".format(c))
if len(c) == 2:
x, z = [validateInt(i) for i in c]
y = 64
else:
x, y, z = [validateInt(i) for i in c]
return (x, y, z)
def make_dictValidator(keyvalidator, valuevalidator):
"""Compose and return a dict validator -- a validator that validates each
key and value in a dictionary.