-
Notifications
You must be signed in to change notification settings - Fork 263
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
Enable the selection of the search box provider #2223
Comments
User model has a property named So why instead of relying on some window variables, we use that property to determine the geocoder and then look for the API Key on the window scope and if it's not there throw an error?. |
We cannot use the Carto.js wise, we probably want to expose a provider parameter. Builder-side we probably want to add an option to |
Yes, it might be much easier using that injected property rather than trying to determine which provider to use from CARTO.js and definitely easier to change. |
I've noticed that we have some geocoder configuration options in The app_config.yml configuration is: geocoder:
#force_batch: true
#disable_cache: true
app_id: ''
token: ''
mailto: ''
base_url: ''
non_batch_base_url: ''
internal:
username: ''
api_key: ''
cache:
base_url: ''
api_key: ''
table_name: ''
mapzen:
search_bar_api_key: ''
mapbox:
search_bar_api_key: ''
tomtom:
search_bar_api_key: ''
api:
host: 'localhost'
port: '5432'
dbname: 'dataservices_db'
user: 'geocoder_api' We can retrieve the properties in visualizations controller and then inject it into the template. @javitonino @ivanmalagon What do you think about this approach? |
I've tested it and the template injects |
Tested:
|
Merged and working in all pages (including embed)! 🚀 |
Context
We've recently changed our search box provider to TomTom instead of Mapbox. See tickets:
The "problem" is that even if the code seems to select the provider using an option, in the reality we don't set that option in any place.
We need to address it somehow, to enable the configuration of the provider. This is a likely scenario in OnPremises, where a customer can have the chance of using their own credentials.
I don't a clear idea on how to tackle this in a simple way but one of the options is to provide a hierarchy on providers and then look into the credentials that backend sets. If TomTom key exists, use TomTom. If not, mapbox... and so on.
If you have any better idea please let's discuss it here.
cc @javitonino
cc @ramiroaznar @jesusbotella (Response Team)
The text was updated successfully, but these errors were encountered: