This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Get Lat Long from map #91
Labels
Comments
Hi @anim007 in order to place a marker, you need to know lat,lon. So I don't really understand your question but if you wish to get the location when the marker has been moved. Then I highly recommend that you append your custom JS to the widget so you can effectively get the current location of the marker. |
just add Event on "dragend" to the Marker <?php
$marker_dragend_event_js = <<<JS
document.getElementById('latitude_input').value = event.latLng.lat();
document.getElementById('longitude_input').value = event.latLng.lng();
JS;
$marker = new Marker([
'position' => new LatLng(['lat' => 39.7200, 'lng' => 2.9116]),
'draggable' => true,
'title' => 'Marker',
'events' => [
new Event([
'trigger' => 'dragend',
'js' => $marker_dragend_event_js,
]),
],
]); |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hii 2amigos, can i use this library for location picker? like get the lat long from marker i set. Thanks
The text was updated successfully, but these errors were encountered: