to reload

This commit is contained in:
lenovo
2022-11-13 15:46:34 +01:00
parent 4397b4376e
commit 6e67fb8c05
3 changed files with 56 additions and 24 deletions

View File

@@ -8,7 +8,7 @@
* return intersection of both arrays : indexes and g_indexes
*/
function filter_selection_indexes(indexes) {
function filter_selection_indexes(indexes, invert) {
// if g_indexes empty, just fill it with indexes
// because it's like intersection of indexes and g_indexes if g_indexes was the list of all markers
if (g_indexes.length == 0) {
@@ -34,9 +34,24 @@ function filter_selection_indexes(indexes) {
* even if already visible in current view
*/
function filter_show_only_selection(indexes, zoom_in = false) {
function filter_show_only_selection(element, indexes, zoom_in = false) {
//console.log("element:");
//console.log(element);
//console.log("element.checked:");
//console.log(element.checked);
//console.log("element.attributes.type:");
//console.log(element.attributes.type);
//console.log("element.attributes.type.value:");
//console.log(element.attributes.type.value);
filter_selection_indexes(indexes);
let type = element.attributes.type;
let invert = false;
if (type != null)
type = type.value;
if (type === "checkbox")
invert = true;
// if checkbox is unchecked, re-add filters
filter_selection_indexes(indexes, invert);
let indexes_count = g_indexes.length;
if (indexes_count === 0)