resolve some errors in php logic, like strlen with str containing space that is interpreted as array instead of string
This commit is contained in:
72
plug/map_prof/scripts/mp_init_map.js
Normal file
72
plug/map_prof/scripts/mp_init_map.js
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
let g_map = {};
|
||||
let g_markers = [];
|
||||
let g_marker_cluster = {};
|
||||
let g_indexes = {};
|
||||
let g_infowindow = {};
|
||||
const g_world_bound = {
|
||||
north: 80,
|
||||
south: -80,
|
||||
west: -180,
|
||||
east: 180,
|
||||
};
|
||||
|
||||
function mp_init_map() {
|
||||
|
||||
/*
|
||||
* following variable are created by mp_add_to_script.php
|
||||
* - let locations = [
|
||||
* {
|
||||
* coordinates: {}
|
||||
* events : [{}, ...]
|
||||
* },
|
||||
* ...
|
||||
* ]
|
||||
*
|
||||
* { }
|
||||
* { [ ] }
|
||||
* - filters: { - pays : [ { - _name : "" } ] }
|
||||
* { [ { - villes : [] } ] }
|
||||
* { [ { - categories: [] } ] }
|
||||
* { [ { - indexes : [] } ] }
|
||||
* { [ { - mode : [] }, ...] }
|
||||
* { [ ] }
|
||||
* { }
|
||||
* { - villes : ... }
|
||||
* { - categories: ... }
|
||||
* { - mode : ... }
|
||||
* { }
|
||||
*
|
||||
* - let coordinates_default = {lat: ,lng: }
|
||||
* - let icon_color = ""
|
||||
* - let icon_color_back = ""
|
||||
* - let icon_size = [x, y]
|
||||
* - let cluster_size_factor = Number
|
||||
* - let map_zoom = x
|
||||
* - let max_zoom = x
|
||||
*/
|
||||
|
||||
|
||||
let map_div = document.getElementById("ljdp_map");
|
||||
//let filters_div = document.getElementById("ljdp_map_filters");
|
||||
g_infowindow = new google.maps.InfoWindow();
|
||||
|
||||
g_map = create_map(map_div);
|
||||
g_markers = create_markers(g_map, locations, g_infowindow);
|
||||
g_marker_cluster = draw_clusters(g_map, g_markers);
|
||||
|
||||
// add listener to close infowindow
|
||||
// https://developers.google.com/maps/documentation/javascript/events
|
||||
g_map.addListener('click', function() {
|
||||
g_infowindow.close();
|
||||
});
|
||||
g_map.addListener('drag', function() {
|
||||
g_infowindow.close();
|
||||
});
|
||||
g_map.addListener('zoom_changed', function() {
|
||||
g_infowindow.close();
|
||||
});
|
||||
|
||||
//g_map.addListener('clusteringbegin', restrict_map(false));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user