Reputation: 45
How do I get a user's current location using nodejs modules of google maps. I've tried using Geocoder. But, that involves manually typing a user's location and using it to get the user's location coordinates. What are the other ways of doing this?
Upvotes: 0
Views: 612
Reputation: 72965
You can't get the user's geo-location directly from the server. Best you can do is get the origin IP and trace that using an IP lookup service.
Alternatively, you could have the browser (front-end) pass location data to your back-end, though this would require the user to explicitly give permission.
Upvotes: 1