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

    <tfoot id='4SBeo'></tfoot>

        <bdo id='4SBeo'></bdo><ul id='4SBeo'></ul>

    1. <small id='4SBeo'></small><noframes id='4SBeo'>

      <legend id='4SBeo'><style id='4SBeo'><dir id='4SBeo'><q id='4SBeo'></q></dir></style></legend>
      <i id='4SBeo'><tr id='4SBeo'><dt id='4SBeo'><q id='4SBeo'><span id='4SBeo'><b id='4SBeo'><form id='4SBeo'><ins id='4SBeo'></ins><ul id='4SBeo'></ul><sub id='4SBeo'></sub></form><legend id='4SBeo'></legend><bdo id='4SBeo'><pre id='4SBeo'><center id='4SBeo'></center></pre></bdo></b><th id='4SBeo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4SBeo'><tfoot id='4SBeo'></tfoot><dl id='4SBeo'><fieldset id='4SBeo'></fieldset></dl></div>
      1. 從 Leaflet.js 地圖添加/刪除 L.control

        Adding/removing L.control from leaflet.js map(從 Leaflet.js 地圖添加/刪除 L.control)

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

        2. <tfoot id='ys6Gj'></tfoot>
          • <bdo id='ys6Gj'></bdo><ul id='ys6Gj'></ul>

                <tbody id='ys6Gj'></tbody>
              <legend id='ys6Gj'><style id='ys6Gj'><dir id='ys6Gj'><q id='ys6Gj'></q></dir></style></legend>
                1. <small id='ys6Gj'></small><noframes id='ys6Gj'>

                2. 本文介紹了從 Leaflet.js 地圖添加/刪除 L.control的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我有一張基于四個(gè)單選按鈕更改圖塊的地圖.我需要在您滾動(dòng)圖塊時(shí)出現(xiàn)的彈出窗口,以便隨著不同地圖圖層的變化而變化.我已經(jīng)讓它出現(xiàn)了,但是當(dāng)我切換圖層時(shí),地圖只會(huì)添加另一個(gè)彈出窗口.我嘗試使用 control.removeFrom(map) 但它似乎不起作用.我想我的邏輯可能在某個(gè)地方搞砸了.這是 if 語(yǔ)句之一:

                  I have a map that changes tiles based on four radio buttons. I need the popup window that appears when you roll over a tile to change as the different map layers change. I've gotten it to appear but when I switch layers the map just adds another popup window. I tried using control.removeFrom(map) but it doesn't seem to work. I think my logic may be screwed up somewhere. Here is one of the if statements:

                  if (two == true && black == true) { 
                                  function blkNineStyle(feature) {
                                      return {
                                      fillColor: getColor(feature.properties.pctBlack9000),
                                      weight: 2,
                                      opacity: 1,
                                      color: '#666',
                                      dashArray: '2',
                                      fillOpacity: 0.9
                                      };
                                  }
                                                      //Tried to us this to take off the control.
                                  info.removeFrom(map);
                                  map.removeLayer(geojson);
                                  geojson = L.geoJson(tracts, {style: blkNineStyle, onEachFeature: onEachFeature}).addTo(map);
                  
                                  var info = L.control();
                  
                                  info.onAdd = function (map) {
                                      this._div = L.DomUtil.create('div', 'info');
                                      this.update();
                                      return this._div;
                                  };
                  
                                  info.update = function (props) {
                                      this._div.innerHTML = '<h4>Percent White population change</h4>' + (props ? '<b>' + props.name + '</b><br />' + props.pctBlack9000 + '%' : 'Hover over a tract');
                                  };
                  
                                  info.addTo(map);
                              }
                  

                  您可以在這里查看(損壞的)地圖.

                  推薦答案

                  我自己也遇到了同樣的問(wèn)題,我剛剛解決了.

                  I had this same problem myself and I just solved it.

                  我必須在全局環(huán)境中定義一個(gè)空變量(在您使用的任何函數(shù)之外).這不是一個(gè)完整的腳本或任何東西,但我描述的總體思路如下:

                  I had to define an empty variable in the global environment (outside any functions you're using). This isn't a full script or anything, but the general idea I'm describing is below:

                      var info;  // CREATING INFO VARIABLE IN GLOBAL ENVIRONMENT
                      function makeMap() {
                      ..... geojsons, styles, other stuff ....
                  
                      // REMOVING PREVIOUS INFO BOX
                      if (info != undefined) {
                      info.removeFrom(map)
                      }
                  
                      // making current layer's info box
                      info = L.control();
                  
                      info.onAdd = function (map) {
                      this._div = L.DomUtil.create('div', 'info');
                      this.update();
                      return this._div;
                      };
                  
                      info.update = function (props) {
                      this._div.innerHTML = '<h4>Data by Zip Code</h4>' + (props ?
                      '<b>Zip Code:  ' + props.id + '</b><br />Value:  ' + matchKey(props.id, meanById)
                      : 'Hover over a zip code');
                      };
                  
                      info.addTo(map);
                  
                      ..... other stuff again ......
                  
                      } // end function
                  

                  我對(duì) Leaflet 和 javascript 都很陌生,所以我不得不說(shuō)我不確定在您提供的地圖鏈接上發(fā)布的代碼中的 info.removeFrom(map) 行的位置,但是您與 'info.removeFrom(map)' 走在正確的軌道上.

                  I am very new to both Leaflet and javascript, so I have to say that I'm not exactly sure where to place the info.removeFrom(map) line in the code you have posted at the map link you provided, but you are on the right track with 'info.removeFrom(map)' .

                  我能夠通過(guò)在這里擺弄?jiǎng)討B(tài)圖例和信息框來(lái)解決我的問(wèn)題:http://jsfiddle.net/opensas/TnX96/

                  I was able to problem-solve my issue with dynamic legends and info boxes by fiddling around here: http://jsfiddle.net/opensas/TnX96/

                  這篇關(guān)于從 Leaflet.js 地圖添加/刪除 L.control的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個(gè)多邊形點(diǎn)是否在傳單中的另一個(gè)內(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ā)點(diǎn)擊傳單標(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è)邊欄)

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

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

                          <tbody id='aBQli'></tbody>

                          • <bdo id='aBQli'></bdo><ul id='aBQli'></ul>

                            主站蜘蛛池模板: av手机在线免费观看 | 国产毛片在线看 | 亚洲欧美一区在线 | 精品国产亚洲一区二区三区大结局 | 在线视频中文字幕 | 99爱视频 | 高清国产一区二区 | a黄在线观看 | 国产在线高清 | 成年视频在线观看福利资源 | 成人影院在线视频 | 91久久久久久 | 日本欧美大片 | 亚洲精品乱码久久久久久按摩观 | 一级片免费在线观看 | 国产乱码精品一区二区三区中文 | 国产日韩精品在线 | 久久91av | www久久国产| 一区二区三区小视频 | 天天综合久久 | 国产精品日产欧美久久久久 | 欧美另类日韩 | 国产日韩欧美一区二区 | 久久久噜噜噜www成人网 | 国产伦精品一区二区三区四区视频 | 一级做a爰片性色毛片视频停止 | 成人免费毛片片v | 日一日操一操 | 久久久区 | 一级女毛片 | 精品成人免费一区二区在线播放 | 台湾佬久久 | 一区二区三区欧美在线 | 国产精品一区二区在线 | 国产精品视频yy9299一区 | 日韩精品视频在线观看一区二区三区 | 国产美女在线观看 | 成人久久久 | 一区二区三区四区在线免费观看 | 国产视频久久久久 |