pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

          <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="yo0k82w" 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="kaqm2wk" 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="iwce2u2" 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'>

                            主站蜘蛛池模板: 等离子空气净化器_医用空气消毒机_空气净化消毒机_中央家用新风系统厂家_利安达官网 | 等离子空气净化器_医用空气消毒机_空气净化消毒机_中央家用新风系统厂家_利安达官网 | 不锈钢拉手厂家|浴室门拉手厂家|江门市蓬江区金志翔五金制品有限公司 | 杜康白酒加盟_杜康酒代理_杜康酒招商加盟官网_杜康酒厂加盟总代理—杜康酒神全国运营中心 | 酒店品牌设计-酒店vi设计-酒店标识设计【国际级】VI策划公司 | 水厂污泥地磅|污泥处理地磅厂家|地磅无人值守称重系统升级改造|地磅自动称重系统维修-河南成辉电子科技有限公司 | 成都LED显示屏丨室内户外全彩led屏厂家方案报价_四川诺显科技 | 刹车盘机床-刹车盘生产线-龙口亨嘉智能装备| 上海道勤塑化有限公司 | 北京开源多邦科技发展有限公司官网 | 机房监控|动环监控|动力环境监控系统方案产品定制厂家 - 迈世OMARA | 山东柳店新能源科技有限公司| 深圳彩钢板_彩钢瓦_岩棉板_夹芯板_防火复合彩钢板_长鑫 | 广东西屋电气有限公司-广东西屋电气有限公司 | 北京西风东韵品牌与包装设计公司,创造视觉销售力! | 手机存放柜,超市储物柜,电子储物柜,自动寄存柜,行李寄存柜,自动存包柜,条码存包柜-上海天琪实业有限公司 | 学习安徽网| 悬浮拼装地板_幼儿园_篮球场_悬浮拼接地板-山东悬浮拼装地板厂家 | 代理记账_免费注册公司_营业执照代办_资质代办-【乐财汇】 | 汽车水泵_汽车水泵厂家-瑞安市骏迪汽车配件有限公司 | 2025第九届世界无人机大会 | 不锈钢螺丝 - 六角螺丝厂家 - 不锈钢紧固件 - 万千紧固件--紧固件一站式采购 | 柔性输送线|柔性链板|齿形链-上海赫勒输送设备有限公司首页[输送机] | TPE_TPE热塑性弹性体_TPE原料价格_TPE材料厂家-惠州市中塑王塑胶制品公司- 中塑王塑胶制品有限公司 | MVR蒸发器厂家-多效蒸发器-工业废水蒸发器厂家-康景辉集团官网 | 基业箱_环网柜_配电柜厂家_开关柜厂家_开关断路器-东莞基业电气设备有限公司 | 壹作文_中小学生优秀满分作文大全 | 播音主持培训-中影人教育播音主持学苑「官网」-中国艺考界的贵族学校 | 首页|专注深圳注册公司,代理记账报税,注册商标代理,工商变更,企业400电话等企业一站式服务-慧用心 | [品牌官网]贵州遵义双宁口腔连锁_贵州遵义牙科医院哪家好_种植牙_牙齿矫正_原华美口腔 | 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 交变/复合盐雾试验箱-高低温冲击试验箱_安奈设备产品供应杭州/江苏南京/安徽马鞍山合肥等全国各地 | 在线浊度仪_悬浮物污泥浓度计_超声波泥位计_污泥界面仪_泥水界面仪-无锡蓝拓仪表科技有限公司 | 影合社-影视人的内容合作平台 | 上海深蓝_缠绕机_缠膜机-上海深蓝机械装备有限公司 | Trimos测长机_测高仪_TESA_mahr,WYLER水平仪,PWB对刀仪-德瑞华测量技术(苏州)有限公司 | 驾驶人在线_专业学车门户网站 | 合肥活动房_安徽活动板房_集成打包箱房厂家-安徽玉强钢结构集成房屋有限公司 | 新能源汽车电池软连接,铜铝复合膜柔性连接,电力母排-容发智能科技(无锡)有限公司 | GEDORE扭力螺丝刀-GORDON防静电刷-CHEMTRONICS吸锡线-上海卓君电子有限公司 | elisa试剂盒价格-酶联免疫试剂盒-猪elisa试剂盒-上海恒远生物科技有限公司 |