My setup: I am using two selectizeInputs
togehter with hcmap()
in order to display a world map (this one custom/world-palestine-highres) where users can change the institute and the variable they want to look at. Hence, the map gets rendered often!
In this process, I downloaded the map multiple times via testing/rendering the app till I found the options(highcharter.download_map_data = FALSE)
while browsing through your repository - the vignette on how to use download_map_data
is not that clear tbh. However, now the map gets rendered without downloading itself again --> perfect!
Now to my question: Where does the map get stored on the server when downloaded the first time? Because with my current setup, no user will download the map again (which is what I want), but what if we have to restart the server or move files? I just want to make sure that I dont have to service the app all the time in regards to map downloads.
EDIT#1: Code samples for JBKunst, as the new code doesn't show any data
My hcmap code I used before:
hcmap("custom/world-palestine-highres", data = datapool_credit, joinBy = c("hc-a2", "Country"), value = capital_variable,
name = capital_variable,
dataLabels = list(enabled = TRUE, format = '{point.name}'),
borderColor = "#FAFAFA", borderWidth = 0.1,
tooltip = list(valueDecimals = 0, valuePrefix = "€", valueSuffix = "")) %>%
hc_mapNavigation(enabled = TRUE)
The new code as suggested by JBKunst:
highchart(type = "map") %>%
hc_add_series(
mapData = JS("Highcharts.maps['custom/world-palestine-highres']"),
data = datapool_credit, joinBy = c("hc-key"), joinBy = c("hc-a2", "Country"), value = capital_variable,
name = capital_variable,
dataLabels = list(enabled = TRUE, format = '{point.name}'),
borderColor = "#FAFAFA", borderWidth = 0.1,
tooltip = list(valueDecimals = 0, valuePrefix = "€", valueSuffix = "")) %>%
hc_mapNavigation(enabled = TRUE)
EDIT#2: structure of used data for the map (changed the numbers for data privacy reasons, but not the format)
> dput(head(datapool_credit))
structure(list(Country = c("AE", "AF", "AL", "AM", "AO", "AQ"
), PD = c(0.506010018321176, 64.350505, 8.94600128868667, 14.29401046096271,
25.0439479, 3.5626)), .Names = c("Country", "PD"), class = c("data.table",
"data.frame"), row.names = c(NA, -6L), .internal.selfref = <pointer: 0x244ccb8>)
Best regards, Martin