Skip to content

Commit

Permalink
use styleValuesNonMapbox in mapbox.style attr declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Jul 22, 2019
1 parent a460be0 commit 81f9d53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/plots/mapbox/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,18 @@ var stylesNonMapbox = {
}
};

var styleValuesNonMapbox = Object.keys(stylesNonMapbox);

module.exports = {
requiredVersion: requiredVersion,

styleUrlPrefix: 'mapbox://styles/mapbox/',
styleUrlSuffix: 'v9',

styleValuesMapbox: ['basic', 'streets', 'outdoors', 'light', 'dark', 'satellite', 'satellite-streets'],
styleValueOSM: 'open-street-map',
styleValueDflt: 'basic',
stylesNonMapbox: stylesNonMapbox,
styleValuesNonMapbox: styleValuesNonMapbox,

traceLayerPrefix: 'plotly-trace-layer-',
layoutLayerPrefix: 'plotly-layout-layer-',
Expand All @@ -171,7 +173,7 @@ module.exports = {

missingStyleErrorMsg: [
'No valid mapbox style found, please set `mapbox.style` to one of:',
Object.keys(stylesNonMapbox).join(', '),
styleValuesNonMapbox.join(', '),
'or register a Mapbox access token to use a Mapbox-served style.'
].join('\n'),

Expand Down
2 changes: 1 addition & 1 deletion src/plots/mapbox/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var attrs = module.exports = overrideAll({
},
style: {
valType: 'any',
values: constants.styleValuesMapbox.concat(constants.styleValueOSM),
values: constants.styleValuesMapbox.concat(Object.keys(constants.styleValuesNonMapbox)),
dflt: constants.styleValueDflt,
role: 'style',
description: [
Expand Down

0 comments on commit 81f9d53

Please sign in to comment.