How to get client's Geolocation (Latitude & Longitude) extremely QUICKLY? - google-maps

I am using Google Map's ClientLocation to retrieve the users geolocation (via their IP address). This is very slow because you first have to download and then load Google Maps, before it can even begin to geolocate the users IP address.
Then I came across http://fwix.com/. They are doing exactly what I want, but super fast without having to use Google Maps ClientLocation.
It appears they are generating the HTML page on the fly and injecting the latitude and longitude into the META area of the HTML.
Just view the source for fwix.com and you'll see something like:
<meta name="geo_lat" content="12.34567" />
<meta name="geo_lng" content="-98.76543" />
Questions:
How does fwix doing this?
What is the quickest way for me to retrieve a users geolocation (lat/lng) without having to load the entire Google Maps API? Meaning, if there a web service I can call programically that will simply return the users geolocation (lat/lng)?

You don't need any interaction from the client (besides their initial request, which reveals their IP address to the server) to locate them by their IP address.
Geolocation via IP is all done on the server side, and this can be quickly relayed to the client. If you experience slow loading, that's because your browser is loading something else.

Related

What data is sent to Google Maps API

I have searched for information on data and data security when using the Google Maps API, but I haven't been able to find anything that answers my specific question. We were looking to use Google Maps to to plot our customers and overlay some other information on top. I have all the customer details (name, address, postcode, Lat, Lon and other key details) in a file and have been using some test data. I have successfully been able to plot the test data on Google Maps and it looks like it is exactly what I would want to use.
The question I have is what data is sent to Google for the map to be rendered - does all of my data go external, or am I just pulling the maps back to the browser and rendering the data locally within the browser (ie. no data goes externally).
Thanks
Your additional data are never sent to Google servers. All the map is built in JS, so once you have loaded Gmap scripts, there is no need to sent data.
You can check that in your browser developer console : no additional AJAX request are made to Google, once the first one for displaying map is finished.
If you use geocoder or directions service (and maybe other services, but I have never use them), you have to send addresses or LatLng to Google via AJAX in order to make calculation.

Google Maps API Webservice usage in windows forms application

My requirement is this.I need to get the latitude and longitude for a given address using Google Maps API. I found in the Google Developers site the following web service which takes address as input and returns so much information of the given site which includes latitude and longitude also. I checked this by executing this URL in the browser.
Latitude and longitude information is coming under geometry/location section. I want to use this web service in windows based application and gets the latitude and longitude of different sites by passing different sites information to this web service each time in a loop.How can I do this?
Looks like you will have to either establish a static list of sites to iterate through them and modify the url accordingly or assemble the same url for the site that is requested by the user.
Also, you will need an XML parser:
http://msdn.microsoft.com/en-us/library/9d83k261.aspx

How to track geolocation in html5 without prompting geo location sharing

Short:How to track geolocation in html5 without prompting geo location sharing
Long: i wanna develop a website which tracking user location with out user prompting, is any way (like can i use phone gap for gps co-ordinates)
The geolocation warning is shown by the browser before sharing the location. This is a security measure and cannot be bypassed.
You could, however, get an approximate (and sometimes very inaccurate) location from the IP address using an API. There are many available, just try searching online.

Google Geo coding service for getting only geocodes

We have a pharmacy search application. We are trying to get the the input address from
user and find pharmacies around that address in a user specified raduis.
We are planning to geo code the address entered by user from a third party service.
After getting the geocodes we will search for pharmacies in our DB around that address and
display the results. With each result there will be a link which will open a new tab/window of maps.google.com displaying the location.
If we use the google geocoding API service to get geocodes will they charge for it ? I am not showing the map on my UI. Is that ok or violating the google terms ? Is the 2500 requests/day applicable for this scenario as well ? I am seeing that MapQuest is a service which will return only geocodes.
Thanks,
Avinash.
Double check with Google's Terms of Service, but generally they begin denying your API requests after you reach your limit. If you are a repeat offender, they may permanently prevent your IP from using their API. The limit is on the calls that you make to the Geocoding API and is unrelated to whether you display a map using their maps api. The following includes strategies for how to work within these limits: https://developers.google.com/maps/articles/geocodestrat
MapQuest just released their Open Geocoding Web Service, which is built using data provided by the OpenStreetMap community, and (currently) does not have a limit on the number of geocoding requests that can be made.

Get latitude / longitude / Reverse Geocoding without displaying maps

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.
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.
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.
I don't think Yahoo requires you to show a map and it also has a higher quota.
http://developer.yahoo.com/geo/placefinder/
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.