Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the best way to add bulk markers to a map? #179

Open
dreadedhamish opened this issue Oct 19, 2022 · 7 comments
Open

What's the best way to add bulk markers to a map? #179

dreadedhamish opened this issue Oct 19, 2022 · 7 comments

Comments

@dreadedhamish
Copy link

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.

@dreadedhamish
Copy link
Author

OK - 1 minute into investigating and yes, GeoJSON is just a JSON file structured for geolocation.

@hupe13
Copy link
Collaborator

hupe13 commented Oct 19, 2022

Have a look at Extensions for Leaflet Map.

@gmbo
Copy link

gmbo commented Oct 19, 2022

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]

@dreadedhamish
Copy link
Author

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
Copy link
Collaborator

hupe13 commented Oct 19, 2022

what doesn't work with <PHP7?

My plugin. You should upgrade PHP .

@gmbo
Copy link

gmbo commented Oct 19, 2022

@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.

@hupe13
Copy link
Collaborator

hupe13 commented Oct 19, 2022

Yes it works with php 7, but it does not work with php < 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants