Geolocation
-
Hello,
I would like to add the following plugin https://github.com/domoritz/leaflet-locatecontrol to allow users to be geolocated on the map.I tried to start from the FAQ which would give something like this?
functions.php
add_action('leaflet_map_loaded', 'fs_leaflet_loaded'); function fs_leaflet_loaded() { wp_enqueue_script('locate_leaflet', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/L.Control.Locate.min.js', Array('wp_leaflet_map'), '1.0', true); wp_enqueue_style('locate_leaflet_styles', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/L.Control.Locate.min.css'); }
on the pages
<script> L.control.locate({ strings: { title: "Show me where I am, yo!" } }).addTo(map); </script>
Am I missing something?
Thanks for your help.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Geolocation’ is closed to new replies.