Im using Google route planner on my website with directions panel on the side. When you click on certain part of a jurney it gets zoomed in on the map but its not centered. Is it possible to center it in the midle of the map?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no implemented option to control anything when you click on the panel.
But what you can do: When you click on the panel, the infoWindow opens.
You may create your own infoWindow-object and pass it as infoWindow-option to the directionsRenderer.
Then you’ll be able to control the infoWindow. Observe the domready-event of the infoWindow(it will fire before the infoWindow opens), and set the center of the map to the value returned by the getPosition()-method of the infoWindow.