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

    1. <legend id='Lznhy'><style id='Lznhy'><dir id='Lznhy'><q id='Lznhy'></q></dir></style></legend>

    2. <tfoot id='Lznhy'></tfoot>

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

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

        傳單雜食+聚類標(biāo)記+過濾標(biāo)記聚類組

        Leaflet omnivore + clustering markers + filtering marker cluster group(傳單雜食+聚類標(biāo)記+過濾標(biāo)記聚類組)
        <legend id='r59xo'><style id='r59xo'><dir id='r59xo'><q id='r59xo'></q></dir></style></legend>
        <i id='r59xo'><tr id='r59xo'><dt id='r59xo'><q id='r59xo'><span id='r59xo'><b id='r59xo'><form id='r59xo'><ins id='r59xo'></ins><ul id='r59xo'></ul><sub id='r59xo'></sub></form><legend id='r59xo'></legend><bdo id='r59xo'><pre id='r59xo'><center id='r59xo'></center></pre></bdo></b><th id='r59xo'></th></span></q></dt></tr></i><div class="9rjpv9h" id='r59xo'><tfoot id='r59xo'></tfoot><dl id='r59xo'><fieldset id='r59xo'></fieldset></dl></div>

        • <bdo id='r59xo'></bdo><ul id='r59xo'></ul>
          <tfoot id='r59xo'></tfoot>
            <tbody id='r59xo'></tbody>

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

                1. 本文介紹了傳單雜食+聚類標(biāo)記+過濾標(biāo)記聚類組的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我嘗試使用 Mapbox 和 Leafet 的雜食插件制作地圖,以便使用教程搜索數(shù)據(jù).在我的情況下,我不知道如何從雜食插件中集成此代碼.我為我的數(shù)據(jù)使用 geojson url $.getJSON,使用 Leaflet 的 MarkerCluster 聚類標(biāo)記.

                  I try to make a map with mapbox and omnivore plugin of Leafet in order to search a data with the tutorial. I don't know how integrate this code from omnivore plugin in my case. I use for my datas a geojson url $.getJSON, clustering markers with MarkerCluster of Leaflet.

                  感謝您的回復(fù).

                  最好的問候.

                  桑德琳

                  編輯

                  我嘗試使用 Mapbox js 工具過濾標(biāo)記集群組.

                  I try to filter marker cluster group with Mapbox js tool.

                  效果很好,但我想將此功能插入到我的項(xiàng)目中.但我不知道如何使用其他功能:雜食插件,搜索數(shù)據(jù),顯示彈出窗口,標(biāo)記集群組.你能幫幫我嗎?

                  It works very well but I would like to insert this feature to my project. But I don't know how to make with the other features : omnivore plugin, search the data, displaying the popup, marker cluster group. Could you help me ?

                  我的 js Fiddle過濾標(biāo)記集群組":https://jsfiddle.net/sduermael78/rgoxpxwq/4/

                  My js Fiddle "filtering marker cluster group" : https://jsfiddle.net/sduermael78/rgoxpxwq/4/

                  我的項(xiàng)目:https://jsfiddle.net/sduermael78/1uuubmwb/42/

                  推薦答案

                  您目前通過 jQuery $.getJSON 和直接從您的 mapbox 帳戶加載數(shù)據(jù).

                  You currently load your data through both jQuery $.getJSON and directly from your mapbox account.

                  那么如果我的理解是正確的,你想用 leaflet-omnivore 插件?

                  Then if my understanding is correct, you would like to replace these methods by using leaflet-omnivore plugin?

                  直接替換非常簡單,您可以直接使用:

                  Direct replacement is quite straight forward, as you could directly use:

                  var geojsonLayer = omnivore.geojson("filePath", null, L.mapbox.featureLayer());
                  geojsonLayer.addTo(map);
                  

                  現(xiàn)在,當(dāng)您想要對(duì)標(biāo)記進(jìn)行聚類時(shí),它會(huì)變得稍微復(fù)雜一些(在您的情況下使用 Leaflet.markercluster 插件).但它類似于 $.getJSON 因?yàn)閮烧叨紙?zhí)行異步 AJAX 請(qǐng)求,并且您必須在回調(diào)中進(jìn)行轉(zhuǎn)換.

                  Now it becomes slightly more complicated when you want to cluster your markers (using Leaflet.markercluster plugin in your case). But it is similar to $.getJSON since both perform an asynchronous AJAX request, and you have to make the conversion in a callback.

                  使用 Leaflet-omnivore,您可以使用 .on("ready", 回調(diào)) 語法:

                  With leaflet-omnivore, you use the .on("ready", callback) syntax:

                  var geojsonLayer = omnivore.geojson("filePath", null, L.mapbox.featureLayer())
                    .on("ready", function() {
                      var markers = L.markerClusterGroup();
                      markers.addLayer(geojsonLayer);
                      markers.addTo(mymap);
                    });
                  

                  更新的 JSFiddle:https://jsfiddle.net/1uuubmwb/39/

                  Updated JSFiddle: https://jsfiddle.net/1uuubmwb/39/

                  編輯

                  好的,我錯(cuò)過了您在教程中想要搜索數(shù)據(jù)"的部分,如您指向的 mapbox 中所做的那樣.

                  OK I missed your part where you "want to search the data" as done in the tutorial from mapbox you point to.

                  在您的情況下,由于您想要對(duì)標(biāo)記進(jìn)行聚類,因此您沒有直接擁有 mapbox 要素圖層,而是擁有一個(gè)標(biāo)記聚類組.

                  In your case it is more complicated as you want to cluster your markers, so you do not directly have your mapbox feature layer, but a marker cluster group.

                  解決方法是每次更改 geojsonLayer mapbox 要素圖層上的過濾條件時(shí)替換該集群組的內(nèi)容:

                  A workaround would be to replace the content of that cluster group everytime you change the filtering condition on your geojsonLayer mapbox feature layer:

                  // this will "hide" markers that do not match the filter.
                  geojsonLayer.setFilter(showCode);
                  
                  // replace the content of marker cluster group.
                  markers.clearLayers();
                  markers.addLayer(geojsonLayer);
                  

                  然后對(duì)于您的彈出窗口,您必須手動(dòng)創(chuàng)建并綁定它,因?yàn)?mapbox 要素圖層需要您的 GeoJSON 數(shù)據(jù)才能使用 title 屬性(如果是這樣,它會(huì)自動(dòng)使用該信息來填充彈出/工具提示"內(nèi)容):

                  Then for your popup, you have to create it and bind it manually, as mapbox feature layer needs your GeoJSON data to use the title attribute (if so, it automatically uses that info to fill the popup / "tooltip" content):

                  function attachPopups() {
                    // Create popups.
                      geojsonLayer.eachLayer(function (layer) {
                        var props = layer.feature.properties;
                  
                        layer.bindPopup(
                          "<b>Code unité&nbsp;:</b> " + props.CODE_UNITE + "<br />" +
                          "<b>Adresse web&nbsp;:</b> <a href='" + props.ADRESSE_WEB + "' target='_blank'>" + props.ADRESSE_WEB + "</a>"
                        );
                      });
                  }
                  

                  不幸的是,看起來 .setFilter() 刪除了該彈出窗口,因此您需要在每個(gè) setFilterattachPopups() 函數(shù)>.

                  Unfortunately, it looks like .setFilter() removes that popup, so you would need to call this attachPopups() function after every setFilter.

                  演示:https://jsfiddle.net/1uuubmwb/40/

                  這篇關(guān)于傳單雜食+聚類標(biāo)記+過濾標(biāo)記聚類組的文章就介紹到這了,希望我們推薦的答案對(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è)邊欄)
                    <bdo id='Zd5Ex'></bdo><ul id='Zd5Ex'></ul>

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

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

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

                    <tfoot id='Zd5Ex'></tfoot>

                          • 主站蜘蛛池模板: 珠光砂保温板-一体化保温板-有釉面发泡陶瓷保温板-杭州一体化建筑材料 | 旅游规划_旅游策划_乡村旅游规划_景区规划设计_旅游规划设计公司-北京绿道联合旅游规划设计有限公司 | 压片机_高速_单冲_双层_花篮式_多功能旋转压片机-上海天九压片机厂家 | 南京泽朗生物科技有限公司| 恒温槽_恒温水槽_恒温水浴槽-上海方瑞仪器有限公司 | 上海冠顶工业设备有限公司-隧道炉,烘箱,UV固化机,涂装设备,高温炉,工业机器人生产厂家 | 自恢复保险丝_贴片保险丝_力特保险丝_Littelfuse_可恢复保险丝供应商-秦晋电子 | 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 | 国际船舶网 - 船厂、船舶、造船、船舶设备、航运及海洋工程等相关行业综合信息平台 | 石膏基自流平砂浆厂家-高强石膏基保温隔声自流平-轻质抹灰石膏粉砂浆批发-永康市汇利建设有限公司 | 橡胶接头_橡胶软接头_套管伸缩器_管道伸缩器厂家-巩义市远大供水材料有限公司 | 铜镍-康铜-锰铜-电阻合金-NC003 - 杭州兴宇合金有限公司 | 纳米涂料品牌 防雾抗污纳米陶瓷涂料厂家_虹瓷科技 | 郑州爱婴幼师学校_专业幼师培训_托育师培训_幼儿教育培训学校 | TwistDx恒温扩增-RAA等温-Jackson抗体-默瑞(上海)生物科技有限公司 | AGV叉车|无人叉车|AGV智能叉车|AGV搬运车-江西丹巴赫机器人股份有限公司 | 拖链电缆_柔性电缆_伺服电缆_坦克链电缆-深圳市顺电工业电缆有限公司 | 美甲贴片-指甲贴片-穿戴美甲-假指甲厂家--薇丝黛拉 | 照相馆预约系统,微信公众号摄影门店系统,影楼管理软件-盟百网络 | 污水提升器,污水提升泵,污水提升装置-德国泽德(zehnder)水泵系统有限公司 | 欧必特空气能-商用空气能热水工程,空气能热水器,超低温空气源热泵生产厂家-湖南欧必特空气能公司 | 台湾阳明固态继电器-奥托尼克斯光电传感器-接近开关-温控器-光纤传感器-编码器一级代理商江苏用之宜电气 | 轴承振动测量仪电箱-轴承测振动仪器-测试仪厂家-杭州居易电气 | 精密机械零件加工_CNC加工_精密加工_数控车床加工_精密机械加工_机械零部件加工厂 | 苏州西朗门业-欧盟CE|莱茵UL双认证的快速卷帘门品牌厂家 | 海水晶,海水素,海水晶价格-潍坊滨海经济开发区强隆海水晶厂 | 施工电梯_齿条货梯_烟囱电梯_物料提升机-河南大诚机械制造有限公司 | 护栏打桩机-打桩机厂家-恒新重工 | 香港新时代国际美容美发化妆美甲培训学校-26年培训经验,值得信赖! | 电子巡更系统-巡检管理系统-智能巡检【金万码】 | 专业生产动态配料系统_饲料配料系统_化肥配料系统等配料系统-郑州鑫晟重工机械有限公司 | 档案密集架,移动密集架,手摇式密集架,吉林档案密集架-厂家直销★价格公道★质量保证 | 航空连接器,航空插头,航空插座,航空接插件,航插_深圳鸿万科 | 影视模板素材_原创专业影视实拍视频素材-8k像素素材网 | 高压贴片电容|贴片安规电容|三端滤波器|风华电容代理南京南山 | 渣油泵,KCB齿轮泵,不锈钢齿轮泵,重油泵,煤焦油泵,泊头市泰邦泵阀制造有限公司 | lcd条形屏-液晶长条屏-户外广告屏-条形智能显示屏-深圳市条形智能电子有限公司 | 石家庄网站建设|石家庄网站制作|石家庄小程序开发|石家庄微信开发|网站建设公司|网站制作公司|微信小程序开发|手机APP开发|软件开发 | 内六角扳手「厂家」-温州市威豪五金工具有限公司| KBX-220倾斜开关|KBW-220P/L跑偏开关|拉绳开关|DHJY-I隔爆打滑开关|溜槽堵塞开关|欠速开关|声光报警器-山东卓信有限公司 | 铝合金电阻-无源谐波滤波器-上海稳达电讯设备厂|