cartodb-4.42/lib/assets/javascripts/builder/data/map-settings.js

56 lines
1.6 KiB
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
module.exports = function (overlaysCollection, mapDefModel, userModel) {
var overlays = overlaysCollection.pluck('type');
var canRemoveLogo = userModel.get('actions').remove_logo;
return [{
setting: 'search',
label: _t('editor.settings.preview.options.elements.search'),
related: 'overlays',
disabled: false,
enabler: overlays.indexOf('search') > 0
},
{
setting: 'zoom',
label: _t('editor.settings.preview.options.elements.zoom'),
related: 'overlays',
disabled: false,
enabler: overlays.indexOf('zoom') > 0
},
{
setting: 'logo',
label: _t('editor.settings.preview.options.elements.logo'),
related: 'overlays',
disabled: false,
hidden: !canRemoveLogo,
enabler: overlays.indexOf('logo') > 0
},
{
setting: 'legends',
label: _t('editor.settings.preview.options.elements.legends'),
related: 'map',
disabled: false,
enabler: mapDefModel.get('legends') === true
},
{
setting: 'layer_selector',
label: _t('editor.settings.preview.options.elements.layer_selector'),
related: 'map',
disabled: false,
enabler: mapDefModel.get('layer_selector') === true
},
{
setting: 'dashboard_menu',
label: _t('editor.settings.preview.options.elements.dashboard_menu'),
related: 'map',
disabled: false,
enabler: mapDefModel.get('dashboard_menu') === true
},
{
setting: 'scrollwheel',
label: _t('editor.settings.preview.options.elements.scrollwheel'),
related: 'map',
disabled: false,
enabler: mapDefModel.get('scrollwheel') === true
}];
};