gbengasupowale807 Posted November 3, 2018 Share Posted November 3, 2018 I have surf the web but still don’t find an explaining tutorial on how to use either google map or php google map to automatically detect the location of a user. This is what I want to achieve, during registration, a user current location will be extracted using either the js version of the map or the php version(depending on the one I saw a good way of using it), and extraction, the current town or city or village with also the country. Who can really put me through on how to use any of the above library Link to comment Share on other sites More sharing options...
HartleySan Posted November 3, 2018 Share Posted November 3, 2018 Here's a good starting point: https://www.w3schools.com/html/html5_geolocation.asp You have to do this in JS though, not PHP, and if the browser doesn't support navigator.geolocation, then you have to fall back on some PHP alternative, which is up to you to decide. Please note that the Geolocation API is built into regular JS, and it's separate from the Google Maps API, which is provided by Google. However, if you use the Geolocation API to get the user's current location, then you can feed the acquired coordinates into the Google Maps API from there. Make sense? Link to comment Share on other sites More sharing options...
Recommended Posts