3

Using a website, I am trying to capture user's latitude / longitude point and based on that grab his current address.

I am able to do this using Google Maps API: geolocation and Reverse GeoCoding. But, my requirement is to get this information without displaying the map. As far as I have read, Google Maps Term of Use prohibits such thing.

Can anyone let me know if there is any other service which can serve my purpose without displaying maps or does Google Maps allow such thing? I am not sure about Bing, Yahoo.

EDIT: On page load, I need to grab user's latitude and longitude and based on that get address information. I am planning to use this address information for displaying nearby locations/places to visit. I have to achieve this without displaying any map.

johnk1
  • 247
  • 8
  • 19

4 Answers4

2

I don't know if Im mistaken this post, but if you read this:

(viii) store or allow end users to store map imagery, map data or geocoded location information from the Yahoo! Maps APIs for any future use;

(ix) use the stand-alone geocoder for any use other than displaying Yahoo! Maps or displaying points on Yahoo! Maps;

It's mean that you can't store the information, or make use of it, without maps. So the google api and the yahoo api need to have a map...

note- I take that lines from the terms of yahoo: http://info.yahoo.com/legal/us/yahoo/maps/mapsapi/mapsapi-2141.html

EDIT - Now I'm trying to use http://www.geonames.org/export/reverse-geocoding.html It's easy, and works fine for me. I just need the city and maybe a postal code.

jfcogato
  • 3,359
  • 3
  • 19
  • 19
2

Yahoo PlaceFinder does it. If you pass through the latitude and longitude in the location parameter and gflags=R, it should return address data.

You'll have to get a Yahoo APP id, but its free and pretty easy to set up.

EDIT: I see you want to do geolocation too, if you can't use google I would investigate html5 geolocation and or use freegeoip.net to geolocate by ip address.

Dave
  • 11,499
  • 5
  • 34
  • 46
  • Thanks Dave for quick response. So, I am assuming its legal to get address data without displaying it on any map. Also, from where do I get the latitude and longitude information? from the same API? My concern is to do things without violating the term of use policy. – johnk1 Sep 28 '11 at 19:36
  • @johnk1 I thought you had the lon and lat already? What are you starting with? And yes I'm not a lawyer but I'm fairly certain you don't need to do anything special to use this. (I'm not showing a map!) – Dave Sep 28 '11 at 19:38
  • Sorry if I confused you but I have mentioned in first line of question. This how I start: User hits website url on a desktop browser. Now I need to detect user's location [latitude / longitude] and using those get his address information which in turn I can use it for displaying nearby locations to visit. Hope you get my point – johnk1 Sep 28 '11 at 19:42
  • @johnk I see you're trying to do geolocation! Yeah I think everyone missed that entirely, you might want to edit your question. I'll update my answer. – Dave Sep 28 '11 at 19:45
0

There are a number of geolocation APIs - here is a really good one:

https://geoip.nekudo.com/

You merely make a GET request to

http://geoip.nekudo.com/api/{ip}/{language}/{type}

where ip, language and type are optional.

E.g. in Angular 5, using HttpClient:

this.http.get('http://geoip.nekudo.com/api/') .subscribe(

data => { console.log('SUCCESS! Your coords are lat:', data.location.latitude, 'long:', data.location.longitude); }, error => { console.log('ERROR!', error); } );

Also, note that the geoip service is written in PHP and open source (https://github.com/nekudo/shiny_geoip) so you can house your own implementation to reduce third party dependencies.

Sensei James
  • 2,617
  • 30
  • 36
0

I don't think Yahoo requires you to show a map and it also has a higher quota. http://developer.yahoo.com/geo/placefinder/

  • but will I be able to detect user's location [latitude / longitude] using this API? – johnk1 Sep 28 '11 at 19:38
  • Welcome to Stack Overflow! Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. –  Sep 29 '11 at 12:55