Closed praul closed 1 year ago
For now, a marker may only be in one category.
Thanks for your reply. Is there a way to add classes to the marker div? ExtraClasses don't seem to render in html.
If one could add classes to the marker div, I could code a filter function myself.
"extraClasses" wird zum Klassifizieren missbraucht, das Attribut gehört zum Leaflet Plugin https://github.com/coryasilva/Leaflet.ExtraMarkers.
Wären Marker in einer Geojson-Datei was für dich? Entweder [geojsonmarker]
oder [leaflet-featuregroup]
.
Zwar wird dort auch nur eine Property behandelt, aber da könnte man ansetzen, um einem Marker mehrere Eigenschaften zuzuweisen und danach zu gruppieren.
Hmm, ich glaube das wären mir zuviele Schritte. Die Datenquelle für die Marker sind Custom Post Types mit entsprechenden Metafeldern, aus denen ich dann die Shortcodes generiere. Der leaflet-marker Shortcode aus dem Basisplugin ermöglicht ja die IconClass welche als Klasse auch ins Dom gerendert wird. Ich glaub ich bastel mir darauf aufbauend dann ne ganz einfache js Funktion welche die Marker anhand von ihren Klassen ein- und ausblendet. Ich hätte das hier als sauberere Lösung empfunden und war mir nicht sicher, ob ich was übersehe :) Danke dir, kannst zumachen
Ich glaub ich bastel mir darauf aufbauend dann ne ganz einfache js Funktion welche die Marker anhand von ihren Klassen ein- und ausblendet.
Falls der Code für die Allgemeinheit interessant sein könnte, kannst du ihn mir ja zukommen lassen.
Okay, keine Ahnung ob das für dich interessant ist, da das ganze erstmal ein eher hackiger Ansatz ist: https://github.com/praul/extensions-leaflet-map-filterbox
Funktioniert gut, benutzt allerdings keinerlei Leaflet-Funktionen sondern ausschließlich css Klassen und jQuery zum einblenden/ausblenden.
Hi there and thanks for your plugin. It seems to provide some features I need and is way more handy than messing with leaflet myself.
I'm trying to implement a filterable map. Markers can have multiple categories. When I filter using leaflet-optiongroup, only one category is aknowledged.
Example: Marker 1 has categories (a,b) Marker 2 has categories (b)
When I try to hide category b, only marker 2 disappears. When I hide category a and select category b, marker 1 does not appear.
I fear this is expected behaviour as markers can only be in one group? Is there a way to mitigate this?
My shortcodes for reference:
Danke und beste Grüße :)