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

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

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

        <legend id='xOPyB'><style id='xOPyB'><dir id='xOPyB'><q id='xOPyB'></q></dir></style></legend>

        傳單:添加標記的鏈接

        Leaflet: Add a link to the markers(傳單:添加標記的鏈接)
          <tbody id='Eoheo'></tbody>

        <tfoot id='Eoheo'></tfoot>

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

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

            <legend id='Eoheo'><style id='Eoheo'><dir id='Eoheo'><q id='Eoheo'></q></dir></style></legend>

            1. <i id='Eoheo'><tr id='Eoheo'><dt id='Eoheo'><q id='Eoheo'><span id='Eoheo'><b id='Eoheo'><form id='Eoheo'><ins id='Eoheo'></ins><ul id='Eoheo'></ul><sub id='Eoheo'></sub></form><legend id='Eoheo'></legend><bdo id='Eoheo'><pre id='Eoheo'><center id='Eoheo'></center></pre></bdo></b><th id='Eoheo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Eoheo'><tfoot id='Eoheo'></tfoot><dl id='Eoheo'><fieldset id='Eoheo'></fieldset></dl></div>
                1. 本文介紹了傳單:添加標記的鏈接的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  非常簡單的問題:如何使 Leaflet 中的地圖標記可點擊并將用戶引導到其他頁面?每個標記都有自己的頁面.

                  Pretty simple question: How can I make the map markers in Leaflet clickable and route the user to an other page? Every marker has its own page.

                  我嘗試了以下方法但沒有成功;不知何故,所有標記都指向同一個頁面,這是最后分配的 URI.

                  I've tried the following without success; somehow all the markers point to the same page, which is the last assigned URI.

                  var markers = [
                      { coords: [51.505, -0.09], uri: '/some-page' },
                      ...
                  ];
                  
                  for(x in markers)
                  {
                      L.marker(markers[x].coords).on('click', function() {
                          window.location = markers[x].uri;
                      }).addTo(map);
                  }
                  

                  這個問題真讓我抓狂.

                  推薦答案

                  好吧,我終于找到解決方案了;當標記添加到地圖時,它會被分配一個名為_leaflet_id"的 ID.這可以通過目標對象獲取,也可以在將其添加到地圖后設置為自定義值.

                  Okay, I finally came to a solution; when a marker is added to the map it gets assigned an ID called "_leaflet_id". This can be fetched through the target object, and also set to a custom value after it has been added to the map.

                  所以最終的解決方案很簡單:

                  So the final solution is simply:

                  var x = markers.length;
                  
                  while(x--)
                  {
                      L.marker(markers[x].coords).on('click', function(e) {
                          window.location = markers[e.target._leaflet_id].uri;
                      }).addTo(map)._leaflet_id = x;
                  }
                  

                  (我用反向的while循環替換了for-in循環)

                  (I replaced the for-in loop with a reversed while loop)

                  這篇關于傳單:添加標記的鏈接的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)
                      <bdo id='fmCYy'></bdo><ul id='fmCYy'></ul>

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

                          1. <i id='fmCYy'><tr id='fmCYy'><dt id='fmCYy'><q id='fmCYy'><span id='fmCYy'><b id='fmCYy'><form id='fmCYy'><ins id='fmCYy'></ins><ul id='fmCYy'></ul><sub id='fmCYy'></sub></form><legend id='fmCYy'></legend><bdo id='fmCYy'><pre id='fmCYy'><center id='fmCYy'></center></pre></bdo></b><th id='fmCYy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fmCYy'><tfoot id='fmCYy'></tfoot><dl id='fmCYy'><fieldset id='fmCYy'></fieldset></dl></div>
                            <legend id='fmCYy'><style id='fmCYy'><dir id='fmCYy'><q id='fmCYy'></q></dir></style></legend>
                            <tfoot id='fmCYy'></tfoot>
                              <tbody id='fmCYy'></tbody>
                          2. 主站蜘蛛池模板: av香港经典三级级 在线 | 久久噜噜噜精品国产亚洲综合 | 特级生活片 | 日本韩国电影免费观看 | 免费一看一级毛片 | 天天躁日日躁狠狠很躁 | 色资源在线视频 | 日韩欧美一区二区三区在线播放 | 在线看av的网址 | 狠狠影院| 久久在线看 | 天天操伊人| 九九国产| 无码一区二区三区视频 | 国产一区二区 | 久久久久久国产精品免费免费男同 | 黄色三级免费网站 | 丁香婷婷成人 | 永久av | 色婷婷综合成人av | 国产精品免费观看视频 | 久久精品国产免费一区二区三区 | 亚洲精品免费在线观看 | 国产欧美在线一区二区 | 日韩亚洲一区二区 | 在线免费观看日本视频 | 日韩视频1 | 欧美爱爱视频网站 | 国产精品178页 | 国产午夜视频 | 久久精品国产99国产精品 | 国产精品毛片一区二区三区 | 欧美xxxx色视频在线观看免费 | 99av成人精品国语自产拍 | 美女福利视频一区 | 日韩一区二区免费视频 | 中文字幕在线第二页 | 华丽的挑战在线观看 | 超碰在线免费av | 欧美日韩一卡 | 在线免费观看色 |