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

Users unable to position their inputs on map #334

Open
jamwithsam opened this issue Jun 11, 2021 · 5 comments
Open

Users unable to position their inputs on map #334

jamwithsam opened this issue Jun 11, 2021 · 5 comments
Assignees

Comments

@jamwithsam
Copy link

jamwithsam commented Jun 11, 2021

Hello,

I am running into a couple of problems regarding the map settings in the .env file. I have followed the instructions in the deployment guideline (inserted latitude/longitude and google maps api key) but the map does not adjust to said location, instead it positions itself in the middle of ocean, west of Africa. Furthermore, I am unable to submit an idea on a project after manually navigating to project location. After filling out the requirement for adding a new idea and hitting submit, the submit button gets a circular loading icon and just sits there indefinitely. Any help would be greatly appreciated. Also, is there any guide for utilizing different tile providers?

Edit: Just did another test and I am unable to submit an idea via the projects page as a regular user. However, I am able to submit a proposal as a regular user.

@guilherme-andrade
Copy link
Contributor

Hi @jamwithsam,

It's not going to be easy for us to help you with this one, but we'll try.

Fixing Idea/ Proposal submission

Before you submit that idea on a map, open the browser inspector tool, click on the Console tab, and only then submit the idea. Do you see any error messages? If yes, do you see an "API key not activated" error?

We've had another deployment fail here in similar conditions, with an "Api Key Not Activated" error relative to GOOGLE_MAPS_API_KEY. If this is the case for you too, please make sure to activate your google maps API key in your google console. You probably have to add credit card details to make that happen.

The other option is not to have an api key at all. This will disable maps posting, but should run without issues. Let us know if not.

Changing Tile Provider

To change tile providers we do not have a guide yet, but here's something you can do:

  1. Get a tile url, from this source for example. Pick any value from the "tiles url" column.

  2. Change the fallback tile provider in the Front-End
    In front/app/components/UI/LeafletMap/config.ts change the value of DEFAULT_TILE_PROVIDER to "<your tile provider>".

  3. Apply this tile provider in the Back-End.

docker-compose run web rails c
# to change the default tile provider for the whole app
settings = AppConfiguration.instance.settings
settings['maps']['tile_provider'] = "<your tile provider url>"
AppConfiguration.instance.update(settings: settings)

# to change all project map configs
CustomMaps::MapConfig.update(tile_provider: "<your tile provider url>")

# or for 1 project
project = Project.find('<id of the project to change>')
project.map_config.update(tile_provider: "<your tile provider url>")

Not that if the return value of any of these operations is false, then something went wrong.

Let us know if this solved your issue!

@guilherme-andrade guilherme-andrade self-assigned this Jun 29, 2021
@jamwithsam
Copy link
Author

Hello,

Thanks for the in-depth and thorough reply @guilherme-andrade. However I am still having issues with the map not displaying correctly and submitting an idea via the interactive map. What google maps APIs should be enabled to allow the map function working as showcased in your demo platform? I have enabled a few after googling around in addition to adding billing to activate the APIs but to no avail.

@nTraum
Copy link
Contributor

nTraum commented Nov 30, 2021

Hey @jamwithsam, do you still experience the issue?

@jamwithsam
Copy link
Author

Hey @nTraum, unfortunately the issue still exist even after different google map APIs configurations. Haven't tried it since but if you have any suggestions, I would like to try it again.

@nTraum
Copy link
Contributor

nTraum commented May 31, 2022

Hey @jamwithsam Do you have the application running somewhere where I could try this out? Are there any errors in the JS console of the browser?

adessy pushed a commit that referenced this issue Dec 16, 2022
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