Closed RayHollister closed 1 year ago
[markerClusterGroup feat="name" strings="neighborhoods" groups="Neighborhoods"]
is only for markers, inluding geojson markers. Switching other geojson on and off isn't possible (yet) and needs extra programming.
You can take a look at [hover]
.
Darn. I thought that might be the case. Thanks for that clarification.
I'll work on integrating this plugin (https://github.com/ptma/Leaflet.Legend) into my Wordpress plugin, assuming you don't want to add it to Extensions for Leaflet Map.
I think this function might also interest others. If you want to help me, feel free to do so.
I am trying to add a layerswitch to toggle a polygon laye on and off, but I can't seem to figure out how to make it work. I have Leaflet Map and Extensions for Leaflet Map both installed. Here's my shortcode:
[leaflet-map fitbounds height=1000 detect-retina zoomcontrol scrollwheel tileurl=https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png attribution='© OpenStreetMap contributors © CARTO.' zoom=16]
[leaflet-geojson src=https://raw.githubusercontent.com/RayHollister/JacksonvilleNeighborhoods/main/neighborhoods.geojson]{NAME}[/leaflet-geojson] [layerswitch] [markerClusterGroup feat="name" strings="neighborhoods" groups="Neighborhoods"] [fullscreen] [zoomhomemap fit]