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

  1. <tfoot id='Px5Cv'></tfoot>

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

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

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

    1. <i id='Px5Cv'><tr id='Px5Cv'><dt id='Px5Cv'><q id='Px5Cv'><span id='Px5Cv'><b id='Px5Cv'><form id='Px5Cv'><ins id='Px5Cv'></ins><ul id='Px5Cv'></ul><sub id='Px5Cv'></sub></form><legend id='Px5Cv'></legend><bdo id='Px5Cv'><pre id='Px5Cv'><center id='Px5Cv'></center></pre></bdo></b><th id='Px5Cv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Px5Cv'><tfoot id='Px5Cv'></tfoot><dl id='Px5Cv'><fieldset id='Px5Cv'></fieldset></dl></div>
    2. 使用markercluster對(duì)多個(gè)圖層進(jìn)行聚類

      Cluster multiple Layers with markercluster(使用markercluster對(duì)多個(gè)圖層進(jìn)行聚類)

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

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

          1. <tfoot id='mEPNZ'></tfoot>

              <tbody id='mEPNZ'></tbody>
            <i id='mEPNZ'><tr id='mEPNZ'><dt id='mEPNZ'><q id='mEPNZ'><span id='mEPNZ'><b id='mEPNZ'><form id='mEPNZ'><ins id='mEPNZ'></ins><ul id='mEPNZ'></ul><sub id='mEPNZ'></sub></form><legend id='mEPNZ'></legend><bdo id='mEPNZ'><pre id='mEPNZ'><center id='mEPNZ'></center></pre></bdo></b><th id='mEPNZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mEPNZ'><tfoot id='mEPNZ'></tfoot><dl id='mEPNZ'><fieldset id='mEPNZ'></fieldset></dl></div>
              • <bdo id='mEPNZ'></bdo><ul id='mEPNZ'></ul>
                本文介紹了使用markercluster對(duì)多個(gè)圖層進(jìn)行聚類的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我目前正在使用 Leaflet 庫(kù)進(jìn)行地圖可視化.我也在使用 markercluster 插件來聚類我的觀點(diǎn).

                I am currently working on a map visualization with the Leaflet library. I am also using the markercluster plugin to cluster my points.

                所以我現(xiàn)在的問題如下:

                So my question now is the following:

                我在 3 個(gè)不同的層中有 3 個(gè)不同類別的標(biāo)記.例如餐廳、咖啡館和酒吧層.我想將所有活動(dòng)層組合到一個(gè)特定的集群.

                I have 3 different categories of Markers in 3 different layers. For example Restaurants, Cafes and Bars Layers. And I want to combine all active Layers to a specific cluster.

                目前這些條目是單獨(dú)聚集的,但我想將它們聚集在一起.

                At the moment the entries are clustered separately but I want to cluster them together.

                下一步是根據(jù) childMarkers 為集群著色.例如.集群包括餐廳和酒吧標(biāo)記 => 半紅/半綠,僅餐廳 => 僅紅色等.

                The next step would be coloring the cluster according to the childMarkers. E.g. cluster includes restaurant and bar markers => half red/ half green, only restaurants => only red etc.

                我希望有人可以幫助我找到解決方案.謝謝!

                I hope somebody can help me to get to a solution. Thank you!

                推薦答案

                您在問題中提到了 2 個(gè)不同的請(qǐng)求:

                You mention 2 different requests in your question:

                1. 有 3 種不同類型的標(biāo)記,但都應(yīng)該聚集在一起.棘手的部分是如果您想隱藏/顯示特定類型(可能通過圖層控制).
                2. 根據(jù)每種類型包含的標(biāo)記數(shù)自定義集群外觀.

                至于第 1 點(diǎn),你顯然可以將所有 3 種類型的標(biāo)記添加到同一個(gè) MarkerClusterGroup 中,這樣它們就可以聚集在一起.如果您已經(jīng)將它們放在不同的圖層組中,您可以簡(jiǎn)單地執(zhí)行 myMCG.addLayers([layerGroup1, layerGroup2, layerGroup3]); 并且 MCG 將添加所有單獨(dú)的標(biāo)記.但是以后不要在地圖中添加/刪除這些圖層組!

                As for point 1, you can obviously add all 3 types of markers to the same MarkerClusterGroup, so that they can cluster together. If you already have them within different LayerGroups, you can simply do myMCG.addLayers([layerGroup1, layerGroup2, layerGroup3]); and MCG will get all individual markers added. But refrain from adding/removing those LayerGroups to/from the map later!

                困難的部分是當(dāng)您希望能夠從地圖中動(dòng)態(tài)添加/刪除特定類型的標(biāo)記時(shí).除了map.removeLayer(layerGroupX);,您還需要遍歷所有單獨(dú)的標(biāo)記并將它們從您的MCG中移除,例如:

                The difficult part is when you want to be able nevertheless to dynamically add / remove a specific type of markers from the map. Instead of doing just map.removeLayer(layerGroupX);, you would need to loop through all individual markers and remove them from your MCG, for example:

                layerGroupX.eachLayer(function (marker) {
                    myMCG.removeLayer(marker);
                });
                

                另請(qǐng)參閱 MarkerClusterGroup 插件網(wǎng)站上的 此問題原因和一些額外的例子.反過來將標(biāo)記添加回您的 MCG.

                See also this issue on MarkerClusterGroup plugin site for the reasons and some extra examples. Do the reverse for adding markers back into your MCG.

                我已經(jīng)發(fā)布了一個(gè)Leaflet.FeatureGroup.SubGroup 插件,它解決了這個(gè)確切的用例.另請(qǐng)參閱使用多個(gè)標(biāo)記集群組顯示重疊集群

                I have published a Leaflet.FeatureGroup.SubGroup plugin since then, which addresses this exact use case. See also Using several Marker Cluster Groups displays overlapping Clusters

                至于第2點(diǎn),簡(jiǎn)單參考自定義插件文檔的集群標(biāo)記部分.基本上,您在初始化 MCG 時(shí)使用選項(xiàng) iconCreateFunction.您傳入一個(gè)函數(shù),該函數(shù)采用單個(gè)參數(shù)(例如 cluster),您可以使用 cluster.getAllChildMarkers(); 來獲取集群中包含的標(biāo)記數(shù)組風(fēng)格.然后簡(jiǎn)單地遍歷這個(gè)數(shù)組來計(jì)算每種標(biāo)記的數(shù)量,并相應(yīng)地創(chuàng)建一個(gè)圖標(biāo).

                As for point 2, simply refer to the Customising the Clustered Markers section of the plugin documentation. Basically, you use option iconCreateFunction when initializing your MCG. You pass in a function, which takes a single argument (e.g. cluster) and you can use cluster.getAllChildMarkers(); to get the array of contained markers in the cluster being styled. Then simply iterate through this array to count the number of each type of markers, and create an icon accordingly.

                你也可以試試這個(gè)其他插件:q-cluster.但是它沒有動(dòng)畫,所以它遠(yuǎn)不如 MCG 好看……

                You could also try this other plugin: q-cluster. But it does not animate, so it is far less eye-candy than MCG…

                這篇關(guān)于使用markercluster對(duì)多個(gè)圖層進(jìn)行聚類的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

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

                    <legend id='L17gh'><style id='L17gh'><dir id='L17gh'><q id='L17gh'></q></dir></style></legend>
                        <tbody id='L17gh'></tbody>
                        • <bdo id='L17gh'></bdo><ul id='L17gh'></ul>
                          <tfoot id='L17gh'></tfoot>
                        • 主站蜘蛛池模板: 日韩免费三级 | 五月花丁香婷婷 | 日韩精品免费一区二区在线观看 | 麻豆久久久久久久 | 91久久久久久 | 天堂精品视频 | 色视频欧美 | 一区二区三区在线播放 | 久久精品天堂 | 中文无吗 | 亚洲男人天堂2024 | 国产高清一区二区三区 | 天堂va在线观看 | 日韩成人影院在线观看 | 在线观看黄色 | 亚洲性人人天天夜夜摸 | 久久精品91 | 欧美日韩不卡 | 国产一级片久久久 | 国产亚洲区 | 国产精品美女久久久久久不卡 | 91极品视频 | 亚洲a一区二区 | 国产激情三区 | 久久久日韩精品一区二区三区 | 福利精品| 亚洲日本一区二区 | 久久久国产视频 | 在线三级电影 | 国产精品久久久久久久久久久免费看 | 日本午夜在线视频 | 色偷偷噜噜噜亚洲男人 | 老司机深夜福利网站 | 欧美日韩国产三级 | 日韩α片 | 亚洲高清免费视频 | 黄色毛片大全 | 欧美一区成人 | 成人福利网站 | 亚洲国产一区二区视频 | 久久精品亚洲精品国产欧美kt∨ |