Filter für UKATEGORIE

This commit is contained in:
Walter Hupfeld
2023-07-28 07:45:47 +02:00
parent d5f68e275a
commit b48d66479f
2 changed files with 24 additions and 8 deletions

View File

@@ -95,9 +95,11 @@
$arrMarker = array();
$arrDescription = array();
$description="";
$numId=0;
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
//print_r($row);echo "<hr>";
$id = $row['OBJECTID'];
//$id = $row['OBJECTID'];
$id=$numId;
$numLng = $row['XGCSWGS84'];
$numLat = $row['YGCSWGS84'];
if ($row['IstRad']) $description .="mit Fahrradbeteiligung, ";
@@ -109,12 +111,14 @@
$strDescription=generate_tooltip_description($row);
$strCategory=generate_category($row);
$arrMarker[]="marker[".$id."] = [L.marker([".$numLat."," .$numLng."],"
." { icon: ".$arrMarkerType[$topic]." }),'check_".$topic."'];\n"
." { icon: ".$arrMarkerType[$topic]." }),'check_".$strCategory."'];\n"
."marker[".$id."][0].addTo(mymap);\n "
."marker[".$id."][0].bindPopup('".$strDescription."');";
$numId++;
}
$markerid=$id+1;
/*
marker[val.id] = [L.marker([val.lat, val.lng], { "icon": L.MakiMarkers.icon({ "color": color, "size": "m", "icon": "circle" }) }).bindPopup(html), val.membertype];
@@ -302,17 +306,21 @@
// Hide and show marker form checkbox ----------------------------------------
$('.check').click(function() {
bereich = this.name;
filter = this.name;
console.log(filter);
if (jQuery(this).prop("checked")) {
jQuery.each(marker, function(key, value) {
if (value) {
if (value[1] == bereich) { value[0].addTo(mymap); }
if (filter.match(value[1]))
{ value[0].addTo(mymap); }
}
});
} else {
jQuery.each(marker, function(key, value) {
if (value) {
if (value[1] == bereich) { value[0].remove(); }
if (filter.match(value[1]))
{ value[0].remove(); }
}
});
}