diff --git a/umap/static/umap/js/modules/schema.js b/umap/static/umap/js/modules/schema.js index d34f8ffc..96572007 100644 --- a/umap/static/umap/js/modules/schema.js +++ b/umap/static/umap/js/modules/schema.js @@ -1,43 +1,36 @@ import { translate } from './i18n.js' export const SCHEMA = { - zoom: { - type: Number, - }, - scrollWheelZoom: { + captionBar: { type: Boolean, - label: translate('Allow scroll wheel zoom?'), - }, - scaleControl: { - type: Boolean, - label: translate('Do you want to display the scale control?'), - default: true, - }, - moreControl: { - type: Boolean, - label: translate('Do you want to display the «more» control?'), - default: true, - }, - miniMap: { - type: Boolean, - label: translate('Do you want to display a minimap?'), + label: translate('Do you want to display a caption bar?'), default: false, }, - displayPopupFooter: { + captionMenus: { type: Boolean, - label: translate('Do you want to display popup footer?'), - default: false, + label: translate('Do you want to display caption menus?'), + default: true, }, - onLoadPanel: { + color: { type: String, - label: translate('Do you want to display a panel on load?'), - choices: [ - ['none', translate('None')], - ['caption', translate('Caption')], - ['databrowser', translate('Data browser')], - ['facet', translate('Facet search')], - ], - default: 'none', + handler: 'ColorPicker', + label: translate('color'), + helpEntries: 'colorValue', + inheritable: true, + default: 'DarkBlue', + }, + dashArray: { + type: String, + label: translate('dash array'), + helpEntries: 'dashArray', + inheritable: true, + }, + datalayersControl: { + type: Boolean, + nullable: true, + handler: 'DataLayersControl', + label: translate('Display the data layers control'), + default: true, }, defaultView: { type: String, @@ -50,94 +43,30 @@ export const SCHEMA = { ], default: 'center', }, - name: { - type: String, - label: translate('name'), - }, description: { label: translate('description'), type: 'Text', helpEntries: 'textFormatting', }, - licence: { - type: String, - label: translate('licence'), + displayPopupFooter: { + type: Boolean, + label: translate('Do you want to display popup footer?'), + default: false, }, - tilelayer: { - type: Object, + easing: { type: Boolean, default: false }, + editinosmControl: { + type: Boolean, + nullable: true, + label: translate('Display the control to open OpenStreetMap editor'), + default: null, }, - overlay: { - type: Object, - }, - limitBounds: { - type: Object, - }, - color: { - type: String, - handler: 'ColorPicker', - label: translate('color'), - helpEntries: 'colorValue', - inheritable: true, - default: 'DarkBlue', - }, - iconClass: { - type: String, - label: translate('Icon shape'), - inheritable: true, - choices: [ - ['Default', translate('Default')], - ['Circle', translate('Circle')], - ['Drop', translate('Drop')], - ['Ball', translate('Ball')], - ], - default: 'Default', - }, - iconUrl: { - type: String, - handler: 'IconUrl', - label: translate('Icon symbol'), - inheritable: true, - // helpText: translate( - // 'Symbol can be either a unicode character or an URL. You can use feature properties as variables: ex.: with "http://myserver.org/images/{name}.png", the {name} variable will be replaced by the "name" value of each marker.' - // ), - }, - smoothFactor: { - type: Number, - min: 0, - max: 10, - step: 0.5, - label: translate('Simplify'), - helpEntries: 'smoothFactor', - inheritable: true, - default: 1.0, - }, - iconOpacity: { - type: Number, - min: 0.1, - max: 1, - step: 0.1, - label: translate('icon opacity'), - inheritable: true, - default: 1, - }, - opacity: { - type: Number, - min: 0.1, - max: 1, - step: 0.1, - label: translate('opacity'), - inheritable: true, - default: 0.5, - }, - weight: { - type: Number, - min: 1, - max: 20, - step: 1, - label: translate('weight'), - inheritable: true, - default: 3, + embedControl: { + type: Boolean, + nullable: true, + label: translate('Display the embed control'), + default: true, }, + facetKey: { type: String }, fill: { type: Boolean, label: translate('fill'), @@ -161,162 +90,11 @@ export const SCHEMA = { inheritable: true, default: 0.3, }, - dashArray: { - type: String, - label: translate('dash array'), - helpEntries: 'dashArray', - inheritable: true, - }, - popupShape: { - type: String, - label: translate('Popup shape'), - inheritable: true, - choices: [ - ['Default', translate('Popup')], - ['Large', translate('Popup (large)')], - ['Panel', translate('Side panel')], - ], - default: 'Default', - }, - popupTemplate: { - type: String, - label: translate('Popup content style'), - inheritable: true, - choices: [ - ['Default', translate('Default')], - ['Table', translate('Table')], - ['GeoRSSImage', translate('GeoRSS (title + image)')], - ['GeoRSSLink', translate('GeoRSS (only link)')], - ['OSM', translate('OpenStreetMap')], - ], - default: 'Default', - }, - popupContentTemplate: { - type: 'Text', - label: translate('Popup content template'), - helpEntries: ['dynamicProperties', 'textFormatting'], - placeholder: '# {name}', - inheritable: true, - default: '# {name}\n{description}', - }, - zoomTo: { + filterKey: { type: String }, + fromZoom: { type: Number, - placeholder: translate('Inherit'), - helpEntries: 'zoomTo', - label: translate('Default zoom level'), - inheritable: true, - }, - captionBar: { - type: Boolean, - label: translate('Do you want to display a caption bar?'), - default: false, - }, - captionMenus: { - type: Boolean, - label: translate('Do you want to display caption menus?'), - default: true, - }, - slideshow: { - type: Object, - }, - sortKey: { - type: String, - }, - labelKey: { - type: String, - helpEntries: 'labelKey', - placeholder: translate('Default: name'), - label: translate('Label key'), - inheritable: true, - }, - filterKey: { - type: String, - }, - facetKey: { - type: String, - }, - slugKey: { - type: String, - }, - showLabel: { - type: Boolean, - nullable: true, - label: translate('Display label'), - inheritable: true, - default: false, - }, - labelDirection: { - type: String, - label: translate('Label direction'), - inheritable: true, - choices: [ - ['auto', translate('Automatic')], - ['left', translate('On the left')], - ['right', translate('On the right')], - ['top', translate('On the top')], - ['bottom', translate('On the bottom')], - ], - default: 'auto', - }, - labelInteractive: { - type: Boolean, - label: translate('Labels are clickable'), - inheritable: true, - }, - outlinkTarget: { - type: String, - label: translate('Open link in…'), - inheritable: true, - default: 'blank', - choices: [ - ['blank', translate('new window')], - ['self', translate('iframe')], - ['parent', translate('parent window')], - ], - }, - shortCredit: { - type: String, - label: translate('Short credits'), - helpEntries: ['shortCredit', 'textFormatting'], - }, - longCredit: { - type: 'Text', - label: translate('Long credits'), - helpEntries: ['longCredit', 'textFormatting'], - }, - permanentCredit: { - type: 'Text', - label: translate('Permanent credits'), - helpEntries: ['permanentCredit', 'textFormatting'], - }, - permanentCreditBackground: { - type: Boolean, - label: translate('Permanent credits background'), - default: true, - }, - zoomControl: { - type: Boolean, - nullable: true, - label: translate('Display the zoom control'), - default: true, - }, - datalayersControl: { - type: Boolean, - nullable: true, - handler: 'DataLayersControl', - label: translate('Display the data layers control'), - default: true, - }, - searchControl: { - type: Boolean, - nullable: true, - label: translate('Display the search control'), - default: true, - }, - locateControl: { - type: Boolean, - nullable: true, - label: translate('Display the locate control'), + label: translate('From zoom'), + helpText: translate('Optional.'), }, fullscreenControl: { type: Boolean, @@ -324,65 +102,263 @@ export const SCHEMA = { label: translate('Display the fullscreen control'), default: true, }, - editinosmControl: { - type: Boolean, - nullable: true, - label: translate('Display the control to open OpenStreetMap editor'), - default: null, - }, - embedControl: { - type: Boolean, - nullable: true, - label: translate('Display the embed control'), - default: true, - }, - measureControl: { - type: Boolean, - nullable: true, - label: translate('Display the measure control'), - }, - tilelayersControl: { - type: Boolean, - nullable: true, - label: translate('Display the tile layers control'), - }, - starControl: { - type: Boolean, - nullable: true, - label: translate('Display the star map button'), - }, - easing: { - type: Boolean, - default: false, - }, - interactive: { - type: Boolean, - label: translate('Allow interactions'), - helpEntries: 'interactive', + iconClass: { + type: String, + label: translate('Icon shape'), inheritable: true, - default: true, + choices: [ + ['Default', translate('Default')], + ['Circle', translate('Circle')], + ['Drop', translate('Drop')], + ['Ball', translate('Ball')], + ], + default: 'Default', }, - fromZoom: { + iconOpacity: { type: Number, - label: translate('From zoom'), - helpText: translate('Optional.'), - }, - toZoom: { - type: Number, - label: translate('To zoom'), - helpText: translate('Optional.'), - }, - stroke: { - type: Boolean, - label: translate('stroke'), - helpEntries: 'stroke', + min: 0.1, + max: 1, + step: 0.1, + label: translate('icon opacity'), inheritable: true, - default: true, + default: 1, }, - outlink: { - label: translate('Link to…'), - helpEntries: 'outlink', - placeholder: 'http://...', - inheritable: true, + iconUrl: { + type: String, + handler: 'IconUrl', + label: translate('Icon symbol'), + inheritable: true, // helpText: translate( // 'Symbol can be either a unicode character or an URL. You can use feature properties as variables: ex.: with "http://myserver.org/images/{name}.png", the {name} variable will be replaced by the "name" value of each marker.' // ), renderers: { map: [], features: [], } }, + interactive: { + type: Boolean, + label: translate('Allow interactions'), + helpEntries: 'interactive', + inheritable: true, + default: true, + }, + labelDirection: { + type: String, + label: translate('Label direction'), + inheritable: true, + choices: [ + ['auto', translate('Automatic')], + ['left', translate('On the left')], + ['right', translate('On the right')], + ['top', translate('On the top')], + ['bottom', translate('On the bottom')], + ], + default: 'auto', + }, + labelInteractive: { + type: Boolean, + label: translate('Labels are clickable'), + inheritable: true, + }, + labelKey: { + type: String, + helpEntries: 'labelKey', + placeholder: translate('Default: name'), + label: translate('Label key'), + inheritable: true, + }, + licence: { + type: String, + label: translate('licence'), + }, + limitBounds: { type: Object }, + locateControl: { + type: Boolean, + nullable: true, + label: translate('Display the locate control'), + }, + longCredit: { + type: 'Text', + label: translate('Long credits'), + helpEntries: ['longCredit', 'textFormatting'], + }, + measureControl: { + type: Boolean, + nullable: true, + label: translate('Display the measure control'), + }, + miniMap: { + type: Boolean, + label: translate('Do you want to display a minimap?'), + default: false, + }, + moreControl: { + type: Boolean, + label: translate('Do you want to display the «more» control?'), + default: true, + }, + name: { + type: String, + label: translate('name'), + }, + onLoadPanel: { + type: String, + label: translate('Do you want to display a panel on load?'), + choices: [ + ['none', translate('None')], + ['caption', translate('Caption')], + ['databrowser', translate('Data browser')], + ['facet', translate('Facet search')], + ], + default: 'none', + }, + opacity: { + type: Number, + min: 0.1, + max: 1, + step: 0.1, + label: translate('opacity'), + inheritable: true, + default: 0.5, + }, + outlink: { + label: translate('Link to…'), + helpEntries: 'outlink', + placeholder: 'http://...', + inheritable: true, + }, + outlinkTarget: { + type: String, + label: translate('Open link in…'), + inheritable: true, + default: 'blank', + choices: [ + ['blank', translate('new window')], + ['self', translate('iframe')], + ['parent', translate('parent window')], + ], + }, + overlay: { type: Object }, + permanentCredit: { + type: 'Text', + label: translate('Permanent credits'), + helpEntries: ['permanentCredit', 'textFormatting'], + }, + permanentCreditBackground: { + type: Boolean, + label: translate('Permanent credits background'), + default: true, + }, + popupContentTemplate: { + type: 'Text', + label: translate('Popup content template'), + helpEntries: ['dynamicProperties', 'textFormatting'], + placeholder: '# {name}', + inheritable: true, + default: '# {name}\n{description}', + }, + popupShape: { + type: String, + label: translate('Popup shape'), + inheritable: true, + choices: [ + ['Default', translate('Popup')], + ['Large', translate('Popup (large)')], + ['Panel', translate('Side panel')], + ], + default: 'Default', + }, + popupTemplate: { + type: String, + label: translate('Popup content style'), + inheritable: true, + choices: [ + ['Default', translate('Default')], + ['Table', translate('Table')], + ['GeoRSSImage', translate('GeoRSS (title + image)')], + ['GeoRSSLink', translate('GeoRSS (only link)')], + ['OSM', translate('OpenStreetMap')], + ], + default: 'Default', + }, + scaleControl: { + type: Boolean, + label: translate('Do you want to display the scale control?'), + default: true, + }, + scrollWheelZoom: { + type: Boolean, + label: translate('Allow scroll wheel zoom?'), + }, + searchControl: { + type: Boolean, + nullable: true, + label: translate('Display the search control'), + default: true, + }, + shortCredit: { + type: String, + label: translate('Short credits'), + helpEntries: ['shortCredit', 'textFormatting'], + }, + showLabel: { + type: Boolean, + nullable: true, + label: translate('Display label'), + inheritable: true, + default: false, + }, + slideshow: { type: Object }, + slugKey: { type: String }, + smoothFactor: { + type: Number, + min: 0, + max: 10, + step: 0.5, + label: translate('Simplify'), + helpEntries: 'smoothFactor', + inheritable: true, + default: 1.0, + }, + sortKey: { type: String }, + starControl: { + type: Boolean, + nullable: true, + label: translate('Display the star map button'), + }, + stroke: { + type: Boolean, + label: translate('stroke'), + helpEntries: 'stroke', + inheritable: true, + default: true, + }, + tilelayer: { type: Object }, + tilelayersControl: { + type: Boolean, + nullable: true, + label: translate('Display the tile layers control'), + }, + toZoom: { + type: Number, + label: translate('To zoom'), + helpText: translate('Optional.'), + }, + weight: { + type: Number, + min: 1, + max: 20, + step: 1, + label: translate('weight'), + inheritable: true, + default: 3, + }, + zoom: { type: Number }, + zoomControl: { + type: Boolean, + nullable: true, + label: translate('Display the zoom control'), + default: true, + }, + zoomTo: { + type: Number, + placeholder: translate('Inherit'), + helpEntries: 'zoomTo', + label: translate('Default zoom level'), + inheritable: true, + }, }, }