james_henry_1995
Posts: 1
Joined: Thu Dec 09, 2021 2:43 pm

Loading Map into R doesn't work anymore

Hello,
I've been experimenting with the highcharter package in R. One of my favourite features is the map series. I followed the guide elaborated by Joshua Kunst on how to make different types of maps. I preivously was able to load maps using the following code:

Code: Select all

mapdata <- get_data_from_map(download_map_data("custom/world-highres.js"))
Which was simply load the map data as a dataframe, and when plotting as follows:

Code: Select all

hcmap(
  "custom/usa-and-canada",
  data = data_fake,
  value = "value",
  joinBy = c("hc-a2", "code"),
  name = "Fake data",
  dataLabels = list(enabled = TRUE, format = "{point.name}"),
  borderColor = "#FAFAFA",
  borderWidth = 0.1,
  tooltip = list(
    valueDecimals = 2,
    valuePrefix = "$",
    valueSuffix = "USD"
  )
)
(This example is from Joshua Kunst's website)

When running that code I would simply get a tiled map. Now in both instances of code I get the following error:

Code: Select all

trying URL 'https://code.highcharts.com/mapdata/custom/usa-and-canada.js'
Content type 'text/javascript' length 134466 bytes (131 KB)
downloaded 131 KB

Error: parse error: trailing garbage
          [2595,3667],[2589,3668]]]}}]};
                     (right here) ------^
>
It only started happening this afternoon. Does anyone know why?
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Loading Map into R doesn't work anymore

Hi,

Welcome to our forum and thanks for contacting us with your question!

We work as a single team across all support platforms including stack overflow. I've noticed you created a thread with the same question here:
https://stackoverflow.com/questions/702 ... arter-in-r

Please do not duplicate your topics on multiple channels, the answers are being delivered asap anyway. Please wait patiently for your answer on stack overflow.

Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Maps”