【问题标题】:jquery-ui-map detect infowindow closed and pan to map centerjquery-ui-map 检测信息窗口关闭并平移到地图中心
【发布时间】:2012-09-05 16:21:13
【问题描述】:

如何检测 jquery-ui-map 中关闭的 infowindow 并在窗口关闭后将地图平移到中心?

<pre>

 $(function() { 
                demo.add(function() {
                    $('#themap').gmap({'center': '54.977614,23.871643', 'zoom': 7,'disableDefaultUI':false, 'callback': function() {
                        var self = this;
                        $.getJSON( 'index.php?option=com_maps&view=stendai&format=json', function(data) { 
                            $.each( data.markers, function(i, marker) {
                                self.addMarker({ 'id':marker.id, 'position': new google.maps.LatLng(marker.latitude, marker.longitude),'icon':'images/stendas.png' , 'bounds':true }



                                 ).click(function() {
                                    self.openInfoWindow({ 'content': marker.content }, this);
                                });

                            });
                        });
                    }}); 
                }).load();
            });


</pre>

【问题讨论】:

    标签: jquery-ui google-maps google-maps-api-3 jquery-ui-map


    【解决方案1】:

    Google Maps Infowindows 有一个closeclick 事件。您可以为每个信息窗口附加一个侦听器到此事件,并在收到此事件的通知时平移地图。 this posting 中给出了一个基本示例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-05
      • 1970-01-01
      • 2013-05-04
      • 2011-07-28
      • 2014-01-04
      • 1970-01-01
      • 1970-01-01
      • 2012-10-08
      相关资源
      最近更新 更多