久久久久久久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. 傳單在按鈕單擊時打開特定標記彈出窗口

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

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

                • 本文介紹了傳單在按鈕單擊時打開特定標記彈出窗口的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

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

                  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);
                  }
                  

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

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

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

                  并以 markers[i]["id"]

                  但是誰能解釋一下為什么第一個版本不起作用?

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

                  推薦答案

                  我認為你的錯誤是使用push(在markers.push(marker)中)

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

                  要存儲標記,您應該使用

                  To store the markers, you should use

                  markers["id"] = marker;
                  

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

                  You can open your popup like that

                  markers["id"].openPopup();
                  

                  讓標記知道他們的 id

                  For the markers to know their id

                  marker.id = "id";
                  

                  這篇關于傳單在按鈕單擊時打開特定標記彈出窗口的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標記群集圖標顏色,繼承其余默認 CSS 屬性)
                  Trigger click on leaflet marker(觸發點擊傳單標記)
                  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 圖層控件添加到側邊欄)
                  <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>
                            主站蜘蛛池模板: 成人欧美一区二区三区在线播放 | 亚洲精品免费视频 | 久久看精品| 中文字幕日韩欧美一区二区三区 | 永久av| www.亚洲一区二区 | 永久看片| 高清人人天天夜夜曰狠狠狠狠 | 国产精品视频网 | 91大神在线资源观看无广告 | 亚洲黄色av | 久久一| 观看av| 亚洲高清在线 | 人人干人人干人人干 | 一区二区三区不卡视频 | 69福利影院 | 午夜视频在线观看网址 | 乱一性一乱一交一视频a∨ 色爱av | 麻豆changesxxx国产 | 日日操操 | 国产精品黄色 | 亚洲欧美另类在线观看 | 天天干狠狠 | 国产精品久久久久久久白浊 | 国产农村妇女毛片精品久久麻豆 | av乱码 | 成人在线观看免费视频 | 手机看片1 | 国产福利免费视频 | 黄色免费观看网站 | 黄色在线播放视频 | 一区二区三区中文字幕 | 国产免费一区二区 | 午夜激情在线视频 | 日日摸天天添天天添破 | av一级久久 | 中文字幕成人av | 国产乱码精品一区二区三区忘忧草 | 伊色综合久久之综合久久 | 午夜精品一区二区三区在线观看 |