adosbits
adosbits

Reputation: 45

Getting a user's location nodejs

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

Answers (1)

brandonscript
brandonscript

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

Related Questions