import Coordinate from '../geo/Coordinate';
import { TextSymbol, VectorMarkerSymbol } from '../symbol';
import TextMarker, { TextMarkerOptionsType } from './TextMarker';
/**
* @classdesc
* Represents point type geometry for text labels.
* A label is used to draw text (with a box background if specified) on a particular coordinate.
* @category geometry
* @extends TextMarker
* @mixes TextEditable
* @example
* var label = new maptalks.Label('label with a box',
[0, 0],
{
'draggable' : true,
'boxStyle' : {
'padding' : [12, 8],
'verticalAlignment' : 'top',
'horizontalAlignment' : 'right',
'minWidth' : 300,
'minHeight' : 200,
'symbol' : {
'markerType' : 'square',
'markerFill' : 'rgb(135,196,240)',
'markerFillOpacity' : 0.9,
'markerLineColor' : '#34495e',
'markerLineWidth' : 1
}
},
'textSymbol': {
'textFaceName' : 'monospace',
'textFill' : '#34495e',
'textHaloFill' : '#fff',
'textHaloRadius' : 4,
'textSize' : 18,
'textWeight' : 'bold',
'textVerticalAlignment' : 'top'
}
});
*/
declare class Label extends TextMarker {
options: any;
/**
* @param {String} content - Label's text content
* @param {Coordinate} coordinates - coordinates
* @param {Object} [options=null] - construct options defined in [Label]{@link Label#options}
*/
constructor(content: string, coordinates: Coordinate | Array, options?: LabelOptionsType);
/**
* 获取标注的边框样式
* @english
* Get label's box style
* @return {Object}
*/
getBoxStyle(): BoxStyle;
/**
* 设置标注的边框样式
* @english
* Set a new box style to the label
* @param {Object}
* @returns {Label} this
*/
setBoxStyle(style: BoxStyle): this;
/**
* 获取标注的文本样式
* Get label's text symbol
* @return {Object}
*/
getTextSymbol(): TextSymbol;
/**
* 给标注设置新的文本样式
* @english
* Set a new text symbol to the label
* @param {Object} symbol
* @returns {Label} this
*/
setTextSymbol(symbol: TextSymbol): this;
static fromJSON(json: {
[key: string]: any;
}): Label;
}
export default Label;
type BoxStyle = {
padding?: [number, number];
verticalAlignment?: 'top' | 'middle' | 'bottom';
horizontalAlignment?: 'left' | 'middle' | 'right';
minWidth?: number;
minHeight?: number;
symbol?: VectorMarkerSymbol;
};
export type LabelOptionsType = TextMarkerOptionsType & {
textSymbol?: TextSymbol;
boxStyle?: BoxStyle;
};
//# sourceMappingURL=Label.d.ts.map