Click event in Google Map InfoWindow not caught

前端 未结 6 1995
暖寄归人
暖寄归人 2021-02-08 13:43

With Google Map v2, I would like to be able to trigger a function when clicking a text in the InfoWindow of a GMarker.

$(\".foo\").click(myFunction);

...

marke         


        
6条回答
  •  忘掉有多难
    2021-02-08 14:23

    I couldnt get it working like Kevin Gorski explained...

    with jquery 1.9.1 and maps api v=3.exp the following works:

    infowindow.setContent('test');
    google.maps.event.addDomListener(infowindow, 'domready', function() {
        $('#test').click(function() {
            alert("Hello World");
        });
    });
    

提交回复
热议问题