diff --git a/srcs/plugins/map_prof/scripts/mp_create_map.js b/srcs/plugins/map_prof/scripts/mp_create_map.js index 26eef1c..4031461 100644 --- a/srcs/plugins/map_prof/scripts/mp_create_map.js +++ b/srcs/plugins/map_prof/scripts/mp_create_map.js @@ -2,12 +2,7 @@ function create_map(map_div) { // default map center to france let map_center = coordinates_default; // map_center = {lat:-2.515748362923059, lng:32.93366215464864}; - let world_bound = { - north: 80, - south: -80, - west: -180, - east: 180, - }; + let world_bound = g_init_bounds; let map_options = { /* map options : https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions */ disableDefaultUI: true, diff --git a/srcs/plugins/map_prof/scripts/mp_filter_events.js b/srcs/plugins/map_prof/scripts/mp_filter_events.js index 258460f..74e0a09 100644 --- a/srcs/plugins/map_prof/scripts/mp_filter_events.js +++ b/srcs/plugins/map_prof/scripts/mp_filter_events.js @@ -51,6 +51,6 @@ function filter_show_only_selection(indexes, show_only = true) { } function filter_show_all() { - console.log("filter_show_all"); - marker_cluster.addMarkers(markers); + g_marker_cluster.addMarkers(g_markers); + g_map.fitBounds(g_init_bounds); } diff --git a/srcs/plugins/map_prof/scripts/mp_init_map.js b/srcs/plugins/map_prof/scripts/mp_init_map.js index c12bfa0..41f9a4f 100644 --- a/srcs/plugins/map_prof/scripts/mp_init_map.js +++ b/srcs/plugins/map_prof/scripts/mp_init_map.js @@ -2,6 +2,12 @@ let g_map = {}; let g_markers = []; let g_marker_cluster = {}; +const g_init_bounds = { + north: 80, + south: -80, + west: -180, + east: 180, +}; function mp_init_map() { diff --git a/srcs/plugins/map_prof/styles/mp_filters.css b/srcs/plugins/map_prof/styles/mp_filters.css index 39cf62f..f32f77d 100644 --- a/srcs/plugins/map_prof/styles/mp_filters.css +++ b/srcs/plugins/map_prof/styles/mp_filters.css @@ -148,7 +148,6 @@ */ /* -*/ #ljdp_map_filters .filter_menu .filter_menu_title { width: 100%; cursor: pointer; @@ -196,4 +195,64 @@ #ljdp_map_filters .filter_menu .filter_menu_drop p:hover { background-color: #dddddd; } +*/ + + + + + +/* ************************************** + VERSION DIV SWITCH AND CLOSE +*/ + +/* +*/ +#ljdp_map_filters .filter_menu .filter_menu_title { + width: 100%; + cursor: pointer; +} + +#ljdp_map_filters .filter_menu .filter_menu_drop { + flex-direction: column; + position: absolute; + top: 100%; + left: 0px; + margin: 0px; + width: 100%; + height: auto; + max-height: 400px; + cursor: pointer; + background-color: transparent; + overflow: scroll; + + border: 1px solid red; +} + +/* +#ljdp_map_filters .filter_menu .filter_menu_drop:focus { + background-color: #ffffff; + height: auto; + top: 100%; + overflow: scroll; + padding: 10px; + border: 1px solid #ba197a; +} + +#ljdp_map_filters .filter_menu .filter_menu_drop p:first-child { + margin-top: 100px; +} + +#ljdp_map_filters .filter_menu .filter_menu_drop:focus p:first-child { + margin-top: auto; +} +*/ + +#ljdp_map_filters .filter_menu .filter_menu_drop p { + padding: 0px 10px; + width: 100%; +} + +#ljdp_map_filters .filter_menu .filter_menu_drop p:hover { + background-color: #dddddd; +}