diff --git a/umap/static/umap/js/modules/data/features.js b/umap/static/umap/js/modules/data/features.js index 260ed28f..dfb5e707 100644 --- a/umap/static/umap/js/modules/data/features.js +++ b/umap/static/umap/js/modules/data/features.js @@ -312,6 +312,7 @@ class Feature { 'properties._umap_options.showLabel', 'properties._umap_options.labelDirection', 'properties._umap_options.labelInteractive', + 'properties._umap_options.labelImportance', 'properties._umap_options.outlink', 'properties._umap_options.outlinkTarget', ] diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 1602cf52..2dc7a23a 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -699,6 +699,7 @@ export class DataLayer extends ServerStored { 'options.showLabel', 'options.labelDirection', 'options.labelInteractive', + 'options.labelImportance', 'options.outlinkTarget', 'options.interactive', ] diff --git a/umap/static/umap/js/modules/rendering/ui.js b/umap/static/umap/js/modules/rendering/ui.js index c01d309e..81ec14d4 100644 --- a/umap/static/umap/js/modules/rendering/ui.js +++ b/umap/static/umap/js/modules/rendering/ui.js @@ -78,10 +78,12 @@ const FeatureMixin = { const displayName = this.feature.getDisplayName(null) let showLabel = this.feature.getOption('showLabel') const oldLabelHover = this.feature.getOption('labelHover') + const importance = this.feature.getOption('labelImportance') const options = { direction: this.feature.getOption('labelDirection'), interactive: this.feature.getOption('labelInteractive'), + className: `leaflet-tooltip-${importance}`, } if (oldLabelHover && showLabel) showLabel = null // Retrocompat. diff --git a/umap/static/umap/js/modules/schema.js b/umap/static/umap/js/modules/schema.js index f2dab903..cd746515 100644 --- a/umap/static/umap/js/modules/schema.js +++ b/umap/static/umap/js/modules/schema.js @@ -250,6 +250,18 @@ export const SCHEMA = { ], default: 'auto', }, + labelImportance: { + type: String, + impacts: ['data'], + label: translate('Label importance'), + inheritable: true, + choices: [ + ['low', translate('Default')], + ['medium', translate('Medium')], + ['high', translate('High')], + ], + default: 'low', + }, labelInteractive: { type: Boolean, impacts: ['data'], diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 893de510..8f34f035 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1260,6 +1260,7 @@ U.Map = L.Map.extend({ 'options.showLabel', 'options.labelDirection', 'options.labelInteractive', + 'options.labelImportance', 'options.outlinkTarget', ] builder = new U.FormBuilder(this, popupFields) diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 480127cd..4fb6d8a6 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -1214,6 +1214,13 @@ span.popup-icon { .umap-edit-enabled .readonly { cursor: not-allowed; } +.leaflet-tooltip-medium { + font-weight: bold; +} +.leaflet-tooltip-high { + font-weight: bold; + font-size: 1.2rem; +} /* ********************************* */