From 0473231648bae9ba389ea2b691fde14e6f4be0e4 Mon Sep 17 00:00:00 2001 From: stefanocudini Date: Wed, 5 Dec 2018 23:59:57 +0100 Subject: [PATCH] fix nale layers --- .../ui/client/views/panels/settings/map.js | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/ui/client/views/panels/settings/map.js b/packages/ui/client/views/panels/settings/map.js index c03b5094..e037a6aa 100644 --- a/packages/ui/client/views/panels/settings/map.js +++ b/packages/ui/client/views/panels/settings/map.js @@ -4,18 +4,18 @@ Template.panelSettings_ui_map.helpers({ var layer = K.Profile.getOpts('map.layer') || K.settings.public.map.layer, layers = []; - _.each(K.settings.public.map.layers, function(v,k) { - if(!!v && _.isString(v)) { - layers.push({ - key: k, - val: k, - name: i18n('map_layer_'+k), - active: k===layer, - url: K.Util.tmpl(v,{s:'a',z:'15',x:'17374',y:'11667'}) - }); - } - }); - return layers; + _.each(K.settings.public.map.layers, function(v,k) { + if(!!v && _.isString(v)) { + layers.push({ + key: k, + val: k, + name: i18n('map_layer_'+k) || k, + active: k===layer, + url: K.Util.tmpl(v,{s:'a',z:'15',x:'17374',y:'11667'}) + }); + } + }); + return layers; }, mapcenter: function() { var z = K.Profile.getOpts('map.zoom'); @@ -30,7 +30,11 @@ Template.panelSettings_ui_map.events({ var val = $(e.currentTarget).val(); - Users.update(Meteor.userId(), { $set: {'settings.map.layer': val } }); + Users.update(Meteor.userId(), { + $set: { + 'settings.map.layer': val + } + }); K.Map.setOpts({layer: val });