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

        在傳單中設(shè)置圖層的縮放級別

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

        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>
                • 本文介紹了在傳單中設(shè)置圖層的縮放級別的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  從這里繼續(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);}//所有圖層都被打開,當(dāng)縮放級別達到10});

                  當(dāng)縮放級別達到函數(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.

                  這篇關(guān)于在傳單中設(shè)置圖層的縮放級別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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(更改傳單標(biāo)記群集圖標(biāo)顏色,繼承其余默認(rèn) CSS 屬性)
                  Trigger click on leaflet marker(觸發(fā)點擊傳單標(biāo)記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認(rèn)加載磁貼顏色?)
                  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>
                            主站蜘蛛池模板: 男女羞羞视频在线免费观看 | 亚洲成人福利视频 | 成人在线一区二区三区 | 亚洲一二三区免费 | 日本视频一区二区三区 | 欧美日韩午夜精品 | www.亚洲| 欧美99久久精品乱码影视 | 国产精品欧美一区二区三区 | 精品毛片| 中文字幕 在线观看 | 激情五月综合 | 中文字幕日本一区二区 | 久久久久91 | 亚洲综合大片69999 | 国产欧美日韩精品在线观看 | 中文字幕国产精品视频 | www..com18午夜观看 | 国产伦精品一区二区三区视频金莲 | 国产精品1区2区3区 国产在线观看一区 | 日本午夜在线视频 | 久草中文在线 | 亚洲日本一区二区三区四区 | 日韩一二三区 | 亚洲欧美日本在线 | 操久久| 日韩在线小视频 | 国产成人91| 欧美国产视频 | 蜜臀久久 | 成人午夜免费福利视频 | 成人不卡 | 欧美国产一区二区 | 日韩一区二区三区av | 一级h片| 成人精品鲁一区一区二区 | 午夜精品在线观看 | 欧美极品少妇xxxxⅹ免费视频 | 超碰在线人人干 | 国产视频久久久 | 久久久久国产精品午夜一区 |