久久久久久久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'>

                            主站蜘蛛池模板: 欧美在线综合 | 国产视频一区在线 | 成人不卡 | 一a一片一级一片啪啪 | 亚洲协和影视 | 成人一区二区在线 | 国产福利视频网站 | 中文字幕av色 | 久久久久中文字幕 | 人人干人人艹 | 国产精品.xx视频.xxtv | 亚洲精品在线免费播放 | 国产1区在线 | 欧美一级www片免费观看 | 视频精品一区 | 国产精品综合久久 | 四虎最新| 日韩网站在线观看 | 婷婷二区 | 亚洲精品福利视频 | 久久国产精彩视频 | 亚洲狠狠 | 久久久999免费视频 999久久久久久久久6666 | 99久热| 81精品国产乱码久久久久久 | 午夜码电影 | 天堂在线中文 | 欧美在线看片 | 一区二区三区福利视频 | 一区二区三区欧美在线 | 97成人免费 | 国产黄色麻豆视频 | 在线观看三级av | 国产一区二区在线视频 | 国产精品久久久久久久久久 | 久久99国产精一区二区三区 | 亚洲精品一区二区三区中文字幕 | 三级国产三级在线 | 亚洲国产一区视频 | 精品亚洲视频在线 | 在线一区视频 |