Fix visibility toggle

This commit is contained in:
lukasmartinelli
2016-09-10 16:53:58 +02:00
parent f444ebf65d
commit 0693dc3d42
2 changed files with 20 additions and 6 deletions

View File

@@ -72,10 +72,10 @@ function styleKey(styleId) {
// Ensure a style has a unique id and a created date
function ensureOptionalStyleProps(mapStyle) {
if(!('id' in mapStyle)) {
if(!mapStyle.has('id')) {
mapStyle = mapStyle.set('id', Math.random().toString(36).substr(2, 9))
}
if(!("created" in mapStyle)) {
if(!mapStyle.has('created')) {
mapStyle = mapStyle.set('created', new Date())
}
return mapStyle