default map center to france

This commit is contained in:
lenovo
2022-11-01 21:18:44 +01:00
parent 3e002844b8
commit bd5d1715a0
2 changed files with 6 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ add_filter('script_loader_tag', 'mp_tag_scripts', 10, 2);
/** /**
* when 'shortcode' in page, replace by 'return' * when 'shortcode' found in page, replace by return
*/ */
function mp_add_div() { function mp_add_div() {

View File

@@ -7,12 +7,16 @@ function mp_init_map() {
* - let icon_size[x, y] * - let icon_size[x, y]
*/ */
// default map center to france
let map_center = {lat:46.227638, lng:2.213749};
if (locations.length > 0)
map_center = locations[0];
let map = new google.maps.Map( let map = new google.maps.Map(
document.getElementById("ljdp_map"), document.getElementById("ljdp_map"),
{ {
zoom: 5, zoom: 5,
disableDefaultUI: true, disableDefaultUI: true,
center: locations[0], center: map_center,
} }
); );
let marker, icon, label; let marker, icon, label;