Add Lat Lng (Latitude, Longitude) from map to contact form
-
I have a Mapbox map on my site where a user can drop a marker on their property. When the marker is set, a popup shows the Lat Lng of the property. What I would like to do is have the Lat Lng from the popup sent to a field in the contact form, either a hidden field or not. The contact form is on the page next to the map and I have the Contact Form 7 Modules loaded so I can get hidden fields as an option.
Here is the code I am using to get the marker to show a popup with the Lat Lng:
` if (type === ‘marker’) {
layer.bindPopup(‘Property Location: ‘ + layer.getLatLng()).openPopup();
}});`
Thank you.
- The topic ‘Add Lat Lng (Latitude, Longitude) from map to contact form’ is closed to new replies.