web-map/src/apis/map/constant.ts
2025-07-01 21:39:42 +08:00

78 lines
1.7 KiB
TypeScript

import { KeydownType, type Options } from '@meta2d/core';
import { invert } from 'lodash-es';
//#region 点位
export enum MapPointType {
= 1,
,
,
,
= 11,
,
,
,
,
,
}
export const MAP_POINT_TYPES = Object.freeze(
<[string, MapPointType][]>Object.entries(MapPointType).filter(([, v]) => typeof v === 'number'),
);
//#endregion
//#region 线路
export enum MapRouteType {
线 = 'line',
线 = 'bezier2',
线 = 'bezier3',
}
export const MAP_ROUTE_TYPE = invert(MapRouteType);
export const MAP_ROUTE_TYPES = Object.freeze(<[string, MapRouteType][]>Object.entries(MapRouteType));
export enum MapRoutePassType {
,
,
,
= 10,
}
export const MAP_ROUTE_PASS_TYPES = Object.freeze(
<[string, MapRoutePassType][]>Object.entries(MapRoutePassType).filter(([, v]) => typeof v === 'number'),
);
//#endregion
//#region 区域
export enum MapAreaType {
= 1,
= 11,
,
}
export const MAP_AREA_TYPES = Object.freeze(
<[string, MapAreaType][]>Object.entries(MapAreaType).filter(([, v]) => typeof v === 'number'),
);
//#endregion
export const EDITOR_CONFIG: Options = {
keydown: KeydownType.None,
strictScope: true,
moveConnectedLine: false,
disableInput: true,
disableRotate: true,
disableSize: true,
disableAnchor: true,
disableEmptyLine: true,
disableRepeatLine: true,
minScale: 0.24,
maxScale: 4.01,
scaleOff: 0.01,
defaultAnchors: [],
globalAlpha: 0,
activeGlobalAlpha: 0,
fontSize: 14,
lineHeight: 1.5,
fontFamily: 'system-ui',
textRotate: false,
textAlign: 'center',
textBaseline: 'top',
};