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

<tfoot id='0ypuS'></tfoot>

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

      <legend id='0ypuS'><style id='0ypuS'><dir id='0ypuS'><q id='0ypuS'></q></dir></style></legend>
    1. <small id='0ypuS'></small><noframes id='0ypuS'>

    2. 傳單地圖,通過按鈕獲取geojson文件的具體數據

      leaflet map, getting specific data of geojson file with button(傳單地圖,通過按鈕獲取geojson文件的具體數據)

          <bdo id='iYb6v'></bdo><ul id='iYb6v'></ul>

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

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

            <i id='iYb6v'><tr id='iYb6v'><dt id='iYb6v'><q id='iYb6v'><span id='iYb6v'><b id='iYb6v'><form id='iYb6v'><ins id='iYb6v'></ins><ul id='iYb6v'></ul><sub id='iYb6v'></sub></form><legend id='iYb6v'></legend><bdo id='iYb6v'><pre id='iYb6v'><center id='iYb6v'></center></pre></bdo></b><th id='iYb6v'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iYb6v'><tfoot id='iYb6v'></tfoot><dl id='iYb6v'><fieldset id='iYb6v'></fieldset></dl></div>
                <tbody id='iYb6v'></tbody>
              <tfoot id='iYb6v'></tfoot>
                本文介紹了傳單地圖,通過按鈕獲取geojson文件的具體數據的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在嘗試使用按鈕在我的 geojson 文件的地圖特定值 (data.geojson) 上顯示.(例如繪制只有值domaine"的地圖:violences")

                I'm triying to display on my map specific value ( data.geojson) of my geojson file with buttons. (for exemple to plot a map with only value "domaine":"violences ")

                我正在尋找一種方法,通過我的地圖上的按鈕來依賴我的數據(domaine":violences"或其他)?

                I am loocking for a way to rely my data ("domaine":"violences" or other)with a buttons on my map ?

                非常感謝您抽出寶貴時間.我的js:

                Thanks so much in advance for your time. my js:

                <script type="text/javascript">
                var map = L.map('map');
                var terrainTiles = L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.{ext}', {
                    attribution: 'Map tiles by <a >Stamen Design</a>, <a >CC BY 3.0</a> &mdash; Map data &copy; <a ,
                    subdomains: 'abcd',
                    minZoom: 0,
                    maxZoom: 20,
                    ext: 'png'
                });
                
                
                
                terrainTiles.addTo(map);
                map.setView([46.5160000, 6.6328200], 10);
                
                
                
                
                L.control.locate(location).addTo(map);
                
                function addDataToMap(data, map) {
                    var dataLayer = L.geoJson(data, {
                        onEachFeature: function(feature, layer) {
                            var popupText = "<b>" + feature.properties.nom
                                + "<br>" 
                
                                + "<small>"  + feature.properties.localite 
                                + "<br>Rue: " + feature.properties.rue + + feature.properties.num
                                + "<br>Téléphone: " + feature.properties.tel
                
                                + "<br><a href= '" + feature.properties.url + "'>Internet</a>";
                            layer.bindPopup(popupText); }
                        });
                    dataLayer.addTo(map);
                }
                
                $.getJSON("data.geojson", function(data) { addDataToMap(data, map); });
                
                </script>
                </body>
                </html>

                data.geojson

                the data.geojson

                {
                "type": "FeatureCollection",
                "features": [
                {
                "type": "Feature",
                "geometry": {
                   "type": "Point",
                   "coordinates":  [ 6.1200622,46.2106091 ]
                },
                "properties": {
                  "nom":"Centre d'entra?nement aux méthodes d'éducation active - Genève",
                  "rue":"Route des Franchises",
                  "num":"11",
                  "npa":1203,
                  "localite":"Genève",
                  "canton":"GE",
                  "tel":"022 940 17 57",
                  "url":"www.formation-cemea.ch",
                  "domaine":"formation   "
                }
                  },
                
                  {
                "type": "Feature",
                "geometry": {
                   "type": "Point",
                   "coordinates":  [ 6.1243056,46.2120426 ]
                  },
                "properties": {
                  "nom":"VIRES",
                  "rue":"Rue Ernest-Pictet ",
                  "num":"10",
                  "npa":1203,
                  "localite":"Genève",
                  "canton":"GE",
                  "tel":"022 328 44 33",
                  "url":"www.vires.ch",
                  "domaine":"violences   "
                  }
                }
                

                推薦答案

                至于打開/關閉你的類別,你可以使用 Leaflet Layers Control L.control.layers.

                As for toggling ON / OFF your categories, you could use Leaflet Layers Control L.control.layers.

                至于按類別(在您的情況下為域")對功能進行分組,請參閱我在評論中鏈接的帖子:傳單:如何從單個集合中切換 GeoJSON 功能屬性?

                As for grouping your features by category ("domaine" in your case), see the post I linked in my comment: Leaflet: How to toggle GeoJSON feature properties from a single collection?

                您甚至可以通過直接使用圖層組來稍微簡化它L.layerGroup 而不是使用中間數組.

                You could even slightly simplify it by directly using Layer Groups L.layerGroup instead of using intermediate arrays.

                var categories = {},
                    category;
                
                var layersControl = L.control.layers(null, null).addTo(map);
                
                function addDataToMap(data, map) {
                  L.geoJson(data, {
                    onEachFeature: function(feature, layer) {
                      category = feature.properties.domaine;
                      // Initialize the category layer group if not already set.
                      if (typeof categories[category] === "undefined") {
                        categories[category] = L.layerGroup().addTo(map);
                        layersControl.addOverlay(categories[category], category);
                      }
                      categories[category].addLayer(layer);
                    }
                  });
                  //dataLayer.addTo(map); // no longer add the GeoJSON layer group to the map.
                }
                
                $.getJSON("data.geojson", function(data) {
                  addDataToMap(data, map);
                });
                

                演示:https://plnkr.co/edit/H6E6q0vKwb3RPOZBWs27?p=preview

                這篇關于傳單地圖,通過按鈕獲取geojson文件的具體數據的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='YbgG5'></small><noframes id='YbgG5'>

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

                        1. <tfoot id='YbgG5'></tfoot>
                            <tbody id='YbgG5'></tbody>
                        2. 主站蜘蛛池模板: 免费成人在线网 | 日韩欧美一级精品久久 | 久草新在线 | 精品久久影院 | 亚洲精品一区久久久久久 | 亚洲巨乳自拍在线视频 | 欧美精品一区二区在线观看 | 亚洲色欧美另类 | 精品在线一区二区三区 | 一区二区三区观看视频 | 成人超碰 | 高清不卡毛片 | av手机在线免费观看 | 亚洲精品视频免费观看 | 日韩在线视频播放 | 久久久久久久久综合 | 日韩欧美一区在线 | 中文字幕av亚洲精品一部二部 | 亚洲在线视频 | 97视频精品 | 999久久久久久久久6666 | 亚洲精品免费视频 | 久久伊人精品一区二区三区 | 欧美激情久久久 | 亚洲一区视频在线 | 精品国产91 | 国产精品欧美一区二区 | 国产福利视频网站 | 亚洲毛片一区二区 | 日本免费视频 | 91精品国产一区二区三区动漫 | 欧美日韩亚洲在线 | 久久精品国产99国产 | 亚洲精品免费在线 | 国产一区二区电影 | 国产精品日韩高清伦字幕搜索 | 一本大道久久a久久精二百 国产成人免费在线 | 九九99九九精彩46 | 香蕉视频91| 蜜桃视频一区二区三区 | 春色av|