in filter fixed zoomin by default

This commit is contained in:
lenovo
2022-11-14 03:13:13 +01:00
parent 0af8822a7f
commit 8a4870a2b3
2 changed files with 19 additions and 13 deletions

View File

@@ -4,8 +4,11 @@
- [/] copy recent site version - [/] copy recent site version
- [/] create links - [/] create links
- [/] make links having map - [/] make links having map
- [ ] transform filter list in select, and button in reset - [/] transform filter list in inputs
- [ ] make two infowindow size - [ ] zoom in
- [ ] style input filters
- [ ] enlever le bandeau de scroll des menus
- [ ] effacer -> bouton carre, fond violet, ecriture blanche, en capitale, arrondis de 3px sur les coins
- [/] ne pas ouvrir sur un nouvel onglet - [/] ne pas ouvrir sur un nouvel onglet
- [/] "effacer" au lieu de "sans filtre" - [/] "effacer" au lieu de "sans filtre"
- [/] accents et majuscules : "Effacer", "Pays" et "Categories" - [/] accents et majuscules : "Effacer", "Pays" et "Categories"
@@ -14,11 +17,12 @@
- categories - categories
- irl / online - irl / online
- effacer - effacer
- [ ] effacer -> bouton carre, fond violet, ecriture blanche, en capitale, arrondis de 3px sur les coins
- [ ] sur ordi carte hauteur 600px, sur telephone 500px - [ ] sur ordi carte hauteur 600px, sur telephone 500px
- [ ] enlever le bandeau de scroll des menus - [ ] make two infowindow size
- [ ] deal with error double event irl and online - [ ] infowindow with date in background color purple, and croice white
- [ ] check errors on real site
- [/] deal with multiplication of filters - [/] deal with multiplication of filters
- [ ] deal with error double event irl and online
- [ ] change appearance of filter according to other filters - [ ] change appearance of filter according to other filters
- [ ] deal with window size - [ ] deal with window size

View File

@@ -94,7 +94,7 @@ function is_element_unchecked(element) {
* even if already visible in current view * even if already visible in current view
*/ */
function filter_show_only_selection(element, indexes, menu, add = false, zoom_in = false) { function filter_show_only_selection(element, indexes, menu, add = false, zoom_in = true) {
let reverse = is_element_unchecked(element); let reverse = is_element_unchecked(element);
@@ -102,16 +102,14 @@ function filter_show_only_selection(element, indexes, menu, add = false, zoom_in
let indexes_count = index_array.length; let indexes_count = index_array.length;
// if there is no indexes,
// if object is not empty, just render zero markers
// if object is empty, shall all markers
if (indexes_count !== 0) { if (indexes_count !== 0) {
// if index array, hide all other markers, and if zoomin, zoom to new markers
g_marker_cluster.clearMarkers(true); g_marker_cluster.clearMarkers(true);
let marker = g_markers[0]; let marker = g_markers[0];
let position = marker.getPosition(); // let position = marker.getPosition();
let current_bounds = g_map.getBounds(); let current_bounds = g_map.getBounds();
let bounds = new google.maps.LatLngBounds(position); let bounds = new google.maps.LatLngBounds();
let outside_bounds = false; let outside_bounds = false;
for (let index of index_array) { for (let index of index_array) {
@@ -133,10 +131,14 @@ function filter_show_only_selection(element, indexes, menu, add = false, zoom_in
} }
} }
else if ( Object.keys(g_indexes).length === 0 ) { // object is empty, there are no filters else if ( Object.keys(g_indexes).length === 0 ) {
// object is empty, there are no filters
g_map.setCenter(coordinates_default);
g_map.setZoom(2);
g_marker_cluster.addMarkers(g_markers, true); g_marker_cluster.addMarkers(g_markers, true);
} }
else { // filters intersection lets no markers on the map else {
// filters intersection lets no markers on the map
g_marker_cluster.clearMarkers(true); g_marker_cluster.clearMarkers(true);
} }