<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Google 地圖事件 點擊標記縮放地圖 - 綁定在google地圖上的事件。 ## 點擊標記縮放地圖 我們仍然使用上一遍文章使用的英國倫敦的地圖。 點用戶點擊標記時實現縮放地圖的功能(點擊標記時綁定地圖縮放事件)。 代碼如下: ## 實例 ``` // Zoom to 9 when clicking on marker google.maps.event.addListener(marker,'click',function() { ? map.setZoom(9); ? map.setCenter(marker.getPosition()); ? }); ``` 使用 addListener() 事件處理程序來注冊事件的監聽。該方法使用一個對象,一個事件來監聽,當指定的事件發生時 函數將被調用。 ## 重置標記 我們通過給地圖添加事件處理程序來改變 'center' 屬性,以下代碼使用 center_changed 事件在3秒后標記移會中心點: ## 實例 ``` google.maps.event.addListener(map,'center_changed',function() { ? window.setTimeout(function() { ??? map.panTo(marker.getPosition()); ? },3000); }); ``` ## 點擊標記時打開信息窗口。 點擊標記在信息窗口顯示一些文本信息: ## 實例 ``` var infowindow = new google.maps.InfoWindow({ ? content:"Hello World!" ? }); google.maps.event.addListener(marker, 'click', function() { ? infowindow.open(map,marker); ? }); ``` ## 設置標記及打開每個標記的信息窗口 當用戶點擊地圖時執行一個窗口 用戶點擊地圖某個位置時使用 placeMarker() 函數在指定位置上放置一個標記,并彈出信息窗口: ## 實例 ``` google.maps.event.addListener(map, 'click', function(event) { ? placeMarker(event.latLng); ? }); function placeMarker(location) { ? var marker = new google.maps.Marker({ ??? position: location, ??? map: map, ? }); ? var infowindow = new google.maps.InfoWindow({ ??? content: 'Latitude: ' + location.lat() + ??? '<br>Longitude: ' + location.lng() ? }); ? infowindow.open(map,marker); } ``` ## Google 地圖 - 事件參考手冊 [Google Maps API 參考手冊](google-maps-ref.html)。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看