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

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

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

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

        R Leaflet:將多個(gè)組分配給一個(gè)層以過濾數(shù)據(jù)并更改

        R Leaflet: Assign multiple groups to a layer to filter data and change column represented(R Leaflet:將多個(gè)組分配給一個(gè)層以過濾數(shù)據(jù)并更改表示的列)
        <i id='naHJ8'><tr id='naHJ8'><dt id='naHJ8'><q id='naHJ8'><span id='naHJ8'><b id='naHJ8'><form id='naHJ8'><ins id='naHJ8'></ins><ul id='naHJ8'></ul><sub id='naHJ8'></sub></form><legend id='naHJ8'></legend><bdo id='naHJ8'><pre id='naHJ8'><center id='naHJ8'></center></pre></bdo></b><th id='naHJ8'></th></span></q></dt></tr></i><div class="n9td1bh" id='naHJ8'><tfoot id='naHJ8'></tfoot><dl id='naHJ8'><fieldset id='naHJ8'></fieldset></dl></div>
      2. <legend id='naHJ8'><style id='naHJ8'><dir id='naHJ8'><q id='naHJ8'></q></dir></style></legend>

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

                <tbody id='naHJ8'></tbody>
                <bdo id='naHJ8'></bdo><ul id='naHJ8'></ul>

                • <tfoot id='naHJ8'></tfoot>

                • 本文介紹了R Leaflet:將多個(gè)組分配給一個(gè)層以過濾數(shù)據(jù)并更改表示的列的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我試圖在 R 傳單中找到一種方法來包含覆蓋按鈕,以過濾掉數(shù)據(jù)中的組.我還需要包含用于切換數(shù)據(jù)中表示的列的單選按鈕.我似乎找不到使用 addLayersControl() 函數(shù)在 R 傳單中執(zhí)行此操作的方法.

                  I am trying to find a way in R leaflet to include overlay buttons which filters out groups in the data. I also need to include radio buttons which switch the column which is being represented in the data. I can't seem to find a way to do this in R leaflet using the addLayersControl() function.

                  我最初認(rèn)為可以將多個(gè)組添加到單個(gè)圖層并使用 baseGroups 和 overlayGroups(如下面的代碼所示).然而,這并沒有達(dá)到預(yù)期的結(jié)果.如果有人可以提出另一種方法來實(shí)現(xiàn)這一目標(biāo),我將不勝感激.最好不要發(fā)亮.

                  I initial thought it would be possible to add multiple groups to a single layer and use baseGroups and overlayGroups (as seen in the code below). However, this does not achieve the desired results. I would appreciate it if someone could suggest an alternative way to achieve this. Preferably without shiny.

                  library(dplyr)
                  library(leaflet)
                  
                  data <- data.frame(Name = c("A", "A", "A", "B", "B", "C", "C", "C"),
                                     Value1 = c(12,43,54,34,23,77,44,22),
                                     Value2 = c(6,5,2,7,5,6,4,3),
                                     Lat = c(51.1, 51.6, 57.3, 52.4, 56.3, 54.3, 60.4, 49.2),
                                     Lon = c(5, -3, -2, -1, 4, 3, -5, 0))
                  data %>%
                    leaflet() %>%
                    addProviderTiles(providers$CartoDB.Positron) %>%
                    addCircles(lat=~Lat, lng=~Lon, radius = ~Value1*1000, group=c(~Name, "Value1")) %>%
                    addCircles(lat=~Lat, lng=~Lon, radius = ~Value2, group=c(~Name, "Value2")) %>%
                    addLayersControl(
                      baseGroups = c("Value1", "Value2"),
                      overlayGroups = c("A", "B", "C"),
                      options = layersControlOptions(collapsed = F)
                    )
                  

                  圖像:輸出不是我所期望的

                  推薦答案

                  下面是一個(gè)非常不優(yōu)雅和 hacky 的問題解決方案.它為每個(gè)圓圈分配一個(gè)圖層 ID,并使用一些 javascript 來確定在給定輸入復(fù)選框的情況下應(yīng)該顯示哪個(gè)圓圈.

                  Below is a very inelegant and hacky solution to the problem. It assigns a layer id to each circle and uses some javascript to determine which circle should be displayed given the input checkboxes.

                  可以在此處找到工作演示:https://rpubs.com/Jumble/leaflet_layer_control

                  A working demonstration can be found here: https://rpubs.com/Jumble/leaflet_layer_control

                  如果有人有更優(yōu)雅的解決方案,請分享.

                  Please share if anyone has a more elegant solution.

                  library(dplyr)
                  library(leaflet)
                  library(htmlwidgets)
                  
                  data <- data.frame(ID = c("1", "2","3","4","5","6","7","8"),
                                     Name = c("A", "A", "A", "B", "B", "C", "C", "C"),
                                     Value1 = c(12,43,54,34,23,77,44,22),
                                     Value2 = c(6,5,2,7,5,6,4,3),
                                     Lat = c(51.1, 51.6, 57.3, 52.4, 56.3, 54.3, 60.4, 49.2),
                                     Lon = c(5, -3, -2, -1, 4, 3, -5, 0))
                  data %>%
                    leaflet() %>%
                    addProviderTiles(providers$CartoDB.Positron) %>%
                    addCircles(lat=~Lat, lng=~Lon, radius = ~Value1*1000, group=~Name, label=~Name, popup=~as.character(Value1), layerId = ~paste(ID,"Value1", sep="")) %>%
                    addCircles(lat=~Lat, lng=~Lon, radius = ~Value2, group=~Name, label=~Name, popup=~as.character(Value2), layerId = ~paste(ID,"Value2", sep="")) %>%
                    addLayersControl(
                      baseGroups = c("Value1", "Value2"),
                      overlayGroups = c("A", "B", "C"),
                      options = layersControlOptions(collapsed = F)
                    ) %>%
                    htmlwidgets::onRender("
                      function(el, x) {
                        var myMap = this;
                        var baseLayer = 'Value1';
                        myMap.eachLayer(function(layer){
                          var id = layer.options.layerId;
                          if (id){
                            if ('Value1' !== id.substring(1,)){
                              layer.getElement().style.display = 'none';
                            }
                          }
                        })
                        console.log(myMap.baselayer);
                        myMap.on('baselayerchange',
                          function (e) {
                            baseLayer=e.name;
                            myMap.eachLayer(function (layer) {
                                var id = layer.options.layerId;
                                if (id){
                                  if (e.name !== id.substring(1,)){
                                    layer.getElement().style.display = 'none';
                                    layer.closePopup();
                                  }
                                  if (e.name === id.substring(1,)){
                                    layer.getElement().style.display = 'block';
                                  }
                                }
                  
                            });
                          })
                          myMap.on('overlayadd', function(e){
                            myMap.eachLayer(function(layer){
                              var id = layer.options.layerId;
                              if (id){
                                  if (baseLayer !== id.substring(1,)){
                                    layer.getElement().style.display = 'none';
                                  }
                              }    
                            })
                          })
                      }")
                  

                  這篇關(guān)于R Leaflet:將多個(gè)組分配給一個(gè)層以過濾數(shù)據(jù)并更改表示的列的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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è)邊欄)

                  <legend id='pS1iW'><style id='pS1iW'><dir id='pS1iW'><q id='pS1iW'></q></dir></style></legend>
                    <tbody id='pS1iW'></tbody>
                  <tfoot id='pS1iW'></tfoot>

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

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

                        1. <i id='pS1iW'><tr id='pS1iW'><dt id='pS1iW'><q id='pS1iW'><span id='pS1iW'><b id='pS1iW'><form id='pS1iW'><ins id='pS1iW'></ins><ul id='pS1iW'></ul><sub id='pS1iW'></sub></form><legend id='pS1iW'></legend><bdo id='pS1iW'><pre id='pS1iW'><center id='pS1iW'></center></pre></bdo></b><th id='pS1iW'></th></span></q></dt></tr></i><div class="zltntzt" id='pS1iW'><tfoot id='pS1iW'></tfoot><dl id='pS1iW'><fieldset id='pS1iW'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 雪花制冰机(实验室雪花制冰机)百科| PAS糖原染色-CBA流式多因子-明胶酶谱MMP-上海研谨生物科技有限公司 | 臭氧灭菌箱-油桶加热箱-原料桶加热融化烘箱-南京腾阳干燥设备厂 臭氧发生器_臭氧消毒机 - 【同林品牌 实力厂家】 | 路面机械厂家 | 越南专线物流_东莞国际物流_东南亚专线物流_行通物流 | 上海律师事务所_上海刑事律师免费咨询平台-煊宏律师事务所 | 123悬赏网_发布悬赏任务_广告任务平台 | 塑木弯曲试验机_铜带拉伸强度试验机_拉压力测试台-倾技百科 | SF6环境监测系统-接地环流在线监测装置-瑟恩实业 | 安徽净化工程设计_无尘净化车间工程_合肥净化实验室_安徽创世环境科技有限公司 | 农业仪器网 - 中国自动化农业仪器信息交流平台| 有机废气处理-rto焚烧炉-催化燃烧设备-VOC冷凝回收装置-三梯环境 | 网站建设-高端品牌网站设计制作一站式定制_杭州APP/微信小程序开发运营-鼎易科技 | 东莞海恒试验仪器设备有限公司| 辐射仪|辐射检测仪|辐射巡测仪|个人剂量报警仪|表面污染检测仪|辐射报警仪|辐射防护网 | IPO咨询公司-IPO上市服务-细分市场研究-龙马咨询 | 欧盟ce检测认证_reach检测报告_第三方检测中心-深圳市威腾检验技术有限公司 | 集菌仪_智能集菌仪_全封闭集菌仪_无菌检查集菌仪厂家-那艾 | 企业微信营销_企业微信服务商_私域流量运营_艾客SCRM官网 | 新疆散热器,新疆暖气片,新疆电锅炉,光耀暖通公司 | 西门子代理商_西门子变频器总代理-翰粤百科 | 软文推广发布平台_新闻稿件自助发布_媒体邀约-澜媒宝 | 在线浊度仪_悬浮物污泥浓度计_超声波泥位计_污泥界面仪_泥水界面仪-无锡蓝拓仪表科技有限公司 | 动物麻醉机-数显脑立体定位仪-北京易则佳科技有限公司 | 锂电池生产厂家-电动自行车航模无人机锂电池定制-世豹新能源 | 乐泰胶水_loctite_乐泰胶_汉高乐泰授权(中国)总代理-鑫华良供应链 | 电采暖锅炉_超低温空气源热泵_空气源热水器-鑫鲁禹电锅炉空气能热泵厂家 | 台式恒温摇床价格_大容量恒温摇床厂家-上海量壹科学仪器有限公司 | 布袋除尘器|除尘器设备|除尘布袋|除尘设备_诺和环保设备 | 打造全球沸石生态圈 - 国投盛世| 耐酸泵,耐腐蚀真空泵,耐酸真空泵-淄博华舜耐腐蚀真空泵有限公司 精密模具-双色注塑模具加工-深圳铭洋宇通 | 无硅导热垫片-碳纤维导热垫片-导热相变材料厂家-东莞市盛元新材料科技有限公司 | 浙江华锤电器有限公司_地磅称重设备_防作弊地磅_浙江地磅售后维修_无人值守扫码过磅系统_浙江源头地磅厂家_浙江工厂直营地磅 | 【铜排折弯机,钢丝折弯成型机,汽车发泡钢丝折弯机,线材折弯机厂家,线材成型机,铁线折弯机】贝朗折弯机厂家_东莞市贝朗自动化设备有限公司 | 活性氧化铝球|氧化铝干燥剂|分子筛干燥剂|氢氧化铝粉-淄博同心材料有限公司 | 伶俐嫂培训学校_月嫂培训班在哪里报名学费是多少_月嫂免费政府培训中心推荐 | 顺景erp系统_erp软件_erp软件系统_企业erp管理系统-广东顺景软件科技有限公司 | 菏泽商标注册_菏泽版权登记_商标申请代理_菏泽商标注册去哪里 | 防渗土工膜|污水处理防渗膜|垃圾填埋场防渗膜-泰安佳路通工程材料有限公司 | 安全光栅|射频导纳物位开关|音叉料位计|雷达液位计|两级跑偏开关|双向拉绳开关-山东卓信机械有限公司 | 安全阀_弹簧式安全阀_美标安全阀_工业冷冻安全阀厂家-中国·阿司米阀门有限公司 |