mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
adding title to tile map legend
This commit is contained in:
parent
83a513505c
commit
9e08139cb5
2 changed files with 14 additions and 0 deletions
|
@ -24,6 +24,10 @@
|
|||
color: @tilemap-color;
|
||||
}
|
||||
|
||||
.tilemap-legend-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.tilemap-legend i {
|
||||
width: 10px;
|
||||
|
|
|
@ -25,6 +25,12 @@ export default function MarkerFactory() {
|
|||
this.quantizeLegendColors();
|
||||
}
|
||||
|
||||
getLabel() {
|
||||
if (this.popups.length) {
|
||||
return this.popups[0].feature.properties.aggConfigResult.aggConfig.makeLabel();
|
||||
}
|
||||
return '';
|
||||
};
|
||||
/**
|
||||
* Adds legend div to each map when data is split
|
||||
* uses d3 scale from BaseMarker.prototype.quantizeLegendColors
|
||||
|
@ -46,6 +52,10 @@ export default function MarkerFactory() {
|
|||
// on relevant map events, and returns the element containing the control
|
||||
const $div = $('<div>').addClass('tilemap-legend');
|
||||
|
||||
const titleText = self.getLabel();
|
||||
const $title = $('<div>').addClass('tilemap-legend-title').text(titleText);
|
||||
$div.append($title);
|
||||
|
||||
_.each(self._legendColors, function (color, i) {
|
||||
const labelText = self._legendQuantizer
|
||||
.invertExtent(color)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue