-
Notifications
You must be signed in to change notification settings - Fork 109
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
[Fixes #976] Fix missing required accessToken for MapBox background when adding a map to a geostory #977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before to proceed we need to verify if we can fix this also inside the MapStore2 core. I'm going to verify it and provide a feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allyoucanmap as agreed let's check if this improvement can be done upstream in MapStore2, rather then inside the GeoNode client.
@giohappy the improvement can be done in the MapStore2 upstream project and it could follow the same workflow that we use for bing maps api keys. In MapStore we need to improve the setApiKeys function here by adding the case for mapbox backgrounds export const setApiKeys = function(layer) {
if (layer.type === 'bing') {
layer.apiKey = defaultConfig.bingApiKey;
}
if (layer.type === 'mapquest') {
layer.apiKey = defaultConfig.mapquestApiKey;
}
if (layer.type === 'tileprovider' && ['MapBoxStyle', 'MapBox'].includes(layer.provider)) {
// include an empty string if missing to avoid errors in the layer url template
layer.accessToken = defaultConfig.mapboxAccessToken || '';
}
return layer;
}; then we can pass the access token from the _geonde_config.html in the geonode_mapstore_client.html bingApiKey: '{% bing_api_key %}',
mapboxAccessToken: '{{ MAPBOX_ACCESS_TOKEN }}', the fix should be quick mapstore side but then we will need to backport and update the submodule that could take some time |
Can we have an ETA for this @allyoucanmap? If it's mroe then 1 week from now we will have to make the fix inside geonode client for the moment. |
@giohappy just created a PR on MapStore2 master geosolutions-it/MapStore2#8246 I'll let you know when the backport is ready on the stable branch |
Fix missing required accessToken for MapBox background when adding a map to a geostory