SymbolixAU / googleway

R Package for accessing and plotting Google Maps
http://symbolixau.github.io/googleway/
Other
234 stars 46 forks source link

Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError #223

Open Sinnup opened 4 years ago

Sinnup commented 4 years ago

Since days I've seen this error, but not sure why.

Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError https://developers.google.com/maps/documentation/javascript/error-messages#not-loading-api-from-google-maps-error

It used to work fine, but now it's not. Can you take a look at it? This error is shown in my firebase hosting.

dcooley commented 4 years ago

Can you provide some code I can run to reproduce this error?

jacciz commented 3 years ago

I'm getting this error as well. I have a few googlemaps and knit to HTML. The maps load fine, but a few days later it doesn't load and I get this error. The error seems to be an issue with embedding the API key? Link to knitted HTML: https://drive.google.com/file/d/1FcwXehP0T0EOt99rnJpTPXdGUz5RsOO3/view?usp=sharing

dcooley commented 3 years ago

Access is denied to that link

jacciz commented 3 years ago

Sorry, should work now.

dcooley commented 3 years ago

I don't understand waht that file is showing me - have you meant to upload raw html?

Screenshot 2021-06-03 at 7 52 12 am

jacciz commented 3 years ago

You have to download the HTML first to view it.

jacciz commented 3 years ago

I removed the HTML as the API key may have been compromised. I'm getting this error after 4 days. image

map_key <- readr::read_lines(".//data/api.txt")
googleway::set_key(key = map_key)
googleway::google_map(
                              scale_control = FALSE,
                              key = map_key,
                              map_type_control = FALSE,
                              rotate_control = FALSE,
                              fullscreen_control= FALSE,
                              street_view_control = FALSE,
                              # style = map_styles()$silver,
                              # search_box = TRUE,
                              height = 400,
                              zoom = 9)
jacciz commented 3 years ago

I do notice it works when the knitted HTML is not self-contained.

dcooley commented 3 years ago

I do notice it works when the knitted HTML is not self-contained.

Is this related to what you're asking for in #236 ?

jacciz commented 3 years ago

Not exactly related. I'm no longer getting this API error so this issue has been resolved for me. Or at least I've been able to find a suitable alternative. If the reports are self-contained, I get this error after 4 days. If not self-contained, maps work fine.

dcooley commented 3 years ago

How do you knit so the html is not self-contained?

jacciz commented 3 years ago

yaml header:

output: rmarkdown::html_document:
  toc: true
  toc_float: true
  theme: flatly
  self_contained: false
dcooley commented 3 years ago

ah yes - of course.