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

    • <bdo id='zRQuf'></bdo><ul id='zRQuf'></ul>
    <legend id='zRQuf'><style id='zRQuf'><dir id='zRQuf'><q id='zRQuf'></q></dir></style></legend>

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

  • <small id='zRQuf'></small><noframes id='zRQuf'>

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

      2. 如何使用層應用傳單標記集群

        How to apply leaflet marker cluster using layers(如何使用層應用傳單標記集群)

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

                    <tbody id='7828x'></tbody>
                1. <small id='7828x'></small><noframes id='7828x'>

                2. <legend id='7828x'><style id='7828x'><dir id='7828x'><q id='7828x'></q></dir></style></legend>
                  本文介紹了如何使用層應用傳單標記集群的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試應用 Leaflet.MarkerCluster.LayerSupport.但我不知道如何使用它 :( 我已經閱讀了有關但我嘗試了很多次但它不起作用的文檔.

                  I′m trying to apply the Leaflet.MarkerCluster.LayerSupport. But I don′t know how to use it :( I′ve already read the documentation about but and I tried many times but it doesen′t work.

                  這是我的代碼

                  <!DOCTYPE html>
                  <html>
                  <head>
                      <title>Península</title>
                      <meta charset="utf-8" />
                  
                      <meta name="viewport" content="width=device-width, initial-scale=1.0">
                  
                      <link rel="stylesheet"  />
                  </head>
                  <body>
                      <div id="map" style="width: 600px; height: 400px"></div>
                  
                      <script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
                      <script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/leaflet.markercluster.js'></script>
                      <script src="leaflet.markercluster.layersupport-src.js"></script>
                  
                  
                      <script>        
                  
                          var NemachIcons =L.Icon.extend({
                              options:{
                                  shadowUrl:'',
                                  iconSize:   [50,55],
                                  iconAnchor: [45,45],
                                  popupAnchor:[-3,-76]
                              }
                          });
                  
                          var tiloIcon = new NemachIcons({iconUrl:'http://www.iconshock.com/img_jpg/SIGMA/general/jpg/256/pyramid_icon.jpg'}),
                              puebloIcon = new NemachIcons({iconUrl:'http://icons.iconseeker.com/png/fullsize/gant/pointless-bw-circle-i-use-it-iex.png'}),
                              gasIcon =new NemachIcons({iconUrl:'https://cdn2.iconfinder.com/data/icons/function_icon_set/circle_green.png'});
                  
                  
                          L.icon =function (options) {
                              return new L.Icon(options);
                          };
                  
                  
                          var sitios = new L. LayerGroup();
                  
                          L.marker([20.683, -88.568], {icon: tiloIcon}).bindPopup('1').addTo(sitios),
                          L.marker([21.204547, -89.269466], {icon: tiloIcon}).bindPopup('2').addTo(sitios),
                          L.marker([20.332362, -89.647899], {icon: tiloIcon}).bindPopup('3').addTo(sitios),
                          L.marker([20.486417, -88.660218], {icon: tiloIcon}).bindPopup('4').addTo(sitios),
                          L.marker([21.151196, -87.958143], {icon: tiloIcon}).bindPopup('5').addTo(sitios);
                  
                  
                          var pueblo = new L.LayerGroup();
                  
                          L.marker([20.9330, -89.0178], {icon: puebloIcon}).bindPopup('6').addTo(pueblo),
                          L.marker([20.6909, -88.2015], {icon: puebloIcon}).bindPopup('7').addTo(pueblo);
                  
                          var gas = new L.LayerGroup();
                          L.marker([20.973907, -89.578931], {icon: gasIcon}).bindPopup('8').addTo(gas);
                  
                  
                          var mbAttr = ' ' +
                                  '' +
                                  '',
                              mbUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw';
                  
                          var grayscale   = L.tileLayer(mbUrl, {id: 'mapbox.light', attribution: mbAttr}),
                              streets  = L.tileLayer(mbUrl, {id: 'mapbox.streets',   attribution: mbAttr});
                  
                          var map = L.map('map', {
                              center: [20.794527, -88.760612],
                              zoom: 8,
                              layers: [grayscale, sitios]
                          });
                  
                          var baseLayers = {
                  
                              //"Grayscale": grayscale,
                              //"Streets": streets
                  
                          };
                  
                          var overlays = {
                              "Pirámide": sitios,
                              "Poblado": pueblo,
                              "Servicio": gas
                          };
                  
                          L.control.layers(baseLayers, overlays).addTo(map);
                      </script>
                  </body>
                  </html>
                  

                  我會感謝你所有的回答

                  推薦答案

                  與 Leaflet.markercluster 一樣,您必須創建一個標記集群組,您的子組將進入該組.

                  Like for Leaflet.markercluster, you have to create a Marker Cluster Group where your sub-groups will go into.

                  在層支持的情況下,您創建一個具有層支持的標記集群組:

                  In the case of Layer Support, you create a Marker Cluster Group with Layer Support instead:

                  var mcg = L.markerClusterGroup.layerSupport().addTo(map);
                  

                  然后您簽入"子組,以便他們知道在通過圖層控件選擇它們時必須進入該聚類組而不是直接進入地圖:

                  Then you "check in" the sub-groups, so that they know they have to go into that clustering group rather than directly to the map, when they are selected through the Layers Control:

                  mcg.checkIn([
                      sitios,
                      pueblo,
                      gas
                  ]);
                  

                  演示:http://plnkr.co/edit/CT3E63AKWze34FqUoiHn?p=preview

                  注意:您應該下載 JavaScript 文件 leaflet.markercluster.layersupport-src.js(如果尚未下載),并將其放在您的 HTML 頁面旁邊,這樣它可以在本地引用它.

                  Note: you should download the JavaScript file leaflet.markercluster.layersupport-src.js, if not already done, and place it next to your HTML page, so that it can refer to it locally.

                  注意 2:如果您的使用只需要集群與 L.Control.Layers 的兼容性,您可能會對這個更簡單的插件感興趣:Leaflet.FeatureGroup.SubGroup.

                  Note 2: if your usage requires only compatibility of clustering with L.Control.Layers, you might be interested in this more simple plugin: Leaflet.FeatureGroup.SubGroup.

                  免責聲明:我是這些插件的作者.

                  Disclaimer: I am the author of these plugins.

                  這篇關于如何使用層應用傳單標記集群的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)
                  <i id='6JoPl'><tr id='6JoPl'><dt id='6JoPl'><q id='6JoPl'><span id='6JoPl'><b id='6JoPl'><form id='6JoPl'><ins id='6JoPl'></ins><ul id='6JoPl'></ul><sub id='6JoPl'></sub></form><legend id='6JoPl'></legend><bdo id='6JoPl'><pre id='6JoPl'><center id='6JoPl'></center></pre></bdo></b><th id='6JoPl'></th></span></q></dt></tr></i><div class="7p5pphz" id='6JoPl'><tfoot id='6JoPl'></tfoot><dl id='6JoPl'><fieldset id='6JoPl'></fieldset></dl></div>

                  <tfoot id='6JoPl'></tfoot>
                3. <legend id='6JoPl'><style id='6JoPl'><dir id='6JoPl'><q id='6JoPl'></q></dir></style></legend>

                          <tbody id='6JoPl'></tbody>
                      1. <small id='6JoPl'></small><noframes id='6JoPl'>

                        • <bdo id='6JoPl'></bdo><ul id='6JoPl'></ul>
                            主站蜘蛛池模板: 浙江红酒库-冰雕库-气调库-茶叶库安装-医药疫苗冷库-食品物流恒温恒湿车间-杭州领顺实业有限公司 | 呼末二氧化碳|ETCO2模块采样管_气体干燥管_气体过滤器-湖南纳雄医疗器械有限公司 | 光纤测温-荧光光纤测温系统-福州华光天锐光电科技有限公司 | 广州办公室设计,办公室装修,写字楼设计,办公室装修公司_德科 | 吹田功率计-长创耐压测试仪-深圳市新朗普电子科技有限公司 | 焦作网 WWW.JZRB.COM | 无硅导热垫片-碳纤维导热垫片-导热相变材料厂家-东莞市盛元新材料科技有限公司 | 北京印刷厂_北京印刷_北京印刷公司_北京印刷厂家_北京东爵盛世印刷有限公司 | 超声波成孔成槽质量检测仪-压浆机-桥梁预应力智能张拉设备-上海硕冠检测设备有限公司 | hdpe土工膜-防渗膜-复合土工膜-长丝土工布价格-厂家直销「恒阳新材料」-山东恒阳新材料有限公司 ETFE膜结构_PTFE膜结构_空间钢结构_膜结构_张拉膜_浙江萬豪空间结构集团有限公司 | 截齿|煤截齿|采煤机截齿|掘进机截齿|旋挖截齿-山东卓力截齿厂家报价 | 湖南自考_湖南自学考试| 电子元器件呆滞料_元器件临期库存清仓尾料_尾料优选现货采购处理交易商城 | 企业微信scrm管理系统_客户关系管理平台_私域流量运营工具_CRM、ERP、OA软件-腾辉网络 | 山东包装,山东印刷厂,济南印刷厂-济南富丽彩印刷有限公司 | 云南成考网_云南成人高考报名网 粤丰硕水性环氧地坪漆-防静电自流平厂家-环保地坪涂料代理 | 浩方智通 - 防关联浏览器 - 跨境电商浏览器 - 云雀浏览器 | 盘扣式脚手架-附着式升降脚手架-移动脚手架,专ye承包服务商 - 苏州安踏脚手架工程有限公司 | 液压扳手-高品质液压扳手供应商 - 液压扳手, 液压扳手供应商, 德国进口液压拉马 | 硬度计,金相磨抛机_厂家-莱州华煜众信试验仪器有限公司 | 德州万泰装饰 - 万泰装饰装修设计软装家居馆| 企业VI设计_LOGO设计公司_品牌商标设计_【北京美研】 | 免费分销系统 — 分销商城系统_分销小程序开发 -【微商来】 | 雷冲击高压发生器-水内冷直流高压发生器-串联谐振分压器-武汉特高压电力科技有限公司 | 消泡剂-水处理消泡剂-涂料消泡剂-切削液消泡剂价格-东莞德丰消泡剂厂家 | 2025黄道吉日查询、吉时查询、老黄历查询平台- 黄道吉日查询网 | 分轨 | 上传文件,即刻分离人声和伴奏 | 中图网(原中国图书网):网上书店,尾货特色书店,30万种特价书低至2折! | 六自由度平台_六自由度运动平台_三自由度摇摆台—南京全控科技 | 电解抛光加工_不锈钢电解抛光_常州安谱金属制品有限公司 | 储能预警-储能消防系统-电池舱自动灭火装置-四川千页科技股份有限公司官网 | CPSE安博会 | 商标转让-购买商标专业|放心的商标交易网-蜀易标商标网 | 连栋温室大棚建造厂家-智能玻璃温室-薄膜温室_青州市亿诚农业科技 | 炉门刀边腹板,焦化设备配件,焦化焦炉设备_沧州瑞创机械制造有限公司 | 对辊式破碎机-对辊制砂机-双辊-双齿辊破碎机-巩义市裕顺机械制造有限公司 | 电动高压冲洗车_价格-江苏速利达机车有限公司 | hc22_hc22价格_hc22哈氏合金—东锜特殊钢 | 逗网红-抖音网红-快手网红-各大平台网红物品导航 | 钢化玻璃膜|手机钢化膜|钢化膜厂家|手机保护膜-【东莞市大象电子科技有限公司】 | 流量卡中心-流量卡套餐查询系统_移动电信联通流量卡套餐大全 |