Feature request: add a field to the Event Organiser settings to store another map provider’s tile URL, and/or a filter to enable this to be set via code.
Currently map tiles are requested from tile.openstreetmap.org if the Map provider is set to OpenStreetMap in Event Organiser settings, and as https://switch2osm.org/using-tiles/ notes “Apart from very limited testing purposes, you should not use the tiles supplied by OpenStreetMap.org itself”. For some sites this may become an issue, depending on traffic.
Adding this feature would enable use of alternative providers such as Mapbox: https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/1/1/0?access_token=YOUR_MAPBOX_ACCESS_TOKEN or MapTiler: https://api.maptiler.com/maps/streets/{z}/{x}/{y}.png?key=YOUR_MAPTILER_API_KEY or any of the other providers listed here http://leaflet-extras.github.io/leaflet-providers/preview/ in place of tile.openstreetmap.org in L.tileLayer when the plugin renders a map using leaflet.js
Thanks, David
SRUC Webmaster
Hi David,
I guess there’s two potential features here:
1) Make it easier to register entirely different map providers.
2) Making the tiles for OSM configurable
For (2), a quick solution would be add to add a filter before a UI solution can be built.
For (1), this requires a bit more investigation but shouldn’t be too difficult.
Stephen Harris
Hi Stephen, a filter would be great thanks, something along the lines of the acf_osm_leaflet_providers filter https://github.com/mcguffin/acf-openstreetmap-field/issues/38 would be ideal – basically this is me asking the same question of the developer of the https://wordpress.org/plugins/acf-openstreetmap-field/ plugin.
Their plugin uses https://github.com/leaflet-extras/leaflet-providers to make alternate providers available to LeafletJS – it would be great if you could also implement this within Event Organiser.
There’s a request to include MapTiler within leaflet-providers https://github.com/leaflet-extras/leaflet-providers/issues/327 and I’m planning to put in a pull request for this once I’ve figured out the code a bit.
Thanks again, David
SRUC Webmaster