Open dreadedhamish opened 1 year ago
OK - 1 minute into investigating and yes, GeoJSON is just a JSON file structured for geolocation.
Have a look at Extensions for Leaflet Map.
I can only confirm that. Leaflet Map and Extensions for Leaflet Map is the best combination and puts many functions together optimally. and geojson is the file format with the most possibilities. But it requires at least PHP7 to work with all functions. I have made an example with over 3000 POIs stored in 7 geojson files for selectability and different icons.
The Shortcode for the example:
[leaflet-map scrollwheel fitbounds height=700]
[leaflet-geojson src="../../../../wp-content/uploads/test/c23.geojson" iconurl="../../../../wp-content/uploads/test/Fahne_fc23s0.svg" iconAnchor="27,27" iconsize="54,54"] {name}{description}[/leaflet-geojson]
[leaflet-geojson src="../../../../wp-content/uploads/test/c22.geojson" iconurl="../../../../wp-content/uploads/test/Fahne_fc22s0.svg" iconAnchor="27,27" iconsize="54,54"] {name}{description}[/leaflet-geojson]
[leaflet-geojson src="../../../../wp-content/uploads/test/c21.geojson" iconurl="../../../../wp-content/uploads/test/Fahne_fc21s0.svg" iconAnchor="27,27" iconsize="54,54"] {name}{description}[/leaflet-geojson]
[leaflet-geojson src="../../../../wp-content/uploads/test/c20.geojson" iconurl="../../../../wp-content/uploads/test/Fahne_fc20s0.svg" iconAnchor="27,27" iconsize="54,54"] {name}{description}[/leaflet-geojson]
[leaflet-geojson src="../../../../wp-content/uploads/test/c19.geojson" iconurl="../../../../wp-content/uploads/test/Fahne_fc19s0.svg" iconAnchor="27,27" iconsize="54,54"] {name}{description}[/leaflet-geojson]
[leaflet-geojson src="../../../../wp-content/uploads/test/c18.geojson" iconurl="../../../../wp-content/uploads/test/Fahne_fc18s0.svg" iconAnchor="27,27" iconsize="54,54"] {name}{description}[/leaflet-geojson]
[leaflet-geojson src="../../../../wp-content/uploads/test/c17.geojson" iconurl="../../../../wp-content/uploads/test/Fahne_fc17s0.svg" iconAnchor="27,27" iconsize="54,54"] {name}{description}[/leaflet-geojson]
[layerswitch]
[markerClusterGroup feat="iconUrl" strings="Fahne_fc23s,Fahne_fc22s,Fahne_fc21s,Fahne_fc20s,Fahne_fc19s,Fahne_fc18s,Fahne_fc17s" groups="Fahnen Challenge 2023,Fahnen Challenge 2022,Fahnen Challenge 2021,Fahnen Challenge 2020,Fahnen Challenge 2019,Fahnen Challenge 2018,Fahnen Challenge 2017"]
[zoomhomemap]
[fullscreen]
[leaflet-scale]
[gestures]
Thanks @hupe13 and @gmbo - I've got a map up and running with GeoJSON and clustering with a few styling tweaks - very easy and I'm very thinkful this ahas been made into a wordpress plugin! The only think I didn't have success with was replacing markers with 1 count clusters.
@gmbo what doesn't work with <PHP7?
@hupe13 With PHP7 everything works great, that's why you need the upgrade. I only have the case that other software in the account with PHP5 is still being migrated and then the installation uses an earlier version that does not have all the features. The example test site runs fine with PHP7. Thanks for the good plugins.
Yes it works with php 7, but it does not work with php < 7.
I've got 350 markers to add, and I plan to use clustering to avoid performance issues. I expected to find an option to load a text file (CSV, JSON...), but can't see that option.
Should I investigate GeoJSON? From reading all the github issues it seems to offer this functionality.