3
votes

I'm wonder if I can get Ski Trail Name from Google Map api.

For example, I picked a location on google map that displays as ski trail "The Main Street" on Google Map. https://www.google.com/maps/place/39%C2%B015'31.7%22N+120%C2%B007'42.5%22W/@39.258805,-120.128457,17z/data=!3m1!4b1!4m2!3m1!1s0x0:0x0

Then I try using google geocode api to get the name of that location. https://maps.googleapis.com/maps/api/geocode/json?latlng=39.274178,-120.119568&key=API_KEY

I couldn't get the name of "The Main Street."

I'm thinking I should be querying on a different layer of google maps, but I don't know where to look. Any help is appreciated.

1
"The Main Street" isn't an "address". You might try the places API (but no guarantees). - geocodezip
I tried place API: maps.googleapis.com/maps/api/place/nearbysearch/… it's not it. - imcc

1 Answers

1
votes

You have to use the Google Place API to get the name or the detailed information about a location on the Google Maps, For specific trails or routes on the Google maps you have to use the Direction API. You have to get the Server API Keys for both the API from Google Developers Console and then put that in the API request call.

Follow the instruction on this Google's official documentation for Places API & Follow the instruction on the Google's official documentation for Direction API set up.

Please have a look at this example for implementation in your app code.

Hope this would Help!!