@antv/aimapui 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1165 -31
- package/dist/index.d.ts +102 -19
- package/dist/index.es.js +52427 -10259
- package/dist/index.iife.js +1165 -31
- package/dist/style.css +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1080,6 +1080,8 @@ export declare interface BottomSheetProps {
|
|
|
1080
1080
|
|
|
1081
1081
|
export declare type BottomSheetSnap = 'collapsed' | 'half' | 'expanded';
|
|
1082
1082
|
|
|
1083
|
+
export declare const BUBBLE_SIZE_LEVELS: readonly [8, 16, 32, 48, 64];
|
|
1084
|
+
|
|
1083
1085
|
declare type BubbleAnchor = 'center' | 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
1084
1086
|
|
|
1085
1087
|
/**
|
|
@@ -1331,9 +1333,8 @@ export declare type ControlType = 'zoom' | 'scale' | 'fullscreen' | 'geoLocate'
|
|
|
1331
1333
|
|
|
1332
1334
|
/**
|
|
1333
1335
|
* 底图工厂 — 根据配置创建 L7 Map 实例
|
|
1334
|
-
* 动态导入各底图模块,避免未使用时打包
|
|
1335
1336
|
*/
|
|
1336
|
-
export declare function createBasemap(schema: MapSchema):
|
|
1337
|
+
export declare function createBasemap(schema: MapSchema): unknown;
|
|
1337
1338
|
|
|
1338
1339
|
/**
|
|
1339
1340
|
* 创建 EventBus 实例
|
|
@@ -1653,28 +1654,33 @@ export declare interface ExportConfig {
|
|
|
1653
1654
|
quality?: number;
|
|
1654
1655
|
}
|
|
1655
1656
|
|
|
1656
|
-
export declare
|
|
1657
|
+
export declare const ExportImageControl: default_2.ForwardRefExoticComponent<ExportImageControlProps & default_2.RefAttributes<ExportImageHandle>>;
|
|
1657
1658
|
|
|
1658
1659
|
/**
|
|
1659
1660
|
* ExportImage 导出图片控件
|
|
1660
1661
|
*
|
|
1661
|
-
*
|
|
1662
|
-
*
|
|
1663
|
-
*
|
|
1664
|
-
*
|
|
1665
|
-
*
|
|
1662
|
+
* 导图为底图(高德)和可视化图层(L7)的合并图。
|
|
1663
|
+
* 优先使用 L7 API(exportMap + exportPng),
|
|
1664
|
+
* 失败时回退到直接抓取 map 容器内的所有 canvas 合并。
|
|
1665
|
+
*
|
|
1666
|
+
* ```tsx
|
|
1667
|
+
* const ref = useRef<ExportImageHandle>(null);
|
|
1668
|
+
* <ExportImageControl ref={ref} />
|
|
1669
|
+
* const base64 = await ref.current?.exportImage();
|
|
1670
|
+
* ```
|
|
1666
1671
|
*/
|
|
1667
1672
|
export declare interface ExportImageControlProps {
|
|
1668
|
-
/** 控件位置,默认 topright */
|
|
1669
1673
|
position?: L7ControlPosition;
|
|
1670
|
-
/** 图片格式,默认 png */
|
|
1671
1674
|
format?: 'png' | 'jpg';
|
|
1672
1675
|
className?: string;
|
|
1673
1676
|
style?: default_2.CSSProperties;
|
|
1674
|
-
/** 导出回调 */
|
|
1675
1677
|
onExport?: (base64: string) => void;
|
|
1676
1678
|
}
|
|
1677
1679
|
|
|
1680
|
+
export declare interface ExportImageHandle {
|
|
1681
|
+
exportImage(format?: 'png' | 'jpg'): Promise<string | undefined>;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1678
1684
|
/** 导出选项(向后兼容) */
|
|
1679
1685
|
export declare interface ExportOptions {
|
|
1680
1686
|
maxWidth?: number;
|
|
@@ -1917,6 +1923,32 @@ export declare interface GlyphLayerProps extends Omit<LayerSchema, 'type' | 'sou
|
|
|
1917
1923
|
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
1918
1924
|
}
|
|
1919
1925
|
|
|
1926
|
+
export declare const H3_SEQUENTIAL_COLORS: readonly ["#dbeafe", "#93c5fd", "#60a5fa", "#3b82f6", "#2563eb"];
|
|
1927
|
+
|
|
1928
|
+
export declare interface H3DataItem {
|
|
1929
|
+
[key: string]: unknown;
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
export declare function H3Layer({ source, h3Field, color, colorField, colorValues, opacity, showStroke, strokeColor, strokeWidth, hoverEffect, clickEffect, showLabel, labelField, labelColor, labelSize, active, select, style, onClick, onMouseMove, onMouseEnter, onMouseLeave, ...rest }: H3LayerProps): JSX_2.Element;
|
|
1933
|
+
|
|
1934
|
+
export declare interface H3LayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig' | 'shape' | 'shapeField' | 'shapeValues'> {
|
|
1935
|
+
source: H3DataItem[];
|
|
1936
|
+
h3Field?: string;
|
|
1937
|
+
showStroke?: boolean;
|
|
1938
|
+
strokeColor?: string;
|
|
1939
|
+
strokeWidth?: number;
|
|
1940
|
+
hoverEffect?: boolean;
|
|
1941
|
+
clickEffect?: boolean;
|
|
1942
|
+
showLabel?: boolean;
|
|
1943
|
+
labelField?: string;
|
|
1944
|
+
labelColor?: string;
|
|
1945
|
+
labelSize?: number;
|
|
1946
|
+
onClick?: (payload: LayerEventPayload) => void;
|
|
1947
|
+
onMouseMove?: (payload: LayerEventPayload) => void;
|
|
1948
|
+
onMouseEnter?: (payload: LayerEventPayload) => void;
|
|
1949
|
+
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1920
1952
|
/**
|
|
1921
1953
|
* 热力图图层组件
|
|
1922
1954
|
*
|
|
@@ -2068,18 +2100,18 @@ export declare interface ImageCalibrationControlProps {
|
|
|
2068
2100
|
/** 额外 style */
|
|
2069
2101
|
style?: React.CSSProperties;
|
|
2070
2102
|
/** 角点变化回调 */
|
|
2071
|
-
onCornersChange?: (corners: GeoCorners) => void;
|
|
2103
|
+
onCornersChange?: (imageId: string, corners: GeoCorners) => void;
|
|
2072
2104
|
/** 确认配准回调 */
|
|
2073
|
-
onCalibrate?: (result: CalibrationResult) => void;
|
|
2105
|
+
onCalibrate?: (imageId: string, result: CalibrationResult) => void;
|
|
2074
2106
|
/** 导出完成回调 */
|
|
2075
|
-
onExport?: (result: ExportResult) => void;
|
|
2107
|
+
onExport?: (imageId: string, result: ExportResult) => void;
|
|
2076
2108
|
/** 图片加载完成回调 */
|
|
2077
|
-
onImageLoad?: (dimensions: {
|
|
2109
|
+
onImageLoad?: (imageId: string, dimensions: {
|
|
2078
2110
|
width: number;
|
|
2079
2111
|
height: number;
|
|
2080
2112
|
}) => void;
|
|
2081
2113
|
/** 裁剪预处理完成回调,返回裁剪后的尺寸和可选的初始坐标 */
|
|
2082
|
-
onPreprocess?: (result: {
|
|
2114
|
+
onPreprocess?: (imageId: string, result: {
|
|
2083
2115
|
croppedDimensions: {
|
|
2084
2116
|
width: number;
|
|
2085
2117
|
height: number;
|
|
@@ -2087,16 +2119,36 @@ export declare interface ImageCalibrationControlProps {
|
|
|
2087
2119
|
initialCorners: GeoCorners | null;
|
|
2088
2120
|
}) => void;
|
|
2089
2121
|
/** 清除回调 */
|
|
2090
|
-
onClear?: () => void;
|
|
2122
|
+
onClear?: (imageId: string) => void;
|
|
2123
|
+
/** 图片列表变化回调 */
|
|
2124
|
+
onImagesChange?: (images: RegisteredImage[]) => void;
|
|
2125
|
+
/** 切换图片回调 */
|
|
2126
|
+
onImageSwitch?: (imageId: string) => void;
|
|
2127
|
+
/** 图片重命名回调 */
|
|
2128
|
+
onImageRename?: (imageId: string, oldName: string, newName: string) => void;
|
|
2129
|
+
/** 图片列表拖拽排序回调 */
|
|
2130
|
+
onImagesReorder?: (images: RegisteredImage[]) => void;
|
|
2131
|
+
/** 上传新图片回调 */
|
|
2132
|
+
onImageAdd?: (image: RegisteredImage) => void;
|
|
2133
|
+
/** 删除图片回调 */
|
|
2134
|
+
onImageRemove?: (imageId: string) => void;
|
|
2091
2135
|
}
|
|
2092
2136
|
|
|
2093
2137
|
/** 命令式 Handle */
|
|
2094
2138
|
export declare interface ImageCalibrationHandle {
|
|
2095
2139
|
getCorners(): GeoCorners | null;
|
|
2096
2140
|
setCorners(corners: GeoCorners): void;
|
|
2097
|
-
setImage(source: ImageSource): void;
|
|
2141
|
+
setImage(source: ImageSource, initialCorners?: GeoCorners | null): void;
|
|
2098
2142
|
exportImage(config?: ExportConfig): Promise<ExportResult>;
|
|
2099
2143
|
clear(): void;
|
|
2144
|
+
/** 获取所有已注册的图片列表 */
|
|
2145
|
+
getImages(): RegisteredImage[];
|
|
2146
|
+
/** 切换激活图片 */
|
|
2147
|
+
switchImage(id: string): void;
|
|
2148
|
+
/** 删除指定图片 */
|
|
2149
|
+
deleteImage(id: string): void;
|
|
2150
|
+
/** 获取当前激活图片 ID */
|
|
2151
|
+
getActiveImageId(): string | null;
|
|
2100
2152
|
}
|
|
2101
2153
|
|
|
2102
2154
|
/**
|
|
@@ -3103,6 +3155,31 @@ export declare interface RasterLayerProps extends Omit<LayerSchema, 'type' | 'so
|
|
|
3103
3155
|
*/
|
|
3104
3156
|
export declare type RasterRenderMode = 'raster' | 'rgb' | 'ndi';
|
|
3105
3157
|
|
|
3158
|
+
/** 单张配准图片(多图管理) */
|
|
3159
|
+
declare interface RegisteredImage {
|
|
3160
|
+
id: string;
|
|
3161
|
+
name: string;
|
|
3162
|
+
/** 图片来源(File 或 URL),用于重新加载 */
|
|
3163
|
+
source: ImageSource;
|
|
3164
|
+
/** 缩略图 URL */
|
|
3165
|
+
thumbnailUrl: string;
|
|
3166
|
+
/** 图片尺寸 */
|
|
3167
|
+
dimensions: {
|
|
3168
|
+
width: number;
|
|
3169
|
+
height: number;
|
|
3170
|
+
} | null;
|
|
3171
|
+
/** 当前阶段 */
|
|
3172
|
+
phase: CalibrationPhase;
|
|
3173
|
+
/** 当前角点 */
|
|
3174
|
+
corners: GeoCorners | null;
|
|
3175
|
+
/** 透明度 0-1 */
|
|
3176
|
+
opacity: number;
|
|
3177
|
+
/** 需要释放的 ObjectURL */
|
|
3178
|
+
revokeUrl: (() => void) | null;
|
|
3179
|
+
/** 裁剪产生的额外 URL 需要释放 */
|
|
3180
|
+
croppedRevokeUrl: (() => void) | null;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3106
3183
|
declare type ResolvedMapSchema = MapSchema & {
|
|
3107
3184
|
basemap: NonNullable<MapSchema['basemap']>;
|
|
3108
3185
|
center: NonNullable<MapSchema['center']>;
|
|
@@ -3152,7 +3229,7 @@ export declare interface ResponsiveSchema {
|
|
|
3152
3229
|
* />
|
|
3153
3230
|
* ```
|
|
3154
3231
|
*/
|
|
3155
|
-
export declare function RouteLayer({ path, segments, stops, routeType, onRouteQuery, onRouteResult, color, lineWidth, opacity, glow, animate, animateSpeed, stopSize, stopColor, endColor, showStopIndex, stopRenderer, stopMarkerVariant, stopIconMap, stopIconField, stopIconSize, stopIconAnchor, showStopPopup, activeColor, onPathClick, onStopClick, }: RouteLayerProps): JSX_2.Element | null;
|
|
3232
|
+
export declare function RouteLayer({ path, segments, stops, routeType, onRouteQuery, onRouteResult, color, lineWidth, opacity, glow, animate, animateSpeed, stopSize, stopColor, endColor, showStopIndex, showStopName, stopNameColor, stopNameSize, stopRenderer, stopMarkerVariant, stopIconMap, stopIconField, stopIconSize, stopIconAnchor, showStopPopup, activeColor, onPathClick, onStopClick, }: RouteLayerProps): JSX_2.Element | null;
|
|
3156
3233
|
|
|
3157
3234
|
export declare interface RouteLayerProps {
|
|
3158
3235
|
/** 路径坐标 — 完整线坐标或分段 */
|
|
@@ -3187,6 +3264,12 @@ export declare interface RouteLayerProps {
|
|
|
3187
3264
|
endColor?: string;
|
|
3188
3265
|
/** 是否显示途经点序号,默认 true */
|
|
3189
3266
|
showStopIndex?: boolean;
|
|
3267
|
+
/** 是否显示途经点名称,默认 true */
|
|
3268
|
+
showStopName?: boolean;
|
|
3269
|
+
/** 名称文字颜色,默认 '#334155' */
|
|
3270
|
+
stopNameColor?: string;
|
|
3271
|
+
/** 名称文字大小,默认 11 */
|
|
3272
|
+
stopNameSize?: number;
|
|
3190
3273
|
/** 停留点渲染模式,默认 'point' */
|
|
3191
3274
|
stopRenderer?: 'point' | 'marker' | 'icon';
|
|
3192
3275
|
/** marker 模式下的默认变体,默认 'circle' */
|