Google Maps - Click Marker Open InfoWindow and Draw Route - google-maps

Is it possible to both open and infowindow and draw the route between a 'home' marker and the marker clicked?
What I've got is multiple markers on a map with a 'home' marker. I'd like to have the route drawn on the map from this 'home' marker to the marker clicked.

What you want is an event listener on your markers for the click event. Within that, use the DirectionsService to draw your route.

Related

Openlayers 4 Marker Events (8302859777)

I am working on Openlayer4.
There are no marker events in the official documentation.
So can you please provide me the appropriate link or code to handle the marker events in OpenLayers 4.
Like:
Marker On Click Event
Marker Double-Click Event
Marker Right Click Event
Marker Mouse Hover Event

Google Maps infowindow outside map on marker click event

I would like to dedicate ~2/3 of the page width to a Google Map, and ~1/3 to a div that displays information content of an infowindow for the clicked-on marker.
Upon a click on a certain marker, that marker would be highlighted to indicate the marker that the displayed information relates to.
Reason: I have a lot of markers in a close proximity and triggering an infowindow
Question: How could I display information of an infowindow for each marker in that div element, instead of overlaying an infowindow over the map?
UPDATE:
I am using gmaps4rails, and create a bunch of markers using the addMarkers method with the following argument (an array of markers with its own latitude, longitude, etc):
{'lat' => img["coords"]["latitude"].to_s,
lng' => img["coords"]["longitude"].to_s,
'infowindow' => img["imagePath"]+"<br/><a target='_blank' href='../get_image?path=" + img['imagePath']+"'><img style='height: 400px' src='../get_image?path=" + file_path+"'/></a>"}
I get a map with markers that have individual infoboxes (image path + an image).

Show InfoWindow onMouseOver in Google Maps v3 without a Marker

I have a map which has polygons defining various locations.
I am trying to trigger an infowindow when the pointer mouses over the polygon, and then remove it when the mouse leaves. i have center coordinates for the polygons, and there is no marker.
All of the infowindow examples I found are based on having a marker point.
How can I acheive this without a marker?
You can attach the infoWindow creation to the polygon mouseover event. Then have the window close when the user mouses out. Something like this:
google.maps.event.AddListener("mouseover", polygon, function() {
infoWindow.setPosition(latLng)
infoWindow.open(map)
})
google.maps.event.AddListener("mouseout", polygon, function() {
infoWindow.close()
})

Bind Click Event to GMap Markers

I want to bind a Clickevent to Markers of a GMap, which are already there when the page is loaded. So I dont want to create new Markers, i only want to bind a Click Event to existing Markers.
The Map and the Markers are already placed and now i want to do some jQuery Stuff when the user is clicking on a Marker of the map.
I only have found solutions how to create new Markers and so on. Im working with the API v3.

close active infowindows from external link google maps api v3

I am working on a website with google maps integrated.
http://www.ecompanies.nl/pilot/webdesign/breda.html
Infowindows can be opened by clicking on a map marker, or on a header link in the items listed on the right. How can I close the active infowindow before opening a new one (by clicking on a map marker, or on a header link)?
Thanks in advance.
Any help is highly appreciated.
You are creating a new infowindow for each marker. The best way to achieve what you want is to create one infowindow and share that between all the markers.
So:
Put the infowindow creation before the loop.
When you create the click event listener for the marker in the loop add infowindow.setContent('content'); before you open the marker.
this will automatically close the infowindow and open it over the new marker