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

[🐛] Maps address lookup is throwing an error about CORS #8

Open
Tracked by #1
RCheesley opened this issue Aug 2, 2023 · 11 comments
Open
Tracked by #1

[🐛] Maps address lookup is throwing an error about CORS #8

RCheesley opened this issue Aug 2, 2023 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@RCheesley
Copy link
Member

RCheesley commented Aug 2, 2023

We are missing the 'Awesome Map' module on the homepage - maybe related to #4, perhaps the module is missing?

@RCheesley RCheesley mentioned this issue Aug 2, 2023
7 tasks
@RCheesley RCheesley changed the title Maps feature seems to be missing [🐛] Maps feature seems to be missing Aug 2, 2023
@RCheesley RCheesley added the bug Something isn't working label Aug 2, 2023
@froger
Copy link
Collaborator

froger commented Aug 2, 2023

The most simple way to activate maps is to use HERE API Key (https://developer.here.com/develop/rest-apis).
If you MP your here API, I can set it to make maps working in this environment.

@RCheesley
Copy link
Member Author

I've set up an account and created an app - guessing it requires the JS Maps API? We can run through the config in our call.

@froger
Copy link
Collaborator

froger commented Aug 7, 2023

Maps feature should be active now, using your JS Maps API. As the integration didn't worked before, you might have to update the meetings address (and see an autocomplete).

Once the address is found on editing, the point should appear on the maps (https://townhall.mautic.org/meetings)

@RCheesley
Copy link
Member Author

edit:1 Access to XMLHttpRequest at 'https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?apiKey=fUF4xBtg0QVlHbNSxoP72KL27RjzhtQaYwhIwR8k3dw&query=Nomadian%20Tech%20Hub%2C%20152%20Obafemi%20Awolowo%20Way%2C%20Allen%20100271%2C%20Ikeja%2C%20Lagos%2C%20Nigeri&language=en' from origin 'https://townhall.mautic.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This is in the console when trying to add the locations - just checking in case there's a setting I missed somewhere, or is there a CORS setting on the Awesome Decidim side maybe?

@RCheesley RCheesley changed the title [🐛] Maps feature seems to be missing [🐛] Maps address lookup is throwing an error about CORS Aug 8, 2023
@RCheesley
Copy link
Member Author

I asked in the Here support Slack:

Hi Ruth! The Geocoder v6 API will be EOL soon, I suggest migrate to new GS7 API. Please check the same request with your api_key using postman and see if it return the response:
https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?apiKey &query=Nomadian%20Tech%20Hub&language=en

If the direct request to our API goes through without any error, your APIKey is entitled to use the right service. I suggest you follow up with the Decidim support. They should give you guidelines for their services and will know how the interface is implemented.

@RCheesley
Copy link
Member Author

Hi Ruth! Just confirmed this with the team, any app_id that is created on platform will not work with legacy API's unless it is migrated from legacy portal. In short:
If you've an access to developer.here.com and have an active appid, you can use the API key under that appid and go with the legacy api request.
If you are using the API key generated on platform.here.com, you need to use the new GS7 API instead of 6.2

@RCheesley
Copy link
Member Author

Raised as a bug in decidim/decidim: decidim/decidim#11466

@RCheesley
Copy link
Member Author

Looks like maps are switching over to Open Streetmap which has started working! 🥳 🚀

@froger
Copy link
Collaborator

froger commented Aug 30, 2023

The errors are there:

@RCheesley
Copy link
Member Author

RCheesley commented Aug 30, 2023

Actions:

@froger

  • Fix homepage map of upcoming events

Review PR to update the here.com API: decidim/decidim#11507

@RCheesley
Copy link
Member Author

This is outstanding, we still need to fix the homepage map of upcoming events and ultimately in the longer term hopefully the PR above will resolve this. It's not mission critical so I don't see this as a bug that's going to prevent us going live, but we're going to see if we can maybe moved to open street map instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants