Getting list of cities connected directly woth a city by road - google-maps

Is there some way to get list of cities connected directly with a city using google maps api?

No, there isn't a way to do that with the Google Maps API. You would have to know which cities you're interested in before hand and use the Distance Matrix.

Related

Google Place API city search by coordinates

I'm trying to access cities from the google place API. I want to be able to search with coordinates and have it return a city. My goal is for a user to be able to enter in a city and a photo shows up. So after getting the city, I will use the photo reference to get the image.
This is my request
https://maps.googleapis.com/maps/api/place/search/json?location=35.4107,80.8429&radius=100&sensor=true&key=API_KEY
the coordinates entered is a City in North Carolina. However, it does not return a city within North Carolina at all. All I am looking to do is use coordinates inside my request and have it return the city the coordinates are in. I'm relatively new to development, if I have been unclear in any way please point it out so that I may correct myself. Thanks!
I believe reverse geocoding is more suitable for your task than Places API. Places API is designed to search businesses and POIs at first place, localities shouldn't be among the results.
With reverse geocoding you can specify a coordinate and type of result you are looking for. For example, to search the city use the following request
https://maps.googleapis.com/maps/api/geocode/json?latlng=35.4107%2C-80.8429&result_type=locality&key=YOUR_API_KEY
This will return the "Huntersville, NC 28078, USA"

Street and Road names in Google Map

I would like to retrieve all the road and street names, if i enters a area in search box. Is that possible in Google API ?
I have checked List of all street and road names in Google in API for solution, but there it is been given for auto complete box and the request is not for my requirement.
Also I learnt that Open Street Maps provide us these data, unfortunately I would like to perform some operations based upon the Google API's. So can you suggest me a way, otherthan OSM.
Google Maps API does not provide such functionality. However, there is a Google Maps Roads API which is one of their premium paid APIs which lets you query nearest road names and other road metadata. You can check that out here:
https://developers.google.com/maps/documentation/roads/intro
You can also try Overpass-Turbo (https://overpass-turbo.eu/) which lets you query OSM data. You can set the bounds and the OSM tags you are interested in.

Google Maps API - How to get only districts names of city?

I would like to create a two-steps form using Google Maps API. At first, the user would like to select a city. Then, in next step, I want to generate a select list with district names of city (which was specified in first step).
I know how to create an autocomplete input with cities but I can't find any informations about districts. Is it possible using Google Maps API?

Google Maps api

I have to provide such functionality:
User checks 2-10 cities at Google Maps, I count the way between those cities using roads and show the way. The additional information is length of the full way.
Is it possible with google maps?
If you already know the order you want to be travelling to the cities in, then you just have to make a DirectionsRequest using the in between cities as waypoints. If you don't know the order, as long as you know the start and end, you can have Google Maps optimize the order of the waypoints for you.
http://code.google.com/apis/maps/documentation/javascript/services.html#Waypoints

how to get an administrative_area_level_1 list for a given country from google maps api?

I'm building a drill down interactive map
I want to use lists, that will enable the user to drill from continent to country to administrative_area_level_1 regions
is there a way to query google maps api and get a list of administrative_area_level_1 names for a given country?
I looked in geocoding - which gives me essentially a lat/lng coordinates for an address
also looked at reverse geocoding, that will return address components for a given lat/lng
not relevant...
i need a list of administrative_area_level_1 names for a given country...
I don't believe Google has a complete list or API for that information, but there are several resources that might be helpful:
Counties (US Census Data)
Cities (Google AdWords API
"Geographical Targets" (Google AdWords API)
That last one is ambiguous but seems to include quite a lot. You could probably filter it down to just what you need.
Unfortunately the Google Maps API does no provide this functionality. You will have to look into solutions such as the SimpleGeo Context API.