久久久久久久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ù)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我有一張使用 CircleMarkers 填充的傳單地圖.我想在每個(gè)圓圈中包含一個(gè)附加值(數(shù)據(jù)庫(kù) 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)槲覀円幚沓^(guò) 500 個(gè)標(biāo)記和這會(huì)拖累性能.

                  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 (沒(méi)有特定于圓形標(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.).

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

                  簡(jiǎn)而言之,主要有3種可能的方式:

                  In short, there are mainly 3 possible ways:

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

                  • 使用層 options(通常是實(shí)例化工廠的第二個(gè)參數(shù)),如 @nikoshr 所示.如前所述,避免與庫(kù)選項(xiàng)名稱(chē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 不會(huì)將這些數(shù)據(jù)用于內(nèi)部目的,因此您可以完全自由地使用這些數(shù)據(jù),沒(méi)有任何碰撞風(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ù)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                          【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(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è)邊欄)

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

                          • 主站蜘蛛池模板: 欧美一区二区三区视频在线播放 | 日本激情视频中文字幕 | 亚洲a人| 日日摸夜夜添夜夜添特色大片 | 精品中文字幕久久 | 黄色精品 | 怡红院免费的全部视频 | 天天天操天天天干 | 欧美乱人伦视频 | 欧美另类视频在线 | 欧美成人专区 | 91大神在线资源观看无广告 | 男女羞羞免费视频 | 国产精品一区二区三 | 欧美日韩高清在线一区 | 91青青草视频 | 色综合99| 国产在线一级片 | 粉嫩高清一区二区三区 | 日韩精品一区二区三区视频播放 | 91精品国产91久久久 | 天天操网 | 麻豆视频国产在线观看 | 国产视频二区 | 日本午夜免费福利视频 | 奇米四色影视 | 一级大黄色片 | 欧区一欧区二欧区三免费 | 久久99精品久久久久久国产越南 | 国产精品中文字幕在线 | 日韩在线中文 | 久久精品无码一区二区三区 | 特级黄一级播放 | 午夜av免费 | 激情网站 | 91人人爽 | 欧美一区二区三区在线观看视频 | 97精品超碰一区二区三区 | 久久精品一区二区 | 久久专区| 国产精品女人久久久 |