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

      <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="qwawimqqmiuu" 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 兩次導(dǎo)致第二次被忽略

      Why does calling leaflet#39;s setZoom twice results on the second being ignored?(為什么調(diào)用傳單的 setZoom 兩次導(dǎo)致第二次被忽略?)
      <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="qwawimqqmiuu" id='FIPEA'><tfoot id='FIPEA'></tfoot><dl id='FIPEA'><fieldset id='FIPEA'></fieldset></dl></div>
                本文介紹了為什么調(diào)用傳單的 setZoom 兩次導(dǎo)致第二次被忽略?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                要重現(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 兩次導(dǎo)致第二次被忽略?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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="qwawimqqmiuu" id='zloij'><tfoot id='zloij'></tfoot><dl id='zloij'><fieldset id='zloij'></fieldset></dl></div>
                        <tfoot id='zloij'></tfoot>
                          <tbody id='zloij'></tbody>

                          主站蜘蛛池模板: 91免费观看在线 | 亚洲高清在线 | 免费观看成人鲁鲁鲁鲁鲁视频 | 一区二区三区亚洲 | 国产一级一级毛片 | 亚洲第一天堂 | 久久久成人精品 | 久久精品视频免费观看 | 成年男女免费视频网站 | 欧美日韩一区二区视频在线观看 | 羞羞网站在线观看 | 国产成人精品一区二区三区在线 | 日日摸夜夜添夜夜添特色大片 | 九九一级片 | 国产一区二区欧美 | 亚洲一区二区三区四区五区中文 | 毛片网站免费观看 | 国产中文字幕在线观看 | 日本在线精品视频 | 罗宾被扒开腿做同人网站 | 天天干狠狠操 | 国产精品视频一区二区三区不卡 | 狠狠综合久久av一区二区小说 | 日本一区二区高清视频 | 日韩毛片免费看 | 黑人精品欧美一区二区蜜桃 | 欧美一级在线 | 欧产日产国产精品99 | 国产女人第一次做爰毛片 | 久久国产精品-久久精品 | 久久tv在线观看 | 欧美在线观看一区二区 | 99久久精品免费看国产小宝寻花 | 成人在线免费观看 | 在线国产小视频 | 日韩精品一区二区三区免费视频 | 黄色免费在线网址 | 成年人视频在线免费观看 | 国产99免费视频 | 成人特区| 国产成人精品在线 |