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 API key missing and cross origin requests blocked #34

Closed
rapbando opened this issue Aug 20, 2020 · 8 comments
Closed

Google maps API key missing and cross origin requests blocked #34

rapbando opened this issue Aug 20, 2020 · 8 comments

Comments

@rapbando
Copy link

HI,

when I load the tracking page from the webserver I get this errors:

Screenshot_2020-08-20_09-52-37

Screenshot_2020-08-20_10-12-07

@mhostetter
Copy link
Owner

Hmm... You have internet access and can access maps.google.com normally? To be honest, my web knowledge is weak and I barely scrapped this webpage together. It might be difficult for me to debug. Is it still not working for you?

@rapbando
Copy link
Author

rapbando commented Sep 3, 2020

Yes connection and google maps are working, can you verify if your setup is still working with current browsers?

@edersonrmachado
Copy link

You can try to change webserver.py line:

34   socketio = SocketIO(app)

for this:

34  socketio = SocketIO(app, cors_allowed_origins='http://localhost:5000')

You can also instruct the server to allow all origins with '*' instead of 'http://localhost:5000', but you must do this carefully, as stated in the documentation : https://flask-socketio.readthedocs.io/en/latest/

"A special value of '*' can be used to instruct the server to allow all origins, but this should be done with care, as this could make the server vulnerable to Cross-Site Request Forgery (CSRF) attacks"

Besides that, If you are using Google I think you need an API key : https://developers.google.com/maps/documentation/embed/get-api-key

@rapbando
Copy link
Author

rapbando commented Nov 3, 2020

Thanks, It fixed the cross origin related error.
Now I´m not sure where should the API be inserted, do I have to add in the static page html code?

@rapbando
Copy link
Author

rapbando commented Nov 3, 2020

By reading here looks like the developer has to change the api version rather than adding the key or maybe both.

@edersonrmachado
Copy link

Hi! Sorry, I don't know how it works now... I'm not using Google Maps because this part of getting/use API key is very confusing. I reinstalled gr-adsb from maint-3.7 branch which uses open-source leaflet.js (thanks to mhostetter #27).

@rapbando rapbando closed this as completed Nov 8, 2020
@mhostetter
Copy link
Owner

Sorry for the late response.

@edersonrmachado, yes, I migrated to leaflet.js because a previous user noticed that the "free" version of Google Maps was no longer working as intended. I thought I had master and maint-3.7 up-to-date. I will do that so others who git pull will get the latest 3.7 code. I'll also put a note about pulling from the maint-3.7 or maint-3.8 branches.

Thanks for pointing this out, and poking around enough to find the leaflet implementation! Please let me know if you encounter issues with it or have other feature requests.

@edersonrmachado
Copy link

np @mhostetter, thanks for developing the leaflet version and makes your project open source

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