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

    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="qwawimqqmiuu" 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'>

        傳單雜食+聚類標記+過濾標記聚類組

        Leaflet omnivore + clustering markers + filtering marker cluster group(傳單雜食+聚類標記+過濾標記聚類組)
        <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="qwawimqqmiuu" 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. 本文介紹了傳單雜食+聚類標記+過濾標記聚類組的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

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

                  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.

                  感謝您的回復.

                  最好的問候.

                  桑德琳

                  編輯

                  我嘗試使用 Mapbox js 工具過濾標記集群組.

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

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

                  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過濾標記集群組":https://jsfiddle.net/sduermael78/rgoxpxwq/4/

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

                  我的項目:https://jsfiddle.net/sduermael78/1uuubmwb/42/

                  推薦答案

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

                  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);
                  

                  現在,當您想要對標記進行聚類時,它會變得稍微復雜一些(在您的情況下使用 Leaflet.markercluster 插件).但它類似于 $.getJSON 因為兩者都執行異步 AJAX 請求,并且您必須在回調中進行轉換.

                  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", 回調) 語法:

                  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/

                  編輯

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

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

                  在您的情況下,由于您想要對標記進行聚類,因此您沒有直接擁有 mapbox 要素圖層,而是擁有一個標記聚類組.

                  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 要素圖層上的過濾條件時替換該集群組的內容:

                  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);
                  

                  然后對于您的彈出窗口,您必須手動創建并綁定它,因為 mapbox 要素圖層需要您的 GeoJSON 數據才能使用 title 屬性(如果是這樣,它會自動使用該信息來填充彈出/工具提示"內容):

                  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() 刪除了該彈出窗口,因此您需要在每個 setFilterattachPopups() 函數>.

                  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/

                  這篇關于傳單雜食+聚類標記+過濾標記聚類組的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)
                    <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="qwawimqqmiuu" 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>

                          • 主站蜘蛛池模板: 91麻豆精品国产91久久久久久久久 | 欧美一级片在线观看 | 日一日操一操 | 一区二区三区中文字幕 | 久久久久国产一区二区三区不卡 | 国产二区在线播放 | 少妇一级淫片免费放播放 | 国产精品久久久亚洲 | 久久不卡视频 | 在线观看国产视频 | 伊人久久大香线 | 国产欧美三区 | 久久精品免费观看 | 一区二区三区四区免费观看 | 午夜精品久久久久久久久久久久 | 久久成人精品 | 国产一区视频在线 | 久久精品免费观看 | 中文字幕亚洲区一区二 | 一区二区久久 | 欧美九九 | 精品国产99 | 97久久精品午夜一区二区 | 九九久久免费视频 | 殴美成人在线视频 | 人妖一区 | 国产日韩欧美一区 | www日| 国产精品视频导航 | 在线免费观看a级片 | 亚洲在线| 成人不卡视频 | 国产综合精品一区二区三区 | 精品久久网 | 91欧美 | 久久久久久久电影 | 精品久久久一区 | www.久久 | 亚洲激情自拍偷拍 | 91.xxx.高清在线 | 国产乱码精品一区二区三区五月婷 |