Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError #223

Open
Sinnup opened this issue Jul 22, 2020 · 13 comments
Open

Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError #223

Sinnup opened this issue Jul 22, 2020 · 13 comments

Comments

@Sinnup
Copy link

Sinnup commented Jul 22, 2020

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
Copy link
Collaborator

dcooley commented Jul 22, 2020

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

@jacciz
Copy link

jacciz commented Jun 2, 2021

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
Copy link
Collaborator

dcooley commented Jun 2, 2021

Access is denied to that link

@jacciz
Copy link

jacciz commented Jun 2, 2021

Sorry, should work now.

@dcooley
Copy link
Collaborator

dcooley commented Jun 2, 2021

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
Copy link

jacciz commented Jun 2, 2021

You have to download the HTML first to view it.

@jacciz
Copy link

jacciz commented Jun 9, 2021

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)
```
```{r base map only}
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
Copy link

jacciz commented Jun 14, 2021

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

@dcooley
Copy link
Collaborator

dcooley commented Jun 15, 2021

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
Copy link

jacciz commented Jun 15, 2021

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
Copy link
Collaborator

dcooley commented Jun 15, 2021

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

@jacciz
Copy link

jacciz commented Jun 15, 2021

yaml header:

output: rmarkdown::html_document:
  toc: true
  toc_float: true
  theme: flatly
  self_contained: false

@dcooley
Copy link
Collaborator

dcooley commented Jun 15, 2021

ah yes - of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants