Get Area and SubArea name by reverse geocoding in ng-Autocomplete - javascript

I am new to angularJS, I use the ngAutocomplete to get the locations from google service. It gives me the latitude and longitude whenever I select a location.
Now, I want to get the area and location name from selected latitude and longitude by reverse geocoding service.
I want to use the googple javascript API in ngAutocomplete module, so if user selects a location then It will return the area and location name too.
Thnanks

You are may be asking about Reverse Geocoding to get the detail information of location.
You can get the enough information about the Reverse Geocoding from
https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse
Thanks.

Related

How to return the exact address name from google maps api

Google map post code doesn't show exact address using Google maps API! For example if I search a nw107ns it shows park royal as formated_address which is a big place while it should show Middlesex center hospital.
Am using Google map API with restrictions to UK only.
Your answers are appreciated!!!
If you are using Geocoding API, please note that this API meant to convert complete addresses to lat-lng coordinates. Providing only the postal code and the country will give you the details of the postal code NW10 7NS. To get the address of Middlesex center hospital, you must at least include the name of the establishment on your API request to make it more specific.
Like this:
https://maps.googleapis.com/maps/api/geocode/json?address=Middlesex%20center%20hospital&components=country%3AGB&region=GB&key=YOUR_API_KEY
When using Geocoding API, make sure to adhere to Geocoding Best Practices.
If you are using autocomplete, generally Place autocomplete will return a list of places matching the user's input. If you input NW10 7NS, the autocomplete will return the the place of type postal code since this matches the user's input. If ever you filter the results by type(e.g establishment), the autocomplete will only return places with names or addresses that matched the users input. In the case of NW10 7NS, the API will not return anything since there's no place of type establishment named "NW10 7NS".
Here's a sample Place Autocomplete implementation you can refer to: https://jsfiddle.net/tzgq6kva/

Google map api - How to Get the Place's Name from lat/lng

Greetings i was searching for hours and I haven't found anything remotely close to this.
I am trying to use Distance Matrix API, However as an input the api needs the Origin Address aka Name and Destination as well. But i can only provide Origin's Lat/Lng and Destination's Lat/Lng from which i get them using my own markers.
Is it possible to get the place's Name and Address from Lat/Lng of the given origin?
Or Am i in whole wrong path to achieve this? any suggestion would be appreciated. thank you.
For your information. DistanceMatric Api works not only with string addresses it also works with lat/lng, place_id as well.
Go through below doc
https://developers.google.com/maps/documentation/distance-matrix/intro
So, no need to convert your lat,lng to string addresses.(otherwise simply api hits will increase)
If you want to see result. Check below api.
https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6655101,-73.89188969999998&destinations=40.6905615%2C-73.9976592&key=[API_KEY]
Note: Replace API_KEY with your api key
You can use the latitude/longitude coordinates for origin and destination parameters. Its in the documentation https://developers.google.com/maps/documentation/distance-matrix/intro
But if you really want to get the address from latlng you can reverse geocode it like this:
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY
here is the link to the documentation for your reference
https://developers.google.com/maps/documentation/geocoding/start

Convert zip/postcode to latitude and longitude with mapbox API

I'm using Mapbox in a web app. I have functionality where a user inputs a zipcode and it should display on the map then do some other stuff with the data. All I'm trying to do right now is convert the zipcode to latitude and longitude to display the marker on the map and log the coordinates. Is there a way to do this in the Mapbox API? If so I can't seem to find it. If not, is there another easy way to do this?
Mapbox has it's own geocoding API in public beta:
Geocoding requests are queries composed of location text or lat/lon coordinates that can be used to find corresponding place data. A geocoding request includes a geocoding {index} in requests which specifies the dataset to use to find place data.
https://www.mapbox.com/developers/api/geocoding/

Get nearest Location from google map api

I want to retrieve the nearest location to a latitude and longitude.
If I perform a get with the following url
https://maps.googleapis.com/maps/api/place/search/xml?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=MY_KEY
I am expecting it to return a JSON array.
However, I get an Access Denied result. I generated my key from the Google console.
Please let me know what I might be doing wrong.
For retrieving the current location of device you can go-through this answer and this answer.
Then get places near your location using Google's Place API and you can also refer this blog.

Google Maps API v3 are not displaying more than 10 markers

I am using Geocoder callback function for getting latitude and longitude value which is asynchronous.
This works great for the 1st 10 items. I will see a markers on the map as well as those 10 listed on my sidebar. However, the 11th item and beyond will not display anything. I am querying our internal database based on parameters set which often will produce 30+ rows returned in the database table which I am looping through.
Is there any way to display more than 10 addresses on google map. or is there any need to purchase any license for get additional API for geocoder .
Thanks in advance !
The Google Geocoding services are rate limited and subject to quotas (to prevent abuse), the (paid) Google Maps API for Business, does have higher limits. The usual suggestion is to geocode the loctions offline, store the coordinates in your database, then use those coordinates to display the markers.
If you can't store the locations in your database, you need to check the return value in the geocoder and delay when it returns over query limit errors. There are examples of doing that both here in SO and in the Google Maps API v3 group.

Categories

Resources