第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 R Leaflet 中實(shí)現(xiàn)一個(javascript)插件

在 R Leaflet 中實(shí)現(xiàn)一個(javascript)插件

慕碼人2483693 2023-02-23 10:05:52
我正在用 R 構(gòu)建 Leaflet 應(yīng)用程序。我想使用這個插件https://github.com/Turbo87/leaflet-sidebar 但是,我不知道從哪里開始。在 R 中實(shí)現(xiàn) Javascript Leaflet 插件的指南無法提供幫助。有沒有人有我可以遵循的任何步驟/指導(dǎo)/代碼來在我的 R Leaflet 中實(shí)現(xiàn)插件?任何幫助將不勝感激。這是我目前所在的位置:sidebarPlugin <- htmlDependency("leaflet-sidebar", "0.2.0",                            src = c(href = "https://github.com/Turbo87/leaflet-sidebar.git"),                            script = "src/L.Control.Sidebar.js")registerPlugin <- function(map, plugin) {  map$dependencies <- c(map$dependencies, list(plugin))  map}testLeaflet <- leaflet() %>%  addTiles %>%  addPolylines(data = dijkjson)%>%  #register plugin on this map instance  registerPlugin(sidebarPlugin)%>%  addControl("Test2", position = "topright")%>%  # Add your custom JS logic here. The `this` keyword  # refers to the Leaflet (JS) map object.  onRender("function(el, x) {       var sidebar = L.control.sidebar('sidebar', {       position: 'left'}).addTo(this);       map.addControl(sidebar).addTo(this);       sidebar.show().addTo(this);       }")
查看完整描述

1 回答

?
冉冉說

TA貢獻(xiàn)1877條經(jīng)驗(yàn) 獲得超1個贊

也許你還沒有解決你的問題。第一步是確保您的 htmlDependency 源確實(shí)存在。根據(jù)您的路徑,我得到以下響應(yīng):{"error":"Not Found"}

jsdelivr以 application/javascript 格式提供大多數(shù)可通過 npm 和 github 獲得的 js 庫。使用它而不是你可以嘗試的原始 github 路徑:

sidebarPlugin <- htmltools::htmlDependency("L.Control.Sidebar", "0.2.1",
                            src = c(href = 'https://cdn.jsdelivr.net/gh/Turbo87/leaflet-sidebar@0.2.1/src'), 
                            script = 'L.Control.Sidebar.js', stylesheet = 'L.Control.Sidebar.css')



查看完整回答
反對 回復(fù) 2023-02-23
  • 1 回答
  • 0 關(guān)注
  • 97 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號