import { IFeatureType } from "./BaseStyle"; import FillStyle from "./FillStyle"; import StrokeStyle from "./StrokeStyle"; import TextStyle from "./TextStyle"; // 文本标签背景盒配置 export class LabelBoxStyle { constructor(c?: LabelBoxStyle) { c && Object.assign(this, c); } fill?: FillStyle; stroke?: StrokeStyle; } export class LabelPositionStyle { constructor(c?: LabelPositionStyle) { c && Object.assign(this, c); } Point?: "left" | "top" | "right" | "bottom" = "right"; LineString?: "center" | "top" | "bottom" = "top"; Polygon?: "center" = "center"; } /** * 标签样式 */ export default class LabelStyle { constructor(c?: LabelStyle) { c && Object.assign(this, c); } // 附着feature类型 featureType?: IFeatureType = "Point"; // 文本 text?: TextStyle = new TextStyle(); // 背景盒 box?: LabelBoxStyle = new LabelBoxStyle(); // 位置 position?: LabelPositionStyle = new LabelPositionStyle(); }