mirror of
https://github.com/umap-project/umap.git
synced 2025-05-04 13:41:49 +02:00
Merge d630f8dadc
into e0ca66f186
This commit is contained in:
commit
fc6faa09b5
6 changed files with 24 additions and 0 deletions
|
@ -312,6 +312,7 @@ class Feature {
|
||||||
'properties._umap_options.showLabel',
|
'properties._umap_options.showLabel',
|
||||||
'properties._umap_options.labelDirection',
|
'properties._umap_options.labelDirection',
|
||||||
'properties._umap_options.labelInteractive',
|
'properties._umap_options.labelInteractive',
|
||||||
|
'properties._umap_options.labelImportance',
|
||||||
'properties._umap_options.outlink',
|
'properties._umap_options.outlink',
|
||||||
'properties._umap_options.outlinkTarget',
|
'properties._umap_options.outlinkTarget',
|
||||||
]
|
]
|
||||||
|
|
|
@ -699,6 +699,7 @@ export class DataLayer extends ServerStored {
|
||||||
'options.showLabel',
|
'options.showLabel',
|
||||||
'options.labelDirection',
|
'options.labelDirection',
|
||||||
'options.labelInteractive',
|
'options.labelInteractive',
|
||||||
|
'options.labelImportance',
|
||||||
'options.outlinkTarget',
|
'options.outlinkTarget',
|
||||||
'options.interactive',
|
'options.interactive',
|
||||||
]
|
]
|
||||||
|
|
|
@ -78,10 +78,12 @@ const FeatureMixin = {
|
||||||
const displayName = this.feature.getDisplayName(null)
|
const displayName = this.feature.getDisplayName(null)
|
||||||
let showLabel = this.feature.getOption('showLabel')
|
let showLabel = this.feature.getOption('showLabel')
|
||||||
const oldLabelHover = this.feature.getOption('labelHover')
|
const oldLabelHover = this.feature.getOption('labelHover')
|
||||||
|
const importance = this.feature.getOption('labelImportance')
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
direction: this.feature.getOption('labelDirection'),
|
direction: this.feature.getOption('labelDirection'),
|
||||||
interactive: this.feature.getOption('labelInteractive'),
|
interactive: this.feature.getOption('labelInteractive'),
|
||||||
|
className: `leaflet-tooltip-${importance}`,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldLabelHover && showLabel) showLabel = null // Retrocompat.
|
if (oldLabelHover && showLabel) showLabel = null // Retrocompat.
|
||||||
|
|
|
@ -250,6 +250,18 @@ export const SCHEMA = {
|
||||||
],
|
],
|
||||||
default: 'auto',
|
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: {
|
labelInteractive: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
impacts: ['data'],
|
impacts: ['data'],
|
||||||
|
|
|
@ -1260,6 +1260,7 @@ U.Map = L.Map.extend({
|
||||||
'options.showLabel',
|
'options.showLabel',
|
||||||
'options.labelDirection',
|
'options.labelDirection',
|
||||||
'options.labelInteractive',
|
'options.labelInteractive',
|
||||||
|
'options.labelImportance',
|
||||||
'options.outlinkTarget',
|
'options.outlinkTarget',
|
||||||
]
|
]
|
||||||
builder = new U.FormBuilder(this, popupFields)
|
builder = new U.FormBuilder(this, popupFields)
|
||||||
|
|
|
@ -1214,6 +1214,13 @@ span.popup-icon {
|
||||||
.umap-edit-enabled .readonly {
|
.umap-edit-enabled .readonly {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
.leaflet-tooltip-medium {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-high {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ********************************* */
|
/* ********************************* */
|
||||||
|
|
Loading…
Reference in a new issue