Organization html

From Redazione
Jump to navigation Jump to search
Line 358: Line 358:
  
  
<div id="map" style="height : 300px"></div>
+
<div id="map_container" style="height : 300px"></div>
  
 
<input class="ci_form_input" type="hidden" placeholder="Coordinates" name="Form organization[Coordinates]" value="">
 
<input class="ci_form_input" type="hidden" placeholder="Coordinates" name="Form organization[Coordinates]" value="">
Line 488: Line 488:
 
function drawMap(lat,lon) {
 
function drawMap(lat,lon) {
  
var mapCenter = [lat,lon]
+
var mapCenter = [lat,lon];
  
var map = L.map('map', {center : mapCenter, zoom : 7});
+
var map = L.map('map_container', {center : mapCenter, zoom : 7});
  
 
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
 
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
Line 530: Line 530:
  
 
$('#select_countries').on('change',function() {
 
$('#select_countries').on('change',function() {
var selected_country = $(this).find('option:selected").text()
+
var selected_country = $(this).find('option:selected').text();
 
for(var i in obj) {
 
for(var i in obj) {
 
if(obj[i].name == selected_country) {
 
if(obj[i].name == selected_country) {

Revision as of 09:49, 7 March 2020

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