Google Maps working with the map by clicking on the DOM element


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
4 views
Actually you need to open a infowindow attached to the marker with a unique name (marker1, for example) when you click on an element outside of the map structure (say, the 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 think of which side to approach.
by | 4 views

4 Answers

0 like 0 dislike
So in your example it is possible to open and see how it is made)
\r
For
\r
Click me to open the InfoWindow
\r
write
\r
$("#infoOpener").click (finction(){
\r
var infowindow = new google.maps.InfoWindow({
content: "My content InfoWindow"
});
\r
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker)
});
\r
});
by
0 like 0 dislike
Shorter half day gugleniya still gave the right result.
\r
After you have created a marker object and tied to it intake, you can call
\r
$('#marker1').click(function(){ google.maps.event.trigger(marker,"click"); return false; }); 

\r
and that's all. God forbid, someone will help:)
by
0 like 0 dislike
What I do not understand what the problem is. Get event click on the link, bereite the infowindow object (which is created in advance and attached to the marker) and invoke open (or whatever makes it visible?)
by
0 like 0 dislike
by
110,608 questions
257,186 answers
0 comments
27,835 users