Menü schliessen
Created: January 20th 2021
Categories: IT Development,  Wordpress
Author: Marcus Fleuti

Wordpress Plugin: ACF-Plugin for custom OpenStreetMap selection and easy embedding

Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

ACF OpenStreetMap Field

This plugin allows you to create custom ACF-fields, which allows the customer to insert multiple markers into an OpenStreetMap. Thanks to Leaflet.JS the user is able to select a very big amount of different layers (designs for the map).

After you installed the plugin you simply can create a new ACF-field "OpenStreetMap".

Return values

There are following return values that you can select in the backend:

  • Raw data (is returning an array with the configuration of the map, can later be used to create a complex Leaflet map)
  • LeafletJS (is returning a functional LeafletJS map, you just need to add <?php the_field('my_map') ?> to the code)
  • iFrame (is returning a OpenStreetMap iFrame, but only four layers can be used and not more than one marker)

Probably the best return value is simple LeafletJS. It allows you to select tons of layers, even overlays are supported (railways, roads...)