Add default tile layer in case it is not defined
This commit is contained in:
parent
2f0ac6bb76
commit
f413db0fac
1 changed files with 6 additions and 3 deletions
|
@ -25,9 +25,12 @@ config = {}
|
||||||
config["name"] = properties["name"]
|
config["name"] = properties["name"]
|
||||||
colors = {}
|
colors = {}
|
||||||
config["layers"] = colors
|
config["layers"] = colors
|
||||||
config["tilelayer"] = properties["tilelayer"]
|
|
||||||
|
|
||||||
|
if "tilelayer" in properties and properties['tilelayer'] != {} :
|
||||||
|
config["tilelayer"] = properties["tilelayer"]
|
||||||
config["tilelayer"]["attribution"] = re.sub(r'\[\[([^|]+)\|([^|]+)\]\]', r'<a href="\1" >\2</a>', config["tilelayer"]["attribution"])
|
config["tilelayer"]["attribution"] = re.sub(r'\[\[([^|]+)\|([^|]+)\]\]', r'<a href="\1" >\2</a>', config["tilelayer"]["attribution"])
|
||||||
|
else :
|
||||||
|
config["tilelayer"] = { "attribution" : 'Map data © <a href="http://osm.org/copyright" >OpenStreetMap contributors</a>', "url_template" : "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" }
|
||||||
|
|
||||||
def normalize_name(name) :
|
def normalize_name(name) :
|
||||||
return name.replace("/", "_").replace("-","").replace(" ","").replace(".","")
|
return name.replace("/", "_").replace("-","").replace(" ","").replace(".","")
|
||||||
|
|
Loading…
Reference in a new issue