Organization html

From Redazione
Jump to navigation Jump to search
Line 521: Line 521:
 
});
 
});
  
 +
return map;
 
}
 
}
  
Line 526: Line 527:
  
 
$(function(){
 
$(function(){
 +
 +
var map;
  
 
$('#select_countries option:contains("</html>{{#ci_visitorCountry:}}<html>")').prop('selected',true);
 
$('#select_countries option:contains("</html>{{#ci_visitorCountry:}}<html>")').prop('selected',true);
Line 533: Line 536:
 
for(var i in obj) {
 
for(var i in obj) {
 
if(obj[i].name == selected_country) {
 
if(obj[i].name == selected_country) {
drawMap(obj[i].lat, obj[i].long);
+
//drawMap(obj[i].lat, obj[i].long);
 +
map.setView(new L.LatLng(obj[i].lat, obj[i].long), 7);
 
break;
 
break;
 
}
 
}
Line 546: Line 550:
 
if(obj.hasOwnProperty("</html>{{#ci_visitorIsoCode:}}<html>")) {
 
if(obj.hasOwnProperty("</html>{{#ci_visitorIsoCode:}}<html>")) {
 
var key = obj["</html>{{#ci_visitorIsoCode:}}<html>"];
 
var key = obj["</html>{{#ci_visitorIsoCode:}}<html>"];
drawMap(key.lat, key.long);
+
map = drawMap(key.lat, key.long);
 
 
 
} else {
 
} else {
drawMap(22, 87);
+
map = drawMap(22, 87);
 
}
 
}
 
 

Revision as of 09:54, 7 March 2020

Zoom and move the map to the precise location of your organization to pick its coordinates.