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

  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="l55nlrx" id='Px5Cv'><tfoot id='Px5Cv'></tfoot><dl id='Px5Cv'><fieldset id='Px5Cv'></fieldset></dl></div>
    2. 使用markercluster對多個圖層進行聚類

      Cluster multiple Layers with markercluster(使用markercluster對多個圖層進行聚類)

        <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="nnvptrp" id='mEPNZ'><tfoot id='mEPNZ'></tfoot><dl id='mEPNZ'><fieldset id='mEPNZ'></fieldset></dl></div>
              • <bdo id='mEPNZ'></bdo><ul id='mEPNZ'></ul>
                本文介紹了使用markercluster對多個圖層進行聚類的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我目前正在使用 Leaflet 庫進行地圖可視化.我也在使用 markercluster 插件來聚類我的觀點.

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

                所以我現在的問題如下:

                So my question now is the following:

                我在 3 個不同的層中有 3 個不同類別的標記.例如餐廳、咖啡館和酒吧層.我想將所有活動層組合到一個特定的集群.

                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.

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

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

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

                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 個不同的請求:

                You mention 2 different requests in your question:

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

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

                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!

                困難的部分是當您希望能夠從地圖中動態添加/刪除特定類型的標記時.除了map.removeLayer(layerGroupX);,您還需要遍歷所有單獨的標記并將它們從您的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);
                });
                

                另請參閱 MarkerClusterGroup 插件網站上的 此問題原因和一些額外的例子.反過來將標記添加回您的 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.

                我已經發布了一個Leaflet.FeatureGroup.SubGroup 插件,它解決了這個確切的用例.另請參閱使用多個標記集群組顯示重疊集群

                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點,簡單參考自定義插件文檔的集群標記部分.基本上,您在初始化 MCG 時使用選項 iconCreateFunction.您傳入一個函數,該函數采用單個參數(例如 cluster),您可以使用 cluster.getAllChildMarkers(); 來獲取集群中包含的標記數組風格.然后簡單地遍歷這個數組來計算每種標記的數量,并相應地創建一個圖標.

                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.

                你也可以試試這個其他插件:q-cluster.但是它沒有動畫,所以它遠不如 MCG 好看……

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

                這篇關于使用markercluster對多個圖層進行聚類的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)

                  <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="pl7xtjz" 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>
                        • 主站蜘蛛池模板: 超声波气象站_防爆气象站_空气质量监测站_负氧离子检测仪-风途物联网 | 散热器-电子散热器-型材散热器-电源散热片-镇江新区宏图电子散热片厂家 | 环氧树脂地坪漆_济宁市新天地漆业有限公司 | 医疗仪器模块 健康一体机 多参数监护仪 智慧医疗仪器方案定制 血氧监护 心电监护 -朗锐慧康 | 卫生纸复卷机|抽纸机|卫生纸加工设备|做卫生纸机器|小型卫生纸加工需要什么设备|卫生纸机器设备多少钱一台|许昌恒源纸品机械有限公司 | 电缆接头-防爆电缆接头-格兰头-金属电缆接头-防爆填料函 | 宽带办理,电信宽带,移动宽带,联通宽带,电信宽带办理,移动宽带办理,联通宽带办理 | 安徽净化板_合肥岩棉板厂家_玻镁板厂家_安徽科艺美洁净科技有限公司 | 除湿机|工业除湿机|抽湿器|大型地下室车间仓库吊顶防爆除湿机|抽湿烘干房|新风除湿机|调温/降温除湿机|恒温恒湿机|加湿机-杭州川田电器有限公司 | 不发火防静电金属骨料_无机磨石_水泥自流平_修补砂浆厂家「圣威特」 | 小型玉石雕刻机_家用玉雕机_小型万能雕刻机_凡刻雕刻机官网 | 合同书格式和范文_合同书样本模板_电子版合同,找范文吧 | 诸城网站建设-网络推广-网站优化-阿里巴巴托管-诸城恒泰互联 | 网架支座@球铰支座@钢结构支座@成品支座厂家@万向滑动支座_桥兴工程橡胶有限公司 | 多米诺-多米诺世界纪录团队-多米诺世界-多米诺团队培训-多米诺公关活动-多米诺创意广告-多米诺大型表演-多米诺专业赛事 | 开云(中国)Kaiyun·官方网站 - 登录入口 | 双相钢_双相不锈钢_双相钢圆钢棒_双相不锈钢报价「海新双相钢」 双能x射线骨密度检测仪_dxa骨密度仪_双能x线骨密度仪_品牌厂家【品源医疗】 | 昆明挖掘机修理厂_挖掘机翻新再制造-昆明聚力工程机械维修有限公司 | 保定市泰宏机械制造厂-河北铸件厂-铸造厂-铸件加工-河北大件加工 | 泡沫消防车_水罐消防车_湖北江南专用特种汽车有限公司 | 芜湖厨房设备_芜湖商用厨具_芜湖厨具设备-芜湖鑫环厨具有限公司 控显科技 - 工控一体机、工业显示器、工业平板电脑源头厂家 | 对照品_中药对照品_标准品_对照药材_「格利普」高纯中药标准品厂家-成都格利普生物科技有限公司 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 东莞动力锂电池保护板_BMS智能软件保护板_锂电池主动均衡保护板-东莞市倡芯电子科技有限公司 | 冷镦机-多工位冷镦机-高速冷镦机厂家-温州金诺机械设备制造有限公司 | ZHZ8耐压测试仪-上海胜绪电气有限公司 | 假肢-假肢价格-假肢厂家-河南假肢-郑州市力康假肢矫形器有限公司 | 退火炉,燃气退火炉,燃气热处理炉生产厂家-丹阳市丰泰工业炉有限公司 | 土壤养分检测仪_肥料养分检测仪_土壤水分检测仪-山东莱恩德仪器 大型多片锯,圆木多片锯,方木多片锯,板材多片锯-祥富机械有限公司 | 一级建造师培训_一建培训机构_中建云筑建造师培训网校 | 冷藏车-东风吸污车-纯电动环卫车-污水净化车-应急特勤保障车-程力专汽厂家-程力专用汽车股份有限公司销售二十一分公司 | 大流量卧式砂磨机_强力分散机_双行星双动力混合机_同心双轴搅拌机-莱州市龙跃化工机械有限公司 | 集菌仪厂家_全封闭_封闭式_智能智能集菌仪厂家-上海郓曹 | 深圳天际源广告-形象堆头,企业文化墙,喷绘,门头招牌设计制作专家 | ETFE膜结构_PTFE膜结构_空间钢结构_膜结构_张拉膜_浙江萬豪空间结构集团有限公司 | 台湾Apex减速机_APEX行星减速机_台湾精锐减速机厂家代理【现货】-杭州摩森机电 | 作文导航网_作文之家_满分作文_优秀作文_作文大全_作文素材_最新作文分享发布平台 | 论文查重_免费论文查重_知网学术不端论文查重检测系统入口_论文查重软件 | 手术示教系统-数字化手术室系统-林之硕医疗云智能视频平台 | 热闷罐-高温罐-钢渣热闷罐-山东鑫泰鑫智能热闷罐厂家 | 北京企业宣传片拍摄_公司宣传片制作-广告短视频制作_北京宣传片拍摄公司 | 高博医疗集团上海阿特蒙医院|