Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect waypoint click on DirectionsRenderer marker in Google Maps v3

In the Google Maps API v3, how can I get the waypoint markers from the DirectionsRenderer in order to add click events to them (such as a delete menu).

like image 526
theazureshadow Avatar asked Jul 08 '11 20:07

theazureshadow


People also ask

How do I find a waypoint on Google Maps?

In the Google Earth sidebar menu, under Places panel, click the plus sign to open the Places folder. In the Temporary Places menu look for Garmin GPS device and Waypoints to see the imported waypoints. The waypoints are imported as Placemarks in Google Earth.

Can you drop waypoints on Google Maps?

Open the Google Maps app. Search for an address or scroll around the map until you find the ideal pin location. To drop the pin, long-press on the screen in the desired location. The address or coordinates will pop up at the bottom of the screen.

What is the Google map marker called?

Jens Rasmussen, one of the inventors of Google Maps, a Danish computer programmer is credited with the creation of what is officially known as the map pin or pushpin .


1 Answers

Until a better solution can be found here is the work around that I have employed. The basic idea is to put your own marker on top of the waypoints and bind a click event listener to your marker. I have made a jsfiddle demonstrating the idea.

It definitely isn't perfect, but with a custom icon instead of the default marker it could look sort of natural.

like image 145
lashleigh Avatar answered Oct 30 '22 18:10

lashleigh