Identifier in the Google Maps API

I have a question that I cannot find a solution. I am not a stranger to the Google Maps API, and in the past I encoded maps and pages with directions. The problem that I always run into does not have the name of the place returned in the results for the source, destination, or any waypoints. Directions return as I set them, but the addresses are always "formatted", not the hot directions (with place names) that I send.

So my question is this: is there a way to save the name of the place so that it appears in the address in the directions bar?

Example: Data sent: "John Smith, 570 Washington Street, nowhere, TN 33002" Data returned: "570 N Washington Street, Nowhere, TN 33002, USA"

No name or identifier, just an address. Any direction in the right direction would be greatly appreciated. And please do not send a letter to John Smith now ... he hates this.

+4
source share
1 answer

What you need to do:

1) suppress instructions Display the generated markers and the info window (which contains the address)

2) Put your own markers and info windows

To complete 1) - you need:

directionsDisplay = new m.DirectionsRenderer({supressMarkers: true, suppressInfoWindows: true}); 

for 2) - you should just create a marker, as usual.

0
source

Source: https://habr.com/ru/post/1446711/


All Articles