0

I am creating a map with clusters and I need to get location without using The Google Geocoding API. All i need is some code or link to help to make automatic generation location (or atleast town I'm in) without any popups, so I could get coodinates from google api.

hakre
  • 193,403
  • 52
  • 435
  • 836
M V
  • 83
  • 1
  • 10
  • 2
    You know that [GeoCoding](https://developers.google.com/maps/documentation/geocoding/) is from the google API ? So you're contradicting yourself. Also what do you mean by `automatic generation location (or atleast town I'm in) without any popups`. Your question is unclear and lacks code. – HamZa Aug 14 '13 at 07:07
  • When you are using GeoCoding a prompt (i guess it's called like that) is shown where you have to agree to share your location. I need something that does not need such confirmation – M V Aug 14 '13 at 07:11
  • 3
    @MV If you want *accurate* information, there's no real way around that. If you don't particularly care about accuracy, geolocation-by-IP is not a bad substitute. – deceze Aug 14 '13 at 07:13
  • 1
    Well there is a reason behind that:privacy. Unless you want to use an exploit to bypass it there is only another solution: determine the location by the IP address, this isn't accurate. – HamZa Aug 14 '13 at 07:13
  • 2
    If you don't want that pop-up, then you either need to crack a browser to break its security; or some form of wireless tag (such as those used for pet tracking).... either way, it's akin to spying – Mark Baker Aug 14 '13 at 07:17
  • 1
    I've found such link - freegeoip.net/{format}/{ip_or_hostname} – M V Aug 14 '13 at 07:32
  • http://stackoverflow.com/a/10562353/1239506 – Moyed Ansari Aug 14 '13 at 07:47
  • 1
    These comments are amazing. – Jared Aug 14 '13 at 08:15
  • @Jazza not only amazing but also true :-) – HamZa Aug 14 '13 at 08:16

2 Answers2

3

You might use the geoip extension or Net_GeoIP from PEAR to detect the approximate location of the user by their IP address.

cweiske
  • 30,033
  • 14
  • 133
  • 194
1

Try this service on http://www.maxmind.com/en/home. They have a nice api. good luck

Houssam Hamdan
  • 888
  • 6
  • 15