pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="ft17hl7" 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="fvxf7d5" id='on9Mq'><tfoot id='on9Mq'></tfoot><dl id='on9Mq'><fieldset id='on9Mq'></fieldset></dl></div>

                • 本文介紹了傳單在按鈕單擊時(shí)打開特定標(biāo)記彈出窗口的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(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"]

                  但是誰能解釋一下為什么第一個(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)記彈出窗口的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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(檢查一個(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="n5xlr5r" 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>
                            主站蜘蛛池模板: WF2户外三防照明配电箱-BXD8050防爆防腐配电箱-浙江沃川防爆电气有限公司 | 宝鸡市人民医院| 直流电能表-充电桩电能表-导轨式电能表-智能电能表-浙江科为电气有限公司 | 定量包装秤,吨袋包装称,伸缩溜管,全自动包装秤,码垛机器人,无锡市邦尧机械工程有限公司 | 广东教师资格网-广东教师资格证考试网| 工业铝型材生产厂家_铝合金型材配件批发精加工定制厂商 - 上海岐易铝业 | 小区健身器材_户外健身器材_室外健身器材_公园健身路径-沧州浩然体育器材有限公司 | 玉米深加工设备|玉米加工机械|玉米加工设备|玉米深加工机械-河南成立粮油机械有限公司 | 北京签证代办_签证办理_商务签证_旅游签证_寰球签证网 | 2-羟基泽兰内酯-乙酰蒲公英萜醇-甘草查尔酮A-上海纯优生物科技有限公司 | 户外健身路径_小区健身器材_室外健身器材厂家_价格-浩然体育 | 涂层测厚仪_光泽度仪_uv能量计_紫外辐照计_太阳膜测试仪_透光率仪-林上科技 | ISO9001认证咨询_iso9001企业认证代理机构_14001|18001|16949|50430认证-艾世欧认证网 | 周易算网-八字测算网 - 周易算网-宝宝起名取名测名字周易八字测算网 | 强效碱性清洗剂-实验室中性清洗剂-食品级高纯氮气发生器-上海润榕科学器材有限公司 | 打包箱房_集成房屋-山东佳一集成房屋有限公司 | 工程管道/塑料管材/pvc排水管/ppr给水管/pe双壁波纹管等品牌管材批发厂家-河南洁尔康建材 | 济南冷库安装-山东冷库设计|建造|冷库维修-山东齐雪制冷设备有限公司 | (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 | 粒米特测控技术(上海)有限公司-测功机_减速机测试台_电机测试台 | 沥青灌缝机_路面灌缝机_道路灌缝机_沥青灌缝机厂家_济宁萨奥机械有限公司 | 施工围挡-施工PVC围挡-工程围挡-深圳市旭东钢构技术开发有限公司 | 钢衬四氟管道_钢衬四氟直管_聚四氟乙烯衬里管件_聚四氟乙烯衬里管道-沧州汇霖管道科技有限公司 | 济南货架定做_仓储货架生产厂_重型货架厂_仓库货架批发_济南启力仓储设备有限公司 | 油罐车_加油机_加油卷盘_加油机卷盘_罐车人孔盖_各类球阀_海底阀等车用配件厂家-湖北华特专用设备有限公司 | 通辽信息港 - 免费发布房产、招聘、求职、二手、商铺等信息 www.tlxxg.net | 航空铝型材,7系铝型材挤压,硬质阳*氧化-余润铝制品 | 空气能采暖,热泵烘干机,空气源热水机组|设备|厂家,东莞高温热泵_正旭新能源 | 空气能暖气片,暖气片厂家,山东暖气片,临沂暖气片-临沂永超暖通设备有限公司 | 粘弹体防腐胶带,聚丙烯防腐胶带-全民塑胶 | 强效碱性清洗剂-实验室中性清洗剂-食品级高纯氮气发生器-上海润榕科学器材有限公司 | 广州物流公司_广州货运公司_广州回程车运输 - 万信物流 | 北京成考网-北京成人高考网 | 升降机-高空作业车租赁-蜘蛛车-曲臂式伸缩臂剪叉式液压升降平台-脚手架-【普雷斯特公司厂家】 | 科研ELISA试剂盒,酶联免疫检测试剂盒,昆虫_植物ELISA酶免试剂盒-上海仁捷生物科技有限公司 | 短信通106短信接口验证码接口群发平台_国际短信接口验证码接口群发平台-速度网络有限公司 | 气密性检测仪_气密性检测设备_防水测试仪_密封测试仪-岳信仪器 | 中式装修设计_室内中式装修_【云臻轩】中式设计机构 | 上海乾拓贸易有限公司-日本SMC电磁阀_德国FESTO电磁阀_德国FESTO气缸 | 消泡剂_水处理消泡剂_切削液消泡剂_涂料消泡剂_有机硅消泡剂_广州中万新材料生产厂家 | EFM 022静电场测试仪-套帽式风量计-静电平板监测器-上海民仪电子有限公司 |