Pop up info window on google map given coordinates - google-maps

I wonder is there a way to automatically pop up the infoWindow of a marker provided a coordinate. I want to click a link on the page from which I will get a geolocation, (and this location has already been marked on the map) With this coordinate, the corresponding infoWindow will pop up just like I clicked it on the map. Does anyone have a clue how to do that?
Thanks.
--
Generally, it's like what you can do with Google Maps, if you have multiple locations on the left, you click one, the corresponding marker on the map will pop up an infoWindow.

It's possible, all you need is a reference to the related marker, then you may trigger a click on the marker, and the infoWindow will open.
How to get the reference to the marker depends on your application(the way you create the markers and the links)

Related

Deselect markers - google maps

I have a google maps, with multiple markers, when I click on a marker the image of a marker changes.
Now I want when I click on another marker, the previous one I want to returns to the original image.
How can I do that?

Changing all markers icons except for the one clicked on in Google Maps

I need to set up a map with several markers.
I know it is possible to change the icon marker on click, and to change the icon marker on click on an external link. I would like to know if it is possible with the Google Maps API do to the following :
On clic on a marker, changing the icons of all other markers (in order to have the marker I clicked on be on highlight and the others fade) ?
On clic on an element, change the icon of all other markers (for exemple, clicking on "show event" would put the corresponding marker on highlight and the others would fade) ?
Thank you !
You need the collection of all the markers in an arrays ..
var myMarkers[]
Then preserve the marker you click doing a copy so you can iterate over this array of markers and change the icon for all the markers
myMarker[i].setIcon('my_new_icon.png');
and last preserve le marker icon
myCopiedMarker.setIcon(my_old_icon.png');

when closing google marker go back to center of map

I have a map which opens multiple markers then when you click on one of the markers a street view of that location opens up. What Im trying to do is when you close the marker have it re-center the map
You can always get the center of a map (getCenter()), so you will know the lat/long before you open a Street View image. There are then setCenter() and panTo() methods in the API: http://code.google.com/apis/maps/documentation/javascript/reference.html#Map

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

GoogleMaps API v3 - Need help with two "click" event scenarios. Need similar functionality to v2 API

In version 2 of the API the map click event returned an Overlay, LatLng, Overlaylatlng.
I used this to create a generic map event that would either retrieve the coordinates of the Map click event, or return the coordinates of a Marker or other type of Overlay.
Now that API v3 doesn't return the Overlay or Overlaylatlng during the map click event, how can I go about creating a generic "click" event for the map that works if the user clicks on a marker or overlay? I really don't want to create a click event for each marker I have on my page as I am creating anywhere from a handful to a couple thousand markers.
Also, I had to create a custom ImageMapType in order to display the StreetViewOverlay like we could do in v2 of the API because I couldn't find anywhere that told me how to add the StreetViewOverlay without the pegman icon. How can I go about retrieving the LatLng coordinates of a click on this overlay type as well?
You will need to add a click listener to each overlay you add. You can do this in a createMarker function to reduce your code overhead.
Clicks on markers do not trigger a click event on the map at all.