久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

          <bdo id='4ILhB'></bdo><ul id='4ILhB'></ul>
        <i id='4ILhB'><tr id='4ILhB'><dt id='4ILhB'><q id='4ILhB'><span id='4ILhB'><b id='4ILhB'><form id='4ILhB'><ins id='4ILhB'></ins><ul id='4ILhB'></ul><sub id='4ILhB'></sub></form><legend id='4ILhB'></legend><bdo id='4ILhB'><pre id='4ILhB'><center id='4ILhB'></center></pre></bdo></b><th id='4ILhB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4ILhB'><tfoot id='4ILhB'></tfoot><dl id='4ILhB'><fieldset id='4ILhB'></fieldset></dl></div>

        <legend id='4ILhB'><style id='4ILhB'><dir id='4ILhB'><q id='4ILhB'></q></dir></style></legend>

      1. <small id='4ILhB'></small><noframes id='4ILhB'>

      2. <tfoot id='4ILhB'></tfoot>

        重寫傳單事件

        Rewrite Leaflet event(重寫傳單事件)
        <legend id='kaXLF'><style id='kaXLF'><dir id='kaXLF'><q id='kaXLF'></q></dir></style></legend>
            • <i id='kaXLF'><tr id='kaXLF'><dt id='kaXLF'><q id='kaXLF'><span id='kaXLF'><b id='kaXLF'><form id='kaXLF'><ins id='kaXLF'></ins><ul id='kaXLF'></ul><sub id='kaXLF'></sub></form><legend id='kaXLF'></legend><bdo id='kaXLF'><pre id='kaXLF'><center id='kaXLF'></center></pre></bdo></b><th id='kaXLF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kaXLF'><tfoot id='kaXLF'></tfoot><dl id='kaXLF'><fieldset id='kaXLF'></fieldset></dl></div>
                <tbody id='kaXLF'></tbody>
                <bdo id='kaXLF'></bdo><ul id='kaXLF'></ul>

                  <small id='kaXLF'></small><noframes id='kaXLF'>

                  <tfoot id='kaXLF'></tfoot>
                  本文介紹了重寫傳單事件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我嘗試重寫boxzoom事件,像這樣,

                  I try to rewrite the boxzoom event, like this,

                  map.on('boxzoomend', function(e) {
                      console.log('end')
                  })
                  

                  但是,boxzoom 仍然縮放,我不知道如何停止它,只是在控制臺中打印文本.我希望將boxzoom重寫為如下

                  However, the boxzoom still zoomed and I have no idea how to stop it and just print text in console. I hope to rewrite boxzoom as the following

                  1. 停止縮放
                  2. 在控制臺中打印文本

                  你能提供重寫事件的正確方法嗎?謝謝.

                  Can you provide correct way to rewrite the event? Thank you.

                  推薦答案

                  縮放不是在 boxzoomend 事件中執行,而是在 BoxZoom 處理程序中執行.讓我引用 Leaflet 源代碼來自 src/map/handler/Map.BoxZoom.js:

                  The zooming is not performed in the boxzoomend event, but rather in the BoxZoom handler. Let me quote the Leaflet source code from src/map/handler/Map.BoxZoom.js:

                  _onMouseUp: function (e) {
                  
                      ...
                  
                      this._map
                          .fitBounds(bounds)
                          .fire('boxzoomend', {boxZoomBounds: bounds});
                  },
                  

                  實現所需功能的更好方法是創建一個擴展 BoxZoom 處理程序的新處理程序,修改您需要的方法.

                  A better way to achieve the functionality you want is to create a new handler that extends the BoxZoom handler, modifying the methods that you need.

                  我建議您閱讀 傳單教程,尤其是 在此之前創建 Leaflet 插件.

                  I recommend that you read the Leaflet tutorials, specially the ones on creating Leaflet plugins before doing this.

                  這個想法是擴展 BoxZoom 處理程序:

                  The idea is to extend the BoxZoom handler:

                  L.Map.BoxPrinter = L.Map.BoxZoom.extend({
                  

                  ...修改 _onMouseUp 方法...

                  ...modifying the _onMouseUp method...

                      _onMouseUp: function (e) {
                  

                  ...所以它不是縮放,而是打印東西:

                  ...so that instead of zooming, it just prints things:

                          ...
                          console.log(bounds);
                          this._map.fire('boxzoomend', {boxZoomBounds: bounds});
                     }
                  }
                  

                  正如教程所解釋的,掛鉤處理程序并為其提供一些地圖選項:

                  And as the tutorial explains, hook the handler and provide some map options for it:

                  L.Map.mergeOptions({boxPrinter: true});
                  L.Map.addInitHook('addHandler', 'boxPrinter', L.Map.BoxPrinter);
                  

                  當我們這樣做時,默認禁用所有地圖實例的默認 BoxZoom 處理程序:

                  While we're at it, disable the default BoxZoom handler for all map instances by default:

                  L.Map.mergeOptions({boxZoom: false});
                  

                  整個事情看起來像 這個工作示例.

                  這篇關于重寫傳單事件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標記群集圖標顏色,繼承其余默認 CSS 屬性)
                  Trigger click on leaflet marker(觸發點擊傳單標記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                    <tfoot id='RrwSx'></tfoot>
                        <tbody id='RrwSx'></tbody>

                        <i id='RrwSx'><tr id='RrwSx'><dt id='RrwSx'><q id='RrwSx'><span id='RrwSx'><b id='RrwSx'><form id='RrwSx'><ins id='RrwSx'></ins><ul id='RrwSx'></ul><sub id='RrwSx'></sub></form><legend id='RrwSx'></legend><bdo id='RrwSx'><pre id='RrwSx'><center id='RrwSx'></center></pre></bdo></b><th id='RrwSx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RrwSx'><tfoot id='RrwSx'></tfoot><dl id='RrwSx'><fieldset id='RrwSx'></fieldset></dl></div>

                        <legend id='RrwSx'><style id='RrwSx'><dir id='RrwSx'><q id='RrwSx'></q></dir></style></legend>

                          • <bdo id='RrwSx'></bdo><ul id='RrwSx'></ul>

                            <small id='RrwSx'></small><noframes id='RrwSx'>

                            主站蜘蛛池模板: 欧美日韩视频在线播放 | 国产日韩一区二区三区 | 久久99精品久久久久 | 中文字幕av色 | 精品国产亚洲一区二区三区大结局 | 日韩欧美视频免费在线观看 | 天天综合永久入口 | www成人免费| 亚洲黄色网址视频 | 国产福利资源在线 | 成人精品| 欧美国产一区二区 | 国产精品99久久久久久动医院 | 成人精品免费视频 | 久久精品99| 久久免费看 | 色999日韩| 精品国产一区二区国模嫣然 | 人人澡人人射 | 亚洲精品乱码久久久久久久久久 | 免费黄色片视频 | 欧美日韩在线一区二区 | 亚洲精品视频网站在线观看 | aaa天堂 | www.毛片| 日本天堂视频 | 国产成人免费网站 | 91在线电影| 国产区视频在线观看 | 国产精品亚洲一区 | 日批av| 国产高清在线精品 | 久久九 | 在线小视频 | 黑人精品xxx一区一二区 | 另类一区 | gogo肉体亚洲高清在线视 | 毛片免费视频 | 国产丝袜一区二区三区免费视频 | 欧美不卡一区二区 | 中文字幕国产 |