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>
                        • 主站蜘蛛池模板: 生鲜配送系统-蔬菜食材配送管理系统-连锁餐饮订货配送软件-挪挪生鲜供应链管理软件 | 361°官方网站| 外观设计_设备外观设计_外观设计公司_产品外观设计_机械设备外观设计_东莞工业设计公司-意品深蓝 | 无菌实验室规划装修设计-一体化实验室承包-北京洁净净化工程建设施工-北京航天科恩实验室装备工程技术有限公司 | 台式核磁共振仪,玻璃软化点测定仪,旋转高温粘度计,测温锥和测温块-上海麟文仪器 | 青岛侦探调查_青岛侦探事务所_青岛调查事务所_青岛婚外情取证-青岛狄仁杰国际侦探公司 | 退火炉,燃气退火炉,燃气热处理炉生产厂家-丹阳市丰泰工业炉有限公司 | 交通信号灯生产厂家_红绿灯厂家_电子警察监控杆_标志杆厂家-沃霖电子科技 | 心肺复苏模拟人|医学模型|急救护理模型|医学教学模型上海康人医学仪器设备有限公司 | 创绿家招商加盟网-除甲醛加盟-甲醛治理加盟-室内除甲醛加盟-创绿家招商官网 | 领袖户外_深度旅游、摄影旅游、小团慢旅行、驴友网 | 广东青藤环境科技有限公司-水质检测 | 深圳天际源广告-形象堆头,企业文化墙,喷绘,门头招牌设计制作专家 | 橡胶弹簧|复合弹簧|橡胶球|振动筛配件-新乡市永鑫橡胶厂 | 家德利门业,家居安全门,别墅大门 - 安徽家德利门业有限公司 | 上海噪音治理公司-专业隔音降噪公司-中广通环保 | 鼓风干燥箱_真空烘箱_高温干燥箱_恒温培养箱-上海笃特科学仪器 | 陕西视频监控,智能安防监控,安防系统-西安鑫安5A安防工程公司 | 胶原检测试剂盒,弹性蛋白检测试剂盒,类克ELISA试剂盒,阿达木单抗ELISA试剂盒-北京群晓科苑生物技术有限公司 | 注浆压力变送器-高温熔体传感器-矿用压力传感器|ZHYQ朝辉 | 防渗膜厂家|养殖防渗膜|水产养殖防渗膜-泰安佳路通工程材料有限公司 | 美侍宠物-专注宠物狗及宠物猫训练|喂养|医疗|繁育|品种|价格 | 带锯机|木工带锯机圆木推台锯|跑车带锯机|河北茂业机械制造有限公司| | 【甲方装饰】合肥工装公司-合肥装修设计公司,专业从事安徽办公室、店面、售楼部、餐饮店、厂房装修设计服务 | 高硼硅玻璃|水位计玻璃板|光学三棱镜-邯郸奥维玻璃科技有限公司 高温高压釜(氢化反应釜)百科 | 富森高压水枪-柴油驱动-养殖场高压清洗机-山东龙腾环保科技有限公司 | 土壤养分检测仪_肥料养分检测仪_土壤水分检测仪-山东莱恩德仪器 大型多片锯,圆木多片锯,方木多片锯,板材多片锯-祥富机械有限公司 | 华东师范大学在职研究生招生网_在职研究生招生联展网 | 实木家具_实木家具定制_全屋定制_美式家具_圣蒂斯堡官网 | 酸度计_PH计_特斯拉计-西安云仪| 武汉高温老化房,恒温恒湿试验箱,冷热冲击试验箱-武汉安德信检测设备有限公司 | 编织人生 - 权威手工编织网站,编织爱好者学习毛衣编织的门户网站,织毛衣就上编织人生网-编织人生 | 风信子发稿-专注为企业提供全球新闻稿发布服务 | 不锈钢/气体/液体玻璃转子流量计(防腐,选型,规格)-常州天晟热工仪表有限公司【官网】 | sfp光模块,高速万兆光模块工厂-性价比更高的光纤模块制造商-武汉恒泰通 | 电缆故障测试仪_电缆故障定位仪_探测仪_检测仪器_陕西意联电气厂家 | 真空吸污车_高压清洗车厂家-程力专用汽车股份有限公司官网 | 百度网站优化,关键词排名,SEO优化-搜索引擎营销推广 | 定制/定做冲锋衣厂家/公司-订做/订制冲锋衣价格/费用-北京圣达信 | CPSE安博会| 电伴热系统施工_仪表电伴热保温箱厂家_沃安电伴热管缆工业技术(济南)有限公司 |