Deselect markers - google maps - 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?

Related

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');

Pop up info window on google map given coordinates

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)

Fusion Table Layer with polygons AND markers

Using Google Maps API v3
I have a map with the countries coloured using polygons from a Fusion Table Layer. When a polygon is clicked it opens the default Fusion Table info window which has been configured in the web interface.
Some of the countries can't be seen at certain zoom levels so I'd like these countries to have a polygon AND marker, which when clicked open the default Fusion Table info window. I did add a standard map marker but there is no way to open the Fusion Table info window when clicked.
I've read through the docs and looked at the examples but can't see how this is achieved. Is this possible?
Managed to get this working.
I created a second Fusion Table layer and instead of selecting the KML column I selected the Longitude column with a WHERE clause specifying the smaller countries. This renders a layer with markers on the smaller countries which sits on top of the polygon layer.
The only downside is that both the polygon and marker are both clickable which could open duplicate default Fusion Table info windows. Not a major problem though.
You can't access the "default FusionTables infowindow" from an external click event. You can query the FusionTable from your page and display an infowindow containing the same information on a click on a Google Maps API marker (or a sidebar entry).
Example (opening infowindow from sidebar click, not a marker, as you didn't provide an example)

Add Markers From embedded Google Map

how can a user add Markers from an embedded Google Map on my homepage to hin own map on google-maps?
Thanks
What you're proposing sounds like a Google My Maps. Go to http://maps.google.com, sign in to a Google account, and click on My Places. Then click on Create Map. You create a map, and embed it in your site. Anyone clicking on a marker created there can save that marker to their own map. Take a look at this sample map. Click on the marker for Google and in the infowindow, select Save to map.

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