I did something similar in a custom form I recently coded as part of a course project (I’m learning to code now).
If you have basic programming skills and a little time to burn, here is a very simple tutorial which walks you through the entire process: get the user’s GPS coordinates (via HTML5 Geolocation API in supported browsers), use Google Geocoding API to convert the coordinates to matching address(s) displayed on a Google map, ask the user to select/confirm the correct address, and if necessary, drag the marker to the precise location.
https://css-tricks.com/lets-make-a-form-that-puts-current-location-to-use-in-a-map/
I have looked at many of the mapping plugins, but I can’t find one that seems to do this. Any suggestions would be greatly appreciated. Ideally it would be a free plugin or at least not too expensive.
I think you should be looking for forms with geolocation support.
For Gravity Forms: https://gravitygeolocation.com/
For Formidable Forms: https://geomywp.com/extensions/formidable-geolocation/
For Caldera Forms: https://calderaforms.com/doc/using-geolocation-fields/
For WPForms: https://wpforms.com/addons/geolocation-addon/
Note that I have no personal affiliation or experience with any of these geolocation extensions/addons… and from my tests, it appears some of them fetch the location data in the background (ie no way for the user to correct/confirm the marker on a map). This is just a pointer as to where you should be looking for a solution: do your own research, check out these and more options, test their demos, and pick what works best for you.
Good luck!
]]>I will have a look at the form plugins again. I might have to ask on their forums as it was not obvious that they could what I was looking for. I would have thought it would have been a common request.
It looks like it cost US$200 per year with WPForms. That is quite a lot for a not for profit for such a small function.
]]>I will have a look at the form plugins again. I might have to ask on their forums as it was not obvious that they could what I was looking for. I would have thought it would have been a common request.
Unless I’m completely misunderstanding your request, this screenshot seems like exactly what you’re asking for (taken from the Gravity Geolocation demo page)
And here is another one, taken from the Formidable Forms geolocation extension demo page:
Now…
I’m not a developer, and I don’t know if a web page can *directly* access GPS data (technically possible, but I’m talking about device security restrictions here). But whether it can or not, the common, easier, and (arguably) preferred practice today… is to delegate that job to the browser. In most cases, as in the examples above… the webpage makes the location request to the browser via the HTML5 geolocation API, and the browser queries the device for location data.. which can be from GPS, WiFi, IP address, etc.
Note some interesting tidbit I found on the MDN page linked above:
Note: By default,
getCurrentPosition()
tries to answer as fast as possible with a low accuracy result. It is useful if you need a quick answer regardless of the accuracy. Devices with a GPS, for example, can take a minute or more to get a GPS fix, so less accurate data (IP location or wifi) may be returned togetCurrentPosition()
.
(Note: it’s possible to force the device to wait and return GPS data if available. But as this can take so long, chances are most of these forms plugins will not have this option. That’s another reason to roll your own solution, using the resource I linked to in my earlier response.)
]]>