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

  • <small id='fUdhI'></small><noframes id='fUdhI'>

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

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

        在 R 中自定義傳單彈出窗口

        Customizing leaflet popup in R(在 R 中自定義傳單彈出窗口)

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

            • <small id='LcUKP'></small><noframes id='LcUKP'>

                  <tbody id='LcUKP'></tbody>
                1. 本文介紹了在 R 中自定義傳單彈出窗口的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在使用 RStudio 創(chuàng)建一個等值線傳單地圖.我在導(dǎo)入到 R 的 shapefile 中有 Country 和 Url 作為屬性.

                  我希望在最終地圖的彈出窗口中將國家名稱和 URL 顯示為超鏈接.

                  以下是我目前使用的代碼:

                  m <- world_shapefiles %>%傳單() %>%addProviderTiles(providers$Esri.WorldStreetMap) %>%添加多邊形(標(biāo)簽=?國家,labelOptions = labelOptions(style = list("font-weight" = "normal", padding = "3px 8px", textsize = "15px",方向=自動")),popup = ~ paste("國家:", 國家, "<br/>","<b/>","URL:", url))

                  我想在彈出窗口中看到文本單擊此處"而不是整個 url,我嘗試使用以下代碼但沒有成功.

                  popup = ~ paste("Country:", counry, "<br/>","<b/>","URL:", "<b><a href=url>點(diǎn)擊這里</a></b>")

                  有什么想法可以實(shí)現(xiàn)嗎?

                  解決方案

                  概覽

                  看完

                  # 加載必要的包圖書館(傳單)圖書館(SF)# 下載壓縮文件下載文件(url = "http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip", destfile = "TM_WORLD_BORDERS-0.3.zip")# 解壓解壓縮(zipfile =TM_WORLD_BORDERS-0.3.zip")# 轉(zhuǎn)換為 sf世界.邊界 <-read_sf(dsn = getwd(),層=TM_WORLD_BORDERS-0.3")# 添加每個國家的維基百科頁面world.borders$wiki <-paste0("https://en.wikipedia.org/wiki/", world.borders$NAME)# 制作傳單地圖我的.map <-傳單(選項(xiàng)=傳單選項(xiàng)(minZoom = 2))%>%setMaxBounds(lng1 = -180, lat1 = -89.98155760646617, lng2 = 180, lat2 = 89.99346179538875 ) %>%addTiles(urlTemplate = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}")%>%addPolygons(數(shù)據(jù) = world.borders, 填充 = "#D24618", 顏色 = "#D24618", 不透明度 = 0.5, 填充不透明度 = 0.01, 重量 = 3, 彈出 = paste0(<b>國家:</b>", world.borders$NAME, "<br>", "

                  I am using RStudio to create a choropleth leaflet map. I have Country and Url as an attribute in the shapefile that I imported to R.

                  I wish to show the Country name and URL as a hyperlink within the popup of the final map.

                  Below is the code I have used so far:

                  m <- world_shapefiles %>%
                    leaflet() %>%
                    addProviderTiles(providers$Esri.WorldStreetMap) %>%      
                    addPolygons( 
                        label=~country, 
                              labelOptions = labelOptions(style = list("font-weight" = "normal", padding = "3px 8px", textsize = "15px",
                  direction = "auto")), 
                                popup = ~ paste("Country:", country, "<br/>","<b/>","URL:", url)
                  )
                  

                  I want to see the text "Click here" instead of the entire url in the popup, I tried using the below code with no luck.

                  popup = ~ paste("Country:", counry, "<br/>","<b/>","URL:", "<b><a href=url>Click Here</a></b>")
                  

                  Any ideas to achieve it?

                  解決方案

                  Overview

                  After reading R, leaflet package, Passing a character vector of HTML tags to popups?, here's how you would modify your existing code:

                  # it seems ~ doesn't work inside of the paste0() function
                  # which is why I accessed the variables through the $
                  popup = paste0( "Country:"
                                   , world_shapefiles$country 
                                   , "<br>"
                                   , "<a href='"
                                   , world_shapefiles$url
                                   , "' target='_blank'>"
                                   , "Click Here</a>"
                                 )
                  

                  Reproducible Example

                  I use the World Borders Data Set to download shapefiles for each country in the world. I then add a Wikipedia URL for each country in the data set.

                  # load necessary packages
                  library( leaflet )
                  library( sf )
                  
                  # download zip file
                  download.file(
                    url = "http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip"
                    , destfile = "TM_WORLD_BORDERS-0.3.zip"
                  )
                  
                  # unzip 
                  unzip( zipfile = "TM_WORLD_BORDERS-0.3.zip" )
                  
                  # transfrom to sf
                  world.borders <-
                    read_sf( dsn = getwd()
                             , layer = "TM_WORLD_BORDERS-0.3" )
                  
                  # add the wikipedia page for each country
                  world.borders$wiki <-
                    paste0( "https://en.wikipedia.org/wiki/", world.borders$NAME )
                  
                  # make leaflet map
                  my.map <-
                    leaflet( options = leafletOptions( minZoom = 2 ) ) %>%
                    setMaxBounds( lng1 = -180
                                  , lat1 = -89.98155760646617
                                  , lng2 = 180
                                  , lat2 = 89.99346179538875 ) %>%
                    addTiles( urlTemplate = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}" ) %>%
                    addPolygons( data = world.borders
                                 , fill = "#D24618"
                                 , color = "#D24618"
                                 , opacity = 0.5
                                 , fillOpacity = 0.01
                                 , weight = 3
                                 , popup = paste0(
                                   "<b>Country: </b>"
                                   , world.borders$NAME
                                   , "<br>"
                                   , "<a href='"
                                   , world.borders$wiki
                                   , "' target='_blank'>"
                                   , "Click Here to View Wiki</a>"
                                 )
                                 , label = ~NAME
                                 , labelOptions = labelOptions(
                                   style = list("font-weight" = "normal"
                                                , padding = "3px 8px"
                                                , textsize = "15px"
                                                , direction = "auto" ) )
                                 , highlightOptions = highlightOptions( 
                                   color = "#10539A"
                                   , weight = 3
                                   , fillColor = NA
                                 ))
                  
                  # display map
                  my.map
                  
                  # end of script #
                  

                  這篇關(guān)于在 R 中自定義傳單彈出窗口的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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(檢查一個多邊形點(diǎn)是否在傳單中的另一個內(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='dTNs7'></bdo><ul id='dTNs7'></ul>
                    <i id='dTNs7'><tr id='dTNs7'><dt id='dTNs7'><q id='dTNs7'><span id='dTNs7'><b id='dTNs7'><form id='dTNs7'><ins id='dTNs7'></ins><ul id='dTNs7'></ul><sub id='dTNs7'></sub></form><legend id='dTNs7'></legend><bdo id='dTNs7'><pre id='dTNs7'><center id='dTNs7'></center></pre></bdo></b><th id='dTNs7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dTNs7'><tfoot id='dTNs7'></tfoot><dl id='dTNs7'><fieldset id='dTNs7'></fieldset></dl></div>
                    <legend id='dTNs7'><style id='dTNs7'><dir id='dTNs7'><q id='dTNs7'></q></dir></style></legend>
                    • <tfoot id='dTNs7'></tfoot>
                        <tbody id='dTNs7'></tbody>

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

                            主站蜘蛛池模板: 国产一区二区三区不卡av | 亚洲精品视频二区 | 日韩三级在线观看 | 日韩视频在线免费观看 | 久久久久网站 | 久久久精品高清 | 成人在线h| 久久久999国产精品 中文字幕在线精品 | 国产精品久久久久久二区 | 欧美成人免费电影 | 国产精品久久久久久一级毛片 | 欧美黑人国产人伦爽爽爽 | 欧美午夜一区 | 91精品久久久久久久久中文字幕 | 男女免费在线观看视频 | a久久久久久 | 国产成人精品一区二区三区视频 | 亚洲午夜av久久乱码 | 成人不卡| 亚洲免费网站 | 成人免费共享视频 | 国内久久 | 免费天天干 | 日韩一区二区三区在线播放 | 亚洲成人免费网址 | 中文字幕日韩一区 | 国产一区二区在线视频 | 亚洲在线免费观看 | 午夜在线观看视频 | 雨宫琴音一区二区在线 | 91亚洲欧美 | 精品久久一区 | 久久免费精品 | 成人99 | 亚洲v区 | 午夜影院 | 国内精品视频 | 日韩一区二区三区精品 | 亚洲国产欧美91 | 国产在线一区二区三区 | 日韩美女一区二区三区在线观看 |