Commit baa64e8d authored by Alexander Basov's avatar Alexander Basov
Browse files

Map layers. Fixed cookies

parent db62af72
......@@ -187,19 +187,15 @@
})
}
};
var cookieValue = cookieUtils.getCookie('mapProviders') || 'MapQuest';
[].forEach.call($('.label-map-provider'), function(label){
label.innerText == cookieUtils.getCookie('mapProviders')? $(label).find('input:radio').prop('checked', true)
label.innerHTML.indexOf(cookieValue) > 1 ? $(label).find('input:radio').prop('checked', true)
:$(label).find('input:radio').prop('checked', false);
});
if (cookieUtils.getCookie('mapProviders') && cookieUtils.getCookie('mapProviders') != '') {
mapProviders[cookieUtils.getCookie('mapProviders')].addTo(map);
topPane.appendChild(mapProviders[cookieUtils.getCookie('mapProviders')].getContainer());
mapProviders[cookieUtils.getCookie('mapProviders')].setZIndex(0);
} else {
mapProviders.MapQuest.addTo(map);
topPane.appendChild(mapProviders[cookieUtils.getCookie('mapProviders')].getContainer());
mapProviders.MapQuest.setZIndex(0);
}
mapProviders[cookieValue].addTo(map);
topPane.appendChild(mapProviders[cookieValue].getContainer());
mapProviders[cookieValue].setZIndex(0);
$(document).on('cookieUpdate', function () {
for (var key in mapProviders) {
map.removeLayer(mapProviders[key]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment