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

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

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

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

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

        傳單:使用 CircleMarkers 包含元數(shù)據(jù)

        Leaflet: Including metadata with CircleMarkers(傳單:使用 CircleMarkers 包含元數(shù)據(jù))
          <tbody id='NRtuY'></tbody>

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

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

              • <tfoot id='NRtuY'></tfoot>

                1. <legend id='NRtuY'><style id='NRtuY'><dir id='NRtuY'><q id='NRtuY'></q></dir></style></legend>
                  本文介紹了傳單:使用 CircleMarkers 包含元數(shù)據(jù)的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一張使用 CircleMarkers 填充的傳單地圖.我想在每個(gè)圓圈中包含一個(gè)附加值(數(shù)據(jù)庫 ID),這樣當(dāng)我單擊圓圈時(shí),我可以獲取該值并導(dǎo)航到其他地方.

                  I have a Leaflet map that I am populating with CircleMarkers. I would like to include an additional value (a database ID) with each circle so that when I click on the circle, I can get the value and navigate somewhere else.

                  我想將值直接添加到標(biāo)記并在整個(gè) featureGroup 上使用回調(diào)函數(shù),而不是為每個(gè)標(biāo)記添加回調(diào)函數(shù),因?yàn)槲覀円幚沓^ 500 個(gè)標(biāo)記和這會拖累性能.

                  I would like to add the value directly to the marker and use a callback function on the entire featureGroup instead of adding a callback function to each marker, since we're dealing with over 500 markers and it would be a performance drag.

                  值得一提:我在 Angular 應(yīng)用程序中使用 Typescript,但它仍然是 Leaflet.

                  Worth mentioning: I'm using Typescript inside an Angular app, but it's still Leaflet.

                  我的嘗試:

                    var data = [
                      {lat: 20.45, lng: -150.2, id: 44},
                      {lat: 23.45, lng: -151.7, id: 45},
                    ]
                    var points = [];
                  
                    data.forEach((d) => {
                      // How do I add an additional variable to this circleMarker?
                      points.push(circleMarker(latLng(d.lat, d.lng), { radius: 5}));
                    })
                  
                    var group = featureGroup(points);
                  
                    group.on("click", function (e) {
                      console.log(e);
                      // This is where I would like to get the ID number of the record
                    });
                  

                  推薦答案

                  FWIW,你有很多方法可以將你自己的數(shù)據(jù)添加到 Leaflet Layers (沒有特定于圓形標(biāo)記,標(biāo)記相同,還有多邊形,折線等).

                  FWIW, you have plenty ways of adding your own data to Leaflet Layers (nothing specific to Circle Markers, it is the same for Markers, but also Polygons, Polylines, etc.).

                  參見例如:Leaflet/Leaflet #5629(將業(yè)務(wù)數(shù)據(jù)附加到層)

                  簡而言之,主要有3種可能的方式:

                  In short, there are mainly 3 possible ways:

                  • 在 Leaflet Layer 實(shí)例化后直接添加一些屬性即可.確保避免與庫屬性和方法發(fā)生沖突.您可以在屬性名稱中添加自己的前綴以減少沖突的機(jī)會.
                  var marker = L.marker(latlng);
                  marker.myLibTitle = 'my title';
                  

                  • 使用層 options(通常是實(shí)例化工廠的第二個(gè)參數(shù)),如 @nikoshr 所示.如前所述,避免與庫選項(xiàng)名稱沖突.
                    • Use the Layer options (usually the 2nd argument of the instantiation factory), as shown by @nikoshr. As previously, avoid collision with library option names.
                    • L.marker(latlng, {
                        myLibTitle: 'my title'
                      });
                      

                      • 使用圖層 GeoJSON properties.Leaflet 不會將這些數(shù)據(jù)用于內(nèi)部目的,因此您可以完全自由地使用這些數(shù)據(jù),沒有任何碰撞風(fēng)險(xiǎn).
                        • Use the Layer GeoJSON properties. Leaflet does not use those for internal purpose, so you have total freedom of this data, without any risk of collision.
                        • L.Layer.include({
                            getProps: function () {
                              var feature = this.feature = this.feature || {}; // Initialize the feature, if missing.
                              feature.type = 'Feature';
                              feature.properties = feature.properties || {}; // Initialize the properties, if missing.
                              return feature.properties;
                            }
                          });
                          
                          var marker = L.marker(latlng);
                          
                          // set data
                          marker.getProps().myData = 'myValue';
                          
                          // get data
                          myFeatureGroup.on('click', function (event) {
                            var source = event.sourceTarget;
                            console.log(source.getProps().myData);
                          });
                          

                          這篇關(guān)于傳單:使用 CircleMarkers 包含元數(shù)據(jù)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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è)邊欄)

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

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

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

                          • 主站蜘蛛池模板: 精品视频久久久 | 中文在线视频 | 久久久久久精 | www.欧美.com | 亚洲成av人片在线观看 | 一区二区三区亚洲精品国 | 毛片免费视频 | 精品日韩 | 亚洲视频中文字幕 | 亚洲综合在线网 | 99re视频这里只有精品 | 福利社午夜影院 | 91色视频在线观看 | 国产精品成av人在线视午夜片 | 成人福利网| 成人一区二区三区在线 | 国产精品资源在线 | 99久久99久久精品国产片果冰 | 免费观看一级黄色录像 | 欧美成人a∨高清免费观看 91伊人 | 国产视频1区 | 亚洲一区二区三区在线视频 | 精品三级在线观看 | 日韩av高清 | 日韩一区二区三区在线视频 | 亚洲丝袜天堂 | 免费成人高清在线视频 | 亚洲三级av| 91久久| 涩涩视频在线观看 | 在线a视频| 永久精品 | 欧美专区在线视频 | 欧美一区二区三区免费在线观看 | xx性欧美肥妇精品久久久久久 | 国户精品久久久久久久久久久不卡 | 精品一区国产 | 日韩中文字幕av | 国产欧美日韩精品在线观看 | 久久y| 999久久 |