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

Map layers. Fixed select appropriate radiobutton in dropdown

parent cff88353
......@@ -36,9 +36,9 @@
<ul class="dropdown-menu">
<li>
<label><input class="map-provider" name="provider" style='margin-right: 10px;margin-left: 5px'
<label class="label-map-provider"><input class="map-provider" name="provider" style='margin-right: 10px;margin-left: 5px'
type='radio'>MapQuest</label>
<label><input name="provider" class="map-provider" style='margin-right: 10px;margin-left: 5px'
<label class="label-map-provider"><input name="provider" class="map-provider" style='margin-right: 10px;margin-left: 5px'
type='radio'>Openstreetmap</label>
</li>
</ul>
......@@ -187,6 +187,10 @@
})
}
};
[].forEach.call($('.label-map-provider'), function(label){
label.innerText == cookieUtils.getCookie('mapProviders')? $(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());
......@@ -212,8 +216,6 @@
});
$("body").on("click", ".map-provider", function (e) {
var providerName = $(this).parent().text();
console.log($(this).parent().text());
console.log(providerName);
if ($(this).is(":checked")) {
cookieUtils.setCookie('mapProviders', providerName, 0);
$(document).trigger('cookieUpdate');
......@@ -372,7 +374,7 @@
loadDetailsTimeout = setTimeout(function () {
var filterBounds = filterJsonObj;
console.log(filterBounds)
console.log(filterBounds);
filterBounds['geo.latitude'] = [{range: [sw.lat, ne.lat]}];
filterBounds['geo.longitude'] = [{range: [sw.lng, ne.lng]}];
//console.log(JSON.stringify(filterBounds));
......
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