import Coordinate from '../geo/Coordinate'; import TextMarker, { TextMarkerOptionsType } from './TextMarker'; import { TextSymbol, VectorMarkerSymbol } from '../symbol'; import { GeometryEditOptionsType } from './ext/Geometry.Edit'; /** * @classdesc * Represents point type geometry for text boxes.
* A TextBox is used to draw a box with text inside on a particular coordinate. * @category geometry * @extends TextMarker * @mixes TextEditable * @example * var textbox = new maptalks.TextBox('This is a textbox', [0, 0], 200, 90, { 'draggable' : true, 'textStyle' : { 'wrap' : true, 'padding' : [12, 8], 'verticalAlignment' : 'top', 'horizontalAlignment' : 'right', 'symbol' : { 'textFaceName' : 'monospace', 'textFill' : '#34495e', 'textHaloFill' : '#fff', 'textHaloRadius' : 4, 'textSize' : 18, 'textWeight' : 'bold' } }, 'boxSymbol': { // box's symbol 'markerType' : 'square', 'markerFill' : 'rgb(135,196,240)', 'markerFillOpacity' : 0.9, 'markerLineColor' : '#34495e', 'markerLineWidth' : 1 } }); */ declare class TextBox extends TextMarker { options: TextBoxOptionsType; /** * @param {String} content - TextBox's text content * @param {Coordinate} coordinates - coordinates * @param {Number} width - width in pixel * @param {Number} height - height in pixel * @param {Object} [options=null] - construct options defined in [TextBox]{@link TextBox#options} */ constructor(content: string, coordinates: Coordinate | Array, width: number, height: number, options?: TextBoxOptionsType); /** * 获取文本框得宽度 * @english * Get textbox's width * @return {Number} */ getWidth(): number; /** * 设置文本框得宽度 * @english * Set new width to textbox * @param {Number} width * returns {TextBox} this */ setWidth(width: number): this; /** * 获取文本框高度 * @english * Get textbox's height * @return {Number} */ getHeight(): number; /** * 设置文本框高度 * @english * Set new height to textbox * @param {Number} height * returns {TextBox} this */ setHeight(height: number): this; /** * 获取文本框边框样式 * @english * Get textbox's boxSymbol * @return {Object} boxsymbol */ getBoxSymbol(): VectorMarkerSymbol; /** * 设置文本框边框样式 * @english * Set a new box symbol to textbox * @param {Object} symbol * returns {TextBox} this */ setBoxSymbol(symbol: VectorMarkerSymbol): this; /** * 获取文本框文本样式 * @english * Get textbox's text style * @return {Object} */ getTextStyle(): TextStyle | null; /** * 设置文本框文本样式 * @english * Set a new text style to the textbox * @param {Object} style new text style * returns {TextBox} this */ setTextStyle(style: TextStyle): this; static fromJSON(json: { [key: string]: any; }): TextBox; startEdit(opts: GeometryEditOptionsType): this; endEdit(): this; } export default TextBox; type TextStyle = { wrap?: boolean; padding?: [number, number]; verticalAlignment?: 'top' | 'middle' | 'bottom'; horizontalAlignment?: 'left' | 'middle' | 'right'; symbol?: TextSymbol; }; export type TextBoxOptionsType = TextMarkerOptionsType & { boxSymbol?: VectorMarkerSymbol; textStyle?: TextStyle; }; //# sourceMappingURL=TextBox.d.ts.map