Files
DOCKER_wordpress/srcs/plugins/map_prof/mp_init_map.js
2022-10-31 10:21:24 +01:00

30 lines
490 B
JavaScript

function mp_init_map() {
/*
* following variable are created by mp_locations.php
* - let locations
* - let icon_url
*/
let map = new google.maps.Map(
document.getElementById("ljdp_map"),
{
zoom: 5,
disableDefaultUI: true,
center: locations[0],
}
);
let marker, icon;
icon = {
url: icon_url,
scaledSize: new google.maps.Size(35, 50)
};
for (loc of locations) {
marker = new google.maps.Marker({
position: loc,
map: map,
icon: icon,
});
};
}