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

    • <bdo id='drmFK'></bdo><ul id='drmFK'></ul>
  1. <legend id='drmFK'><style id='drmFK'><dir id='drmFK'><q id='drmFK'></q></dir></style></legend>

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

      <tfoot id='drmFK'></tfoot>

      <i id='drmFK'><tr id='drmFK'><dt id='drmFK'><q id='drmFK'><span id='drmFK'><b id='drmFK'><form id='drmFK'><ins id='drmFK'></ins><ul id='drmFK'></ul><sub id='drmFK'></sub></form><legend id='drmFK'></legend><bdo id='drmFK'><pre id='drmFK'><center id='drmFK'></center></pre></bdo></b><th id='drmFK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='drmFK'><tfoot id='drmFK'></tfoot><dl id='drmFK'><fieldset id='drmFK'></fieldset></dl></div>
    1. 如何使用leaflet.js 在多個地圖圖例之間切換?

      How to switch between multiple map legends with leaflet.js?(如何使用leaflet.js 在多個地圖圖例之間切換?)
      <tfoot id='Kpi8I'></tfoot>
        <tbody id='Kpi8I'></tbody>

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

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

              1. 本文介紹了如何使用leaflet.js 在多個地圖圖例之間切換?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在使用leaflet.js 庫根據統計數據創建多個地圖.每個地圖顯示不同的值范圍,因此當用戶更改地圖時更改圖例會很好.

                I`m using leaflet.js library to create multiple maps based on statistical data. Each map displays different range of values so it would be nice to change legend when user change map.

                我在這個問題中找到了類似的例子,但我需要在兩個以上的層之間切換.我嘗試在代碼中簡單地添加更多if"語句和邏輯運算符,但它不能正常工作:

                I found similar example in this question, but I need to switch between more than two layers. I try simply add more "if" statments and logical operators in code, but it doesn`t work right:

                map.on('baselayerchange', function (eventLayer) {
                    if (eventLayer.name === 'Agricultural') {
                        map.removeControl(VODlegend || BUDlegend || LISlegend);
                        SGlegend.addTo(map);
                    }
                    else if  (eventLayer.name === 'Building') {
                        map.removeControl(SGlegend || LISlegend || VODlegend);
                        BUDlegend.addTo(map);
                    }
                    else if  (eventLayer.name === 'Forest') {
                        map.removeControl(BUDlegend || VODlegend || SGlegend);
                        LISlegend.addTo(map);
                    }
                    else if  (eventLayer.name === 'Water') {
                        map.removeControl(LISlegend || SGlegend || BUDlegend);
                        VODlegend.addTo(map);
                    }
                  })
                

                這是我在 jsfiddle 上的地圖示例.如果有任何幫助,我將不勝感激.

                Here is example of my map on jsfiddle. I would be grateful for any help.

                推薦答案

                視頻傳奇 ||BUD傳奇 ||LIS傳奇

                VODlegend || BUDlegend || LISlegend

                在 javascript 中,這是一個條件(結果為真或假)...不是您期望的列表

                In javascript, this is a condition (result is true or false) ... not a list as you expect

                你需要像這樣跟蹤你當前的控件

                You need to keep track of your current control like that

                SGlegend.addTo(map);
                currentLegend = SGlegend;
                
                
                map.on('baselayerchange', function (eventLayer) {
                    if (eventLayer.name === 'Agricultural') {
                        map.removeControl(currentLegend );
                        currentLegend = SGlegend;
                        SGlegend.addTo(map);
                    }
                    else if  (eventLayer.name === 'Building') {
                        map.removeControl(currentLegend );
                        currentLegend = BUDlegend;
                        BUDlegend.addTo(map);
                    }
                    else if  (eventLayer.name === 'Forest') {
                       map.removeControl(currentLegend );
                        currentLegend = LISlegend;
                        LISlegend.addTo(map);
                    }
                    else if  (eventLayer.name === 'Water') {
                       map.removeControl(currentLegend );
                        currentLegend = VODlegend;
                       VODlegend.addTo(map);
                    }
                  })
                

                修改后的小提琴在這里:http://jsfiddle.net/FranceImage/X678g/

                Modified fiddle is here: http://jsfiddle.net/FranceImage/X678g/

                這篇關于如何使用leaflet.js 在多個地圖圖例之間切換?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)

                  <tfoot id='8fXjL'></tfoot>
                    <bdo id='8fXjL'></bdo><ul id='8fXjL'></ul>
                      <tbody id='8fXjL'></tbody>
                  • <small id='8fXjL'></small><noframes id='8fXjL'>

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

                          <i id='8fXjL'><tr id='8fXjL'><dt id='8fXjL'><q id='8fXjL'><span id='8fXjL'><b id='8fXjL'><form id='8fXjL'><ins id='8fXjL'></ins><ul id='8fXjL'></ul><sub id='8fXjL'></sub></form><legend id='8fXjL'></legend><bdo id='8fXjL'><pre id='8fXjL'><center id='8fXjL'></center></pre></bdo></b><th id='8fXjL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8fXjL'><tfoot id='8fXjL'></tfoot><dl id='8fXjL'><fieldset id='8fXjL'></fieldset></dl></div>
                          主站蜘蛛池模板: 一区二区视频免费观看 | 欧美视频xxx| 免费一区二区三区 | 特级毛片爽www免费版 | 91精品国产日韩91久久久久久 | 久久国产精品-久久精品 | 在线中文字幕亚洲 | 亚洲视频在线一区 | 成人亚洲视频 | 欧美理论| 日本精品一区二区三区在线观看视频 | 日韩不卡一区二区 | 免费观看av | 国产精品久久久久久久久久久久冷 | 狠狠av | 国产在线一区二区三区 | 国产精品婷婷 | 在线一区视频 | 成人午夜视频在线观看 | 欧美二区在线 | 国产成人在线视频免费观看 | 成人av播放| 欧美在线观看一区 | a免费观看 | 久草青青草 | 欧美区日韩区 | 中文字幕视频三区 | 国产亚洲一区二区三区 | 亚洲一区二区三区免费观看 | 中国黄色在线视频 | 日韩成人av在线 | 亚洲高清在线观看 | 一区二区国产精品 | 欧美成人自拍 | 亚洲精品电影在线观看 | 99久久日韩精品免费热麻豆美女 | 国产在线拍偷自揄拍视频 | 拍真实国产伦偷精品 | 性一交一乱一透一a级 | 国产精品视频在 | 亚洲综合大片69999 |