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

      <bdo id='9G2IS'></bdo><ul id='9G2IS'></ul>
    <tfoot id='9G2IS'></tfoot>
    <legend id='9G2IS'><style id='9G2IS'><dir id='9G2IS'><q id='9G2IS'></q></dir></style></legend>
  1. <i id='9G2IS'><tr id='9G2IS'><dt id='9G2IS'><q id='9G2IS'><span id='9G2IS'><b id='9G2IS'><form id='9G2IS'><ins id='9G2IS'></ins><ul id='9G2IS'></ul><sub id='9G2IS'></sub></form><legend id='9G2IS'></legend><bdo id='9G2IS'><pre id='9G2IS'><center id='9G2IS'></center></pre></bdo></b><th id='9G2IS'></th></span></q></dt></tr></i><div class="2g2u2c2" id='9G2IS'><tfoot id='9G2IS'></tfoot><dl id='9G2IS'><fieldset id='9G2IS'></fieldset></dl></div>

      <small id='9G2IS'></small><noframes id='9G2IS'>

    1. 為什么調(diào)用傳單的 setZoom 兩次導致第二次被忽略

      Why does calling leaflet#39;s setZoom twice results on the second being ignored?(為什么調(diào)用傳單的 setZoom 兩次導致第二次被忽略?)
      <tfoot id='FIPEA'></tfoot>

        <bdo id='FIPEA'></bdo><ul id='FIPEA'></ul>

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

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

                  <tbody id='FIPEA'></tbody>

                <i id='FIPEA'><tr id='FIPEA'><dt id='FIPEA'><q id='FIPEA'><span id='FIPEA'><b id='FIPEA'><form id='FIPEA'><ins id='FIPEA'></ins><ul id='FIPEA'></ul><sub id='FIPEA'></sub></form><legend id='FIPEA'></legend><bdo id='FIPEA'><pre id='FIPEA'><center id='FIPEA'></center></pre></bdo></b><th id='FIPEA'></th></span></q></dt></tr></i><div class="sssis2s" id='FIPEA'><tfoot id='FIPEA'></tfoot><dl id='FIPEA'><fieldset id='FIPEA'></fieldset></dl></div>
                本文介紹了為什么調(diào)用傳單的 setZoom 兩次導致第二次被忽略?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                要重現(xiàn)此問題,您可以轉(zhuǎn)到 http://leafletjs.com/ 并在 javascript 控制臺中,寫下:

                To reproduce this problem, you can go to http://leafletjs.com/ and in the javascript console, write the following:

                > map.getZoom()
                15
                > map.setZoom(10);map.setZoom(1);
                Object
                > map.getZoom()
                10
                

                我期待最終的 getZoom 返回 1.為什么會這樣?該問題可能與縮放動畫有關(guān).如果在動畫結(jié)束之前調(diào)用了 setZoom,它將被忽略.

                I was expecting the final getZoom to return 1. Why does this happen? The problem may be related with the zoom animation. If a setZoom is called before the animation ends, it gets ignored.

                我正在將傳單與 emberjs 集成,并希望允許通過外部更改進行縮放更改.如果用戶快速更改縮放,則效果不理想.

                I'm integrating leaflet with emberjs and wanted to allow zoom changes by external changes. If the user changes zoom quickly, the effect isn't the desired.

                推薦答案

                <代碼>L.Map.setZoom 稱為 L.Map.setView 調(diào)用 L.Map._animateZoomIfClose.如果 map._animatingZoom 為真,那么任何縮放都將停止.map._animatingZoom 像尋找縮放動畫一樣工作:

                L.Map.setZoom called L.Map.setView that called L.Map._animateZoomIfClose. If map._animatingZoom is true then any zoom will stop. map._animatingZoom work like look for zoom animation:

                1. 查看 L.Map._animateZoomIfClose 如果 true 停止縮放,否則調(diào)用 L.Map._animateZoom.
                2. 在 處設(shè)置為 trueL.Map._animateZoom 并開始 css 過渡.
                3. 在 處設(shè)置為 falseL.Map._onZoomTransitionEnd 在 css 過渡結(jié)束時.
                1. Check at L.Map._animateZoomIfClose if true stop zoom else call L.Map._animateZoom.
                2. Set to true at L.Map._animateZoom and start css transition.
                3. Set to false at L.Map._onZoomTransitionEnd on css transition end.

                為什么是這樣?我認為是因為很難打破 css 過渡工作.

                Why it's as is? I think because it's difficult break css transition work.

                因此,如果您要禁用任何 css 轉(zhuǎn)換和轉(zhuǎn)換,您的代碼必須能夠正常工作.您還可以添加自己的擴展:如果 map._animatingZoom === true 然后將您的操作放入數(shù)組,當 map._catchTransitionEnd 調(diào)用時處理此操作并將您的操作從數(shù)組和進程:

                So if you will disable any css transform and transition your code must work right. You also can add own extension: if map._animatingZoom === true then put your action to array, when map._catchTransitionEnd called process this and shift your action from array and process:

                if (L.DomUtil.TRANSITION) {
                    L.Map.addInitHook(function () {
                        L.DomEvent.on(this._mapPane, L.DomUtil.TRANSITION_END, function () {
                            var zoom = this._zoomActions.shift();
                            if (zoom !== undefined) {
                                this.setZoom(zoom);
                            }
                        }, this);
                    });
                }
                
                L.Map.include(!L.DomUtil.TRANSITION ? {} : {
                    _zoomActions: [],
                    queueZoom: function (zoom) {
                        if (map._animatingZoom) {
                            this._zoomActions.push(zoom);
                        } else {
                            this.setZoom(zoom);
                        }
                    }
                });
                

                這篇關(guān)于為什么調(diào)用傳單的 setZoom 兩次導致第二次被忽略?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內(nèi)部)
                Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標記群集圖標顏色,繼承其余默認 CSS 屬性)
                Trigger click on leaflet marker(觸發(fā)點擊傳單標記)
                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 圖層控件添加到側(cè)邊欄)
                1. <small id='zloij'></small><noframes id='zloij'>

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

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

                          主站蜘蛛池模板: 船用泵,船用离心泵,船用喷射泵,泰州隆华船舶设备有限公司 | 广州小程序开发_APP开发公司_分销商城系统定制_小跑科技 | 二维运动混料机,加热型混料机,干粉混料机-南京腾阳干燥设备厂 | 查分易-成绩发送平台官网 | 山东集装箱活动房|济南集装箱活动房-济南利森集装箱有限公司 | 杭州顺源过滤机械有限公司官网-压滤机_板框压滤机_厢式隔膜压滤机厂家 | 范秘书_懂你的范文小秘书 | 哈尔滨发电机,黑龙江柴油发电机组-北方星光 | KBX-220倾斜开关|KBW-220P/L跑偏开关|拉绳开关|DHJY-I隔爆打滑开关|溜槽堵塞开关|欠速开关|声光报警器-山东卓信有限公司 | 滤芯,过滤器,滤油机,贺德克滤芯,精密滤芯_新乡市宇清流体净化技术有限公司 | 培训中心-海南香蕉蛋糕加盟店技术翰香原中心官网总部 | 全自动端子机|刺破式端子压接机|全自动双头沾锡机|全自动插胶壳端子机-东莞市傅氏兄弟机械设备有限公司 | 超声波分散机-均质机-萃取仪-超声波涂料分散设备-杭州精浩 | 活性炭-果壳木质煤质柱状粉状蜂窝活性炭厂家价格多少钱 | 玻璃瓶厂家_酱菜瓶厂家_饮料瓶厂家_酒瓶厂家_玻璃杯厂家_徐州东明玻璃制品有限公司 | 国资灵活用工平台_全国灵活用工平台前十名-灵活用工结算小帮手 | 浴室柜-浴室镜厂家-YINAISI · 意大利设计师品牌 | 咿耐斯 |-浙江台州市丰源卫浴有限公司 | 胶泥瓷砖胶,轻质粉刷石膏,嵌缝石膏厂家,腻子粉批发,永康家德兴,永康市家德兴建材厂 | 青州搬家公司电话_青州搬家公司哪家好「鸿喜」青州搬家 | 气动调节阀,电动调节阀,自力式压力调节阀,切断阀「厂家」-浙江利沃夫自控阀门 | 档案密集柜_手动密集柜_智能密集柜_内蒙古档案密集柜-盛隆柜业内蒙古密集柜直销中心 | PO膜_灌浆膜及地膜供应厂家 - 青州市鲁谊塑料厂 | 北京征地律师,征地拆迁律师,专业拆迁律师,北京拆迁律师,征地纠纷律师,征地诉讼律师,征地拆迁补偿,拆迁律师 - 北京凯诺律师事务所 | 紧急切断阀_气动切断阀_不锈钢阀门_截止阀_球阀_蝶阀_闸阀-上海上兆阀门制造有限公司 | 福州仿石漆加盟_福建仿石漆厂家-外墙仿石漆加盟推荐铁壁金钢(福建)新材料科技有限公司有保障 | 国际学校_国际学校哪个好_国际课程学校-国际学校择校网 | 健康管理师报名入口,2025年健康管理师考试时间信息网-网站首页 塑料造粒机「厂家直销」-莱州鑫瑞迪机械有限公司 | 全自动包衣机-无菌分装隔离器-浙江迦南科技股份有限公司 | 单螺旋速冻机-双螺旋-流态化-隧道式-食品速冻机厂家-广州冰泉制冷 | 闪蒸干燥机-喷雾干燥机-带式干燥机-桨叶干燥机-[常州佳一干燥设备] | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 螺旋丝杆升降机-SWL蜗轮-滚珠丝杆升降机厂家-山东明泰传动机械有限公司 | 背压阀|减压器|不锈钢减压器|减压阀|卫生级背压阀|单向阀|背压阀厂家-上海沃原自控阀门有限公司 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 | 珠海冷却塔降噪维修_冷却塔改造报价_凉水塔风机维修厂家- 广东康明节能空调有限公司 | 全自动实验室洗瓶机,移液管|培养皿|进样瓶清洗机,清洗剂-广州摩特伟希尔机械设备有限责任公司 | 厚壁钢管-厚壁无缝钢管-小口径厚壁钢管-大口径厚壁钢管 - 聊城宽达钢管有限公司 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 尾轮组_头轮组_矿用刮板_厢式刮板机_铸石刮板机厂家-双驰机械 | 首页-浙江橙树网络技术有限公司 石磨面粉机|石磨面粉机械|石磨面粉机组|石磨面粉成套设备-河南成立粮油机械有限公司 | 泥浆在线密度计厂家-防爆数字压力表-膜盒-远传压力表厂家-江苏大亚自控设备有限公司 | 厂房出租-厂房规划-食品技术-厂房设计-厂房装修-建筑施工-设备供应-设备求购-龙爪豆食品行业平台 |