added location indexes to events

This commit is contained in:
lenovo
2022-11-11 17:53:22 +01:00
parent b5c73fc039
commit 9024a3472b
6 changed files with 87 additions and 32 deletions

View File

@@ -0,0 +1,30 @@
function create_map(map_div) {
// default map center to france
let map_center = coordinates_default;
let world_bound = {
north: 80,
south: -80,
west: -180,
east: 180,
};
let map_options = {
/* map options : https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions */
disableDefaultUI: true,
zoomControl: true,
scaleControl: true,
zoom: 2,
gestureHandling: "cooperative",
//gestureHandling: "greedy",
//gestureHandling: "none",
//gestureHandling: "auto",
//disableDoubleClickZoom: "false", //deprecated
//draggable: "true", //deprecated
center: map_center,
restriction: {
latLngBounds: world_bound,
strictBounds: true,
},
}
return new google.maps.Map(map_div, map_options);
}

View File

@@ -23,7 +23,6 @@ function mp_init_map() {
* { - mode : ... }
* { }
*
* - let filters
* - let coordinates_default = {lat: ,lng: }
* - let icon_color = ""
* - let icon_color_back = ""
@@ -36,45 +35,19 @@ function mp_init_map() {
console.log("filters:");
console.log(filters);
// default map center to france
let map_center = coordinates_default;
let world_bound = {
north: 80,
south: -80,
west: -180,
east: 180,
};
let map_options = {
/* map options : https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions */
disableDefaultUI: true,
zoomControl: true,
scaleControl: true,
zoom: 2,
gestureHandling: "cooperative",
//gestureHandling: "greedy",
//gestureHandling: "none",
//gestureHandling: "auto",
//disableDoubleClickZoom: "false", //deprecated
//draggable: "true", //deprecated
center: map_center,
restriction: {
latLngBounds: world_bound,
strictBounds: true,
},
}
let map_div = document.getElementById("ljdp_map");
//let filters_div = document.getElementById("ljdp_map_filters");
let infowindow = new google.maps.InfoWindow();
/*
* DRAW MAP
*/
let map = new google.maps.Map(map_div, map_options);
let map = create_map(map_div);
let markers = create_markers(map, locations, infowindow);
let marker_cluster = draw_clusters(map, markers);
let filters_div = document.getElementById("ljdp_map_filters");
//fill_filters(filters_div);
// add listener to close infowindow at any click on map
let toggle = true;