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

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

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

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

        在傳單中設置圖層的縮放級別

        Setting zoom level for layers in leaflet(在傳單中設置圖層的縮放級別)

        1. <small id='KTX19'></small><noframes id='KTX19'>

              <tbody id='KTX19'></tbody>

            <i id='KTX19'><tr id='KTX19'><dt id='KTX19'><q id='KTX19'><span id='KTX19'><b id='KTX19'><form id='KTX19'><ins id='KTX19'></ins><ul id='KTX19'></ul><sub id='KTX19'></sub></form><legend id='KTX19'></legend><bdo id='KTX19'><pre id='KTX19'><center id='KTX19'></center></pre></bdo></b><th id='KTX19'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KTX19'><tfoot id='KTX19'></tfoot><dl id='KTX19'><fieldset id='KTX19'></fieldset></dl></div>
              <bdo id='KTX19'></bdo><ul id='KTX19'></ul>
                <tfoot id='KTX19'></tfoot>
              1. <legend id='KTX19'><style id='KTX19'><dir id='KTX19'><q id='KTX19'></q></dir></style></legend>
                • 本文介紹了在傳單中設置圖層的縮放級別的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  從這里繼續(xù)查詢:

                  解決方案

                  我找到了一個解決方案,我們可以用更短和更長(雖然更實用)的方式來解釋:

                  根據(jù)下面的例子:

                  https://gis.stackexchange.com/questions/258515/show-hide-markers-depending-on-zoom-level

                  我們可以這樣做:

                   map.on('zoomend', function() {if (map.getZoom() <6){map.removeLayer(job);//第一個 geoJSON 層}別的{map.addLayer(工作);}if (map.getZoom() <7){map.removeLayer(job2);//第二個geoJSON層}別的{map.addLayer(job2);}if (map.getZoom() <8){map.removeLayer(job3);//第三個geoJSON層}別的{map.addLayer(job3);}});

                  這對我們來說更好,不像較短的......

                   map.on('zoomend', function() {if (map.getZoom() <6){map.removeLayer(job);//第一個 geoJSON 層}if (map.getZoom() <8){map.removeLayer(job2);//第二個geoJSON層}if (map.getZoom() <10){map.removeLayer(job3);//第三個geoJSON層}別的 {map.addLayer(工作);map.addLayer(job2);map.addLayer(job3);}//所有圖層都被打開,當縮放級別達到10});

                  當縮放級別達到函數(shù)中給定的最大值時,可以將所有圖層切換回來.

                  Continuing the query from here:

                  https://gis.stackexchange.com/questions/340223/leaflet-making-features-gone-when-zoom-out

                  I would like to have some layers completely gone when zooming out.

                  I tried sth like this:

                   map.on('zoomend', function (e) {
                    zoom_based_layerchange();
                   });
                  
                   function clean_map() {
                   map.eachLayer(function (layer) {
                   if (layer instanceof L.GeoJSON)
                  {
                      map.removeLayer(layer);
                   }
                  //console.log(layer);
                   });
                   }
                  
                   function zoom_based_layerchange() {
                  //console.log(map.getZoom());
                  
                    var currentZoom = map.getZoom();
                     switch (currentZoom) {
                  case 8:     //refers to the zoom level: 8
                      clean_map();
                      sitis.addTo(map); //show "sitis" geoJSON layer
                      break;
                  case 12:
                      //clean_map(); - removed, as I don't need to remove the layer visible at lower zoom level
                      church.addTo(map);   //show "church" geoJSON layer
                      break;
                  default:
                      // do nothing
                      break;
                  

                  } }

                  but unfortunately it isn't a thing, which I am looking for, because once one layer disappear, another one is coming in. Eventually, the very top layer remain still visible when zooming out to level 1 as per the example here:

                  http://jsfiddle.net/expedio/kuovyw8m/

                  Because I would like to have layers gone as zoom out I tried sth like this:

                   map.on('zoomend', function () {
                     if (map.getZoom() < 10 {
                      map.removeLayer(sitec);
                     }
                     if (map.getZoom() < 12 {
                      map.removeLayer(test);
                     }
                     else {
                      map.addLayerGroup([sitec,test]);
                      }
                  });
                  

                  it doesn't work completely. COnsole says:

                  Uncaught SyntaxError: Unexpected token '{' which is a contradiction to the example here:

                  https://gis.stackexchange.com/questions/258515/show-hide-markers-depending-on-zoom-level

                  in other case I have:

                  Uncaught TypeError: sitec.removeFrom is not a function at i. ((index):174) at i.fire (leaflet.js:5) at i._moveEnd (leaflet.js:5) at i. (leaflet.js:5)

                  when type code like this:

                   map.on('zoomend', function () {
                   var z = map.getZoom();
                  
                   if (z > 12) {
                   return sitec.addTo(map);
                   }
                  
                   if (z > 14) {
                   return test.addTo(map);
                   }
                  
                   return sitec.removeFrom(map);
                   });
                  

                  as per the example here:

                  https://gis.stackexchange.com/questions/182657/zoom-dependent-layers-in-leaflet

                  Last thing which I tried was the plugin available here:

                  https://github.com/auto-mat/leaflet-zoom-show-hide/blob/master/demo.html

                  Where I put:

                      zsh = new ZoomShowHide();
                      zsh.addTo(map);
                      sitec.min_zoom = 9;
                      zsh.addLayer(sitec);
                      test.min_zoom = 11;
                      zsh.addLayer(test);
                  

                  but still wothiut result. The console says:

                  uncaught TypeError: layer.addTo is not a function -> from leaflet-zoom-hide 21 layer.addTo(this._layerGroup);

                  Does anyone know how to deal with it?

                  My code is available here:

                  解決方案

                  I found one of the solution, that we can explain by shorter and longer (although more practical) way:

                  According to the example below:

                  https://gis.stackexchange.com/questions/258515/show-hide-markers-depending-on-zoom-level

                  We can do sth like this:

                    map.on('zoomend', function() {
                    if (map.getZoom() <6){
                      map.removeLayer(job);//1st geoJSON layer
                     }else{
                    map.addLayer(job);
                     }
                      if (map.getZoom() <7){
                      map.removeLayer(job2); //2nd geoJSON layer
                      }else{
                      map.addLayer(job2);
                      }
                      if (map.getZoom() <8){
                      map.removeLayer(job3); //3rd geoJSON layer
                      }else{
                      map.addLayer(job3);
                      }
                    });
                  

                  which is better for us, unlike to shorter one...

                    map.on('zoomend', function() {
                      if (map.getZoom() <6){
                      map.removeLayer(job);//1st geoJSON layer
                     }
                     if (map.getZoom() <8){
                      map.removeLayer(job2);//2nd geoJSON layer
                     }
                     if (map.getZoom() <10){
                      map.removeLayer(job3);//3rd geoJSON layer
                     }
                     else {
                      map.addLayer(job);
                      map.addLayer(job2);
                      map.addLayer(job3);
                      } //all layers are to be switched on, when zoom level reach 10
                     });
                  

                  that can switch all layers back when zoom level reach max value given in the function.

                  這篇關于在傳單中設置圖層的縮放級別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(liá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è)邊欄)

                        <tfoot id='aSsLM'></tfoot>
                          <tbody id='aSsLM'></tbody>

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

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

                          • <bdo id='aSsLM'></bdo><ul id='aSsLM'></ul>
                            主站蜘蛛池模板: 黄色免费网站在线看 | 欧美综合国产精品久久丁香 | 91九色视频在线 | 日韩午夜精品 | 罗宾被扒开腿做同人网站 | 亚洲国产aⅴ成人精品无吗 国产精品永久在线观看 | 亚洲 中文 欧美 日韩 在线观看 | 日韩在线中文字幕 | 91在线视频网址 | 国产精品自拍视频网站 | 日韩一区二区免费视频 | 亚洲码欧美码一区二区三区 | 黄色成人在线观看 | 亚洲一区亚洲二区 | av中文字幕在线 | 欧美一区二区三区在线免费观看 | 麻豆久久久久久久久久 | 国产黄色av网站 | 色资源在线观看 | 日韩av在线中文字幕 | 草久久久| 精品成人av | 99这里只有精品 | 美女张开腿露出尿口 | 在线观看国产网站 | 久久久久久久久淑女av国产精品 | 欧美一卡二卡在线 | 成人免费一区二区三区视频网站 | 久久99精品久久久久久国产越南 | 97精品超碰一区二区三区 | 欧美午夜精品久久久久久浪潮 | 欧美日韩国产一区二区三区 | a级在线免费视频 | 美女视频黄色的 | 香蕉视频1024 | 天天干夜夜拍 | 麻豆久久久9性大片 | 成人av一区二区亚洲精 | 91av视频在线观看 | 久久成人一区二区三区 | 免费国产视频在线观看 |