added location indexes to events
This commit is contained in:
30
srcs/plugins/map_prof/scripts/mp_create_map.js
Normal file
30
srcs/plugins/map_prof/scripts/mp_create_map.js
Normal 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);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user