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

  • <small id='5eASh'></small><noframes id='5eASh'>

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

      1. <legend id='5eASh'><style id='5eASh'><dir id='5eASh'><q id='5eASh'></q></dir></style></legend>

      2. 傳單在按鈕單擊時(shí)打開特定標(biāo)記彈出窗口

        leaflet open specific marker popup on button click(傳單在按鈕單擊時(shí)打開特定標(biāo)記彈出窗口)

          • <bdo id='on9Mq'></bdo><ul id='on9Mq'></ul>
              <tbody id='on9Mq'></tbody>

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

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

                • 本文介紹了傳單在按鈕單擊時(shí)打開特定標(biāo)記彈出窗口的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試在某些事件(例如,按鈕單擊)上打開特定標(biāo)記的彈出窗口.為此,我將 id 屬性添加到標(biāo)記并將所有標(biāo)記存儲(chǔ)在數(shù)組中.但是由于某種原因,當(dāng)我嘗試訪問數(shù)組內(nèi)的標(biāo)記的 id 屬性時(shí),它是未定義的.

                  I'm trying to open a specific marker's popup on some event(say, button click). In order to do so I add an id property to a marker and store all markers in an array. But for some reason, the id property of a marker inside of an array is undefined when I try to access it.

                  var map = L.map('map').setView([51.505, -0.09], 13);
                  var markers = [];
                  var marker = L.marker([51.5, -0.09]);
                  marker["id"]="0";
                  marker.bindPopup('!');
                  marker.addTo(map);
                  markers.push(marker);
                  
                  openPopupById("0");
                  
                  function openPopupById(id) {
                      for(var marker in markers) {
                          alert("Marker's id " + marker["id"] + " target id " + id );
                          if (marker["id"] === id) {
                              //marker.openPopup();
                              alert("opening " + id);
                          }
                      }
                      alert(id);
                  }
                  

                  更新好的,我找到了解決方案:我應(yīng)該將 for 替換為

                  UPDATE Ok, I found the solution: I should replace for with

                  for(var i = 0; i < markers.length; ++i)
                  

                  并以 markers[i]["id"]

                  但是誰(shuí)能解釋一下為什么第一個(gè)版本不起作用?

                  But can someone explain me why the first version doesn't work?

                  推薦答案

                  我認(rèn)為你的錯(cuò)誤是使用push(在markers.push(marker)中)

                  I think your mistake is the use of push (in markers.push(marker))

                  要存儲(chǔ)標(biāo)記,您應(yīng)該使用

                  To store the markers, you should use

                  markers["id"] = marker;
                  

                  你可以這樣打開你的彈出窗口

                  You can open your popup like that

                  markers["id"].openPopup();
                  

                  讓標(biāo)記知道他們的 id

                  For the markers to know their id

                  marker.id = "id";
                  

                  這篇關(guān)于傳單在按鈕單擊時(shí)打開特定標(biāo)記彈出窗口的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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è)邊欄)
                  <i id='yPKIO'><tr id='yPKIO'><dt id='yPKIO'><q id='yPKIO'><span id='yPKIO'><b id='yPKIO'><form id='yPKIO'><ins id='yPKIO'></ins><ul id='yPKIO'></ul><sub id='yPKIO'></sub></form><legend id='yPKIO'></legend><bdo id='yPKIO'><pre id='yPKIO'><center id='yPKIO'></center></pre></bdo></b><th id='yPKIO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yPKIO'><tfoot id='yPKIO'></tfoot><dl id='yPKIO'><fieldset id='yPKIO'></fieldset></dl></div>

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

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

                          <tbody id='yPKIO'></tbody>

                        <tfoot id='yPKIO'></tfoot>
                            <legend id='yPKIO'><style id='yPKIO'><dir id='yPKIO'><q id='yPKIO'></q></dir></style></legend>
                            主站蜘蛛池模板: 亚洲欧洲视频 | 成人亚洲精品久久久久软件 | 国产精品毛片一区二区在线看 | 免费看一区二区三区 | 国产在线精品一区二区 | 欧美精品黄 | 日韩欧美手机在线 | 亚洲精品一区久久久久久 | 伊人网站| 亚洲人成在线播放 | 91精品福利 | 毛片在线免费 | 精品一区国产 | 久久久国产一区二区 | 在线一区二区三区 | 亚洲一区二区三区免费在线观看 | 亚洲人成在线播放 | 日韩精品一二三 | 国产精品福利网 | 91视频精选 | 国产精品永久免费 | 国产精品久久久久久久久久妇女 | 99精品网 | 日韩成人av在线 | 五月天婷婷综合 | 亚洲精品自在在线观看 | 欧美在线视频一区 | 一二区成人影院电影网 | 国产美女久久久 | 久久久久综合 | 久久人爽| 日韩在线视频观看 | 国产精品久久一区二区三区 | 久久精品国产一区 | 成人精品一区二区三区中文字幕 | 欧美一区二区成人 | 中文字幕97 | 一区二区三区国产视频 | 亚洲欧美一区二区三区国产精品 | 婷婷色国产偷v国产偷v小说 | 国产福利久久 |