S
S
sajgak2011-02-10 12:07:02
Google Maps
sajgak, 2011-02-10 12:07:02

Google Maps, working with a map on a click on a DOM element

Actually, you need to open an infowindow attached to a marker with a unique name (marker1, for example) when clicking on an element outside the map structure (say, on a link under the map). I feel that this can help me code.google.com/intl/ru-RU/apis/maps/documentation/javascript/reference.html#MapsEventListener , but without an example I can't figure out which side to approach.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sajgak, 2011-02-11
@sajgak

In short, half a day of googling did give the only correct result.
After you've created a marker object and attached an infobox to it, you can call

$('#marker1').click(function(){
           google.maps.event.trigger(marker,"click");
           return false;
 });

and all. God bless someone help :)

J
jeston, 2011-02-10
@jeston

So you can open your example and see how it 's
done ) InfoWindow content" }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker)
});
});

J
javax, 2011-02-10
@javax

I didn't understand what the problem is. You receive the click event on the link, take the infowindow object (which was created in advance and is attached to the marker) and call open on it (or how do they make it visible?)

B
boa, 2011-02-10
@boa

Example :) gmaps-samples-v3.googlecode.com/svn/trunk/spreadsheets/mapwithsidebar.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question