You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { PropType } from "vue-demi";
import { DefineEmits, DefineProps } from "../../../types";
export const NATIVE_PROPS = {
/** 折线颜色 */
color: { type: String, default: "#0000ff" },
/** 折线的宽度,以像素为单位 */
weight: { type: Number, default: 3 },
/** 折线的透明度范围0-1 之间) */
opacity: { type: Number, default: 0.5 },
/** 拆线的样式solid或dashed */
lineStyle: { type: String as PropType<"solid" | "dashed">, default: "solid" }
};
export const EXTRA_PROPS = {
/** 启用/禁用编辑功能 */
edit: { type: Boolean, default: false },
/** 坐标数组 */
path: { type: Array as unknown as PropType<VT.LngLat[]>, default: () => [] },
/** 是否可见 */
visible: { type: Boolean, default: true },
/** 自定义属性 */
extData: { type: undefined as unknown as PropType<any> }
};
export const NATIVE_EVENTS: T.PolylineEvents = {
click: () => true,
dblclick: () => true,
mousedown: () => true,
mouseup: () => true,
mouseout: () => true,
mouseover: () => true,
remove: () => true
};
export const EXTRA_EVENTS = {
init: (e: T.Polyline) => e instanceof T.Polyline
};
export const PROPS = { ...NATIVE_PROPS, ...EXTRA_PROPS };
export const EVENTS = { ...NATIVE_EVENTS, ...EXTRA_EVENTS };
export type Props = DefineProps<typeof PROPS>;
export type Emit = DefineEmits<typeof EVENTS>;