У меня есть блестящее приложение с HTML build ui
ourLocation <- leaflet() %>%
addProviderTiles("CartoDB.Voyager")%>%
setView(lng =someValue, lat = someValue, zoom = 16)%>%
addMarkers(lng =someValue, lat = someValue, popup = "We are here:)")
server <- function(input, output, session) {
output$map <-
renderLeaflet({
ourLocation
})
}
shinyApp(ui = htmlTemplate("www/index.html"), server)
Также я помещаю вывод в свой html:
<div id="map" style="width:100%; height:400px; " class="leaflet html-widget html-widget-output"></div>
Головная часть моего html
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/css/all.min.css" integrity="sha256-46r060N2LrChLLb5zowXQ72/iKKNiw/lAmygmHExk/o=" crossorigin="anonymous" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="utility.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="application/shiny-singletons"></script>
<script type="application/html-dependencies">json2[2014.02.04];jquery[3.4.1];shiny[1.4.0.2];htmlwidgets[1.5.1];leaflet[1.3.1];leafletfix[1.0.0];Proj4Leaflet[1.0.1];rstudio_leaflet[1.3.1];leaflet-binding[2.0.3];bootstrap[3.4.1]</script>
<script src="shared/json2-min.js"></script>
<script src="shared/jquery.min.js"></script>
<link href="shared/shiny.css" rel="stylesheet" />
<script src="shared/shiny.min.js"></script>
<script src="htmlwidgets-1.5.1/htmlwidgets.js"></script>
<link href="leaflet-1.3.1/leaflet.css" rel="stylesheet" />
<script src="leaflet-1.3.1/leaflet.js"></script>
<link href="leafletfix-1.0.0/leafletfix.css" rel="stylesheet" />
<script src="Proj4Leaflet-1.0.1/proj4-compressed.js"></script>
<script src="Proj4Leaflet-1.0.1/proj4leaflet.js"></script>
<link href="rstudio_leaflet-1.3.1/rstudio_leaflet.css" rel="stylesheet" />
<script src="leaflet-binding-2.0.3/leaflet.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
Но это не работает. Есть идеи, как это сделать?