@antv/aimapui 0.1.0 → 0.2.0
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/README.md +39 -0
- package/dist/aimapui.css +1 -1
- package/dist/index.cjs.js +10 -10
- package/dist/index.d.ts +119 -7
- package/dist/index.es.js +3537 -3100
- package/package.json +8 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaiduMap } from '@antv/l7-maps';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import { default as default_2 } from 'react';
|
|
4
|
-
import { default as default_3 } from '
|
|
4
|
+
import { default as default_3 } from 'node_modules/@antv/l7-maps/es/amap-next';
|
|
5
5
|
import { GoogleMap } from '@antv/l7-maps';
|
|
6
6
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
7
7
|
import { Map as Map_2 } from '@antv/l7-maps';
|
|
@@ -1078,7 +1078,17 @@ export declare interface BusinessDataItem {
|
|
|
1078
1078
|
*
|
|
1079
1079
|
* 内置全国省/市/县三级 GeoJSON 数据,支持下钻模式与业务数据关联色阶映射。
|
|
1080
1080
|
*/
|
|
1081
|
-
export declare
|
|
1081
|
+
export declare const ChinaDistrict: default_2.ForwardRefExoticComponent<ChinaDistrictProps & default_2.RefAttributes<ChinaDistrictHandle>>;
|
|
1082
|
+
|
|
1083
|
+
/** ChinaDistrict 命令式 API,通过 ref 获取 */
|
|
1084
|
+
export declare interface ChinaDistrictHandle {
|
|
1085
|
+
/** 返回上一级 */
|
|
1086
|
+
drillUp: () => void;
|
|
1087
|
+
/** 返回到指定层级(面包屑导航) */
|
|
1088
|
+
drillUpTo: (targetIndex: number) => void;
|
|
1089
|
+
/** 当前下钻路径 */
|
|
1090
|
+
getDrillPath: () => DrillPathNode[];
|
|
1091
|
+
}
|
|
1082
1092
|
|
|
1083
1093
|
export declare interface ChinaDistrictProps {
|
|
1084
1094
|
/** 省级 GeoJSON 数据 URL 或对象,默认内置全国省级数据 */
|
|
@@ -1089,12 +1099,16 @@ export declare interface ChinaDistrictProps {
|
|
|
1089
1099
|
districtSource?: string | Record<string, unknown>;
|
|
1090
1100
|
/** 当前显示层级(非下钻模式时使用) */
|
|
1091
1101
|
level?: AdministrativeLevel;
|
|
1092
|
-
/**
|
|
1102
|
+
/** 是否启用下钻模式,默认 true */
|
|
1093
1103
|
drillEnabled?: boolean;
|
|
1094
1104
|
/** 下钻路径(受控模式) */
|
|
1095
1105
|
drillPath?: DrillPathNode[];
|
|
1096
|
-
/**
|
|
1106
|
+
/** 下钻回调,点击区域进入下一级时触发 */
|
|
1097
1107
|
onDrill?: (path: DrillPathNode[]) => void;
|
|
1108
|
+
/** 上钻回调,用于面包屑导航返回上级 */
|
|
1109
|
+
onDrillUp?: (path: DrillPathNode[]) => void;
|
|
1110
|
+
/** 下钻时是否自动适配视口(fitBounds),默认 true */
|
|
1111
|
+
autoFitOnDrill?: boolean;
|
|
1098
1112
|
/** 业务数据,通过 name 或 adcode 与地理数据关联 */
|
|
1099
1113
|
data?: BusinessDataItem[];
|
|
1100
1114
|
/** 关联字段(地理数据属性名) */
|
|
@@ -1247,6 +1261,47 @@ export declare function createBasemap(schema: MapSchema): Promise<default_3 | Ma
|
|
|
1247
1261
|
*/
|
|
1248
1262
|
export declare function createEventBus(): EventBus;
|
|
1249
1263
|
|
|
1264
|
+
/**
|
|
1265
|
+
* 批量生成 Maki 图标的 iconMap,可直接用于 IconLayer 的 iconMap prop
|
|
1266
|
+
*
|
|
1267
|
+
* @example
|
|
1268
|
+
* ```tsx
|
|
1269
|
+
* <IconLayer
|
|
1270
|
+
* iconField="type"
|
|
1271
|
+
* iconMap={createMakiIconMap(['cafe', 'bus', 'hospital'], { fill: '#2563eb' })}
|
|
1272
|
+
* />
|
|
1273
|
+
* ```
|
|
1274
|
+
*
|
|
1275
|
+
* @param names - Maki 图标名列表
|
|
1276
|
+
* @param opts - 可选参数:size(默认 32)、fill(默认 "#333")
|
|
1277
|
+
* @returns Record<name, dataURL> 映射
|
|
1278
|
+
*/
|
|
1279
|
+
export declare function createMakiIconMap(names: string[], opts?: {
|
|
1280
|
+
size?: number;
|
|
1281
|
+
fill?: string;
|
|
1282
|
+
}): Record<string, string>;
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* 批量生成带 Pin 背景的 Maki 图标 iconMap,可直接用于 IconLayer 的 iconMap prop
|
|
1286
|
+
*
|
|
1287
|
+
* @example
|
|
1288
|
+
* ```tsx
|
|
1289
|
+
* <IconLayer
|
|
1290
|
+
* iconField="type"
|
|
1291
|
+
* iconMap={createMakiPinMap(['cafe', 'bus', 'hospital'], { fill: '#2563eb' })}
|
|
1292
|
+
* iconAnchor="bottom"
|
|
1293
|
+
* />
|
|
1294
|
+
* ```
|
|
1295
|
+
*
|
|
1296
|
+
* @param names - Maki 图标名列表
|
|
1297
|
+
* @param opts - 可选参数:size(默认 40)、fill(Pin 填充色,默认 "#2563eb")
|
|
1298
|
+
* @returns Record<name, dataURL> 映射
|
|
1299
|
+
*/
|
|
1300
|
+
export declare function createMakiPinMap(names: string[], opts?: {
|
|
1301
|
+
size?: number;
|
|
1302
|
+
fill?: string;
|
|
1303
|
+
}): Record<string, string>;
|
|
1304
|
+
|
|
1250
1305
|
/**
|
|
1251
1306
|
* 合并 className(基于 clsx)
|
|
1252
1307
|
*/
|
|
@@ -1483,7 +1538,7 @@ export declare interface GestureConfig {
|
|
|
1483
1538
|
* - 碰撞检测:图标始终可见,仅文本被避让
|
|
1484
1539
|
* - 缩放适配:L1(14+) 全显示 → L2(10-13) 仅图标 → L3(<10) 降级圆点
|
|
1485
1540
|
*/
|
|
1486
|
-
export declare function GlyphLayer({ source, sourceType, sourceConfig, iconField, iconFontFamily, iconFontPath, iconFontMap, iconColor, iconSize, iconHaloColor, iconHaloWidth, iconStyle, showLabel, labelField, labelColor, labelSize, labelAnchor, labelOffset, labelHaloColor, labelHaloWidth, labelStyle, textAllowOverlap, iconAllowOverlap, zoomAdaption, zoomShowLabel, zoomDegradeToPoint, onClick, onMouseEnter, onMouseLeave, ...rest }: GlyphLayerProps): JSX_2.Element | null;
|
|
1541
|
+
export declare function GlyphLayer({ source, sourceType, sourceConfig, iconField, iconFontFamily, iconFontPath, iconFontMap, iconColor, iconSize, iconHaloColor, iconHaloWidth, iconStyle, iconAnchor, iconBgShape, iconBgShapeColor, iconBgShapeSize, iconBgStrokeColor, iconBgStrokeWidth, iconBgPadding, iconBgCornerRadius, showLabel, labelField, labelColor, labelSize, labelAnchor, labelOffset, labelHaloColor, labelHaloWidth, labelStyle, textAllowOverlap, iconAllowOverlap, zoomAdaption, zoomShowLabel, zoomDegradeToPoint, onClick, onMouseEnter, onMouseLeave, ...rest }: GlyphLayerProps): JSX_2.Element | null;
|
|
1487
1542
|
|
|
1488
1543
|
export declare interface GlyphLayerProps extends Omit<LayerSchema, 'type' | 'source' | 'sourceType' | 'sourceConfig'> {
|
|
1489
1544
|
source: LayerSchema['source'];
|
|
@@ -1519,6 +1574,22 @@ export declare interface GlyphLayerProps extends Omit<LayerSchema, 'type' | 'sou
|
|
|
1519
1574
|
iconHaloWidth?: number;
|
|
1520
1575
|
/** 图标样式扩展 */
|
|
1521
1576
|
iconStyle?: Record<string, unknown>;
|
|
1577
|
+
/** 图标锚点位置,默认 'center' */
|
|
1578
|
+
iconAnchor?: IconAnchor_2;
|
|
1579
|
+
/** 图标背景形状,默认 'pin' */
|
|
1580
|
+
iconBgShape?: 'circle' | 'pin';
|
|
1581
|
+
/** 图标背景形状颜色,默认不显示 */
|
|
1582
|
+
iconBgShapeColor?: string;
|
|
1583
|
+
/** 图标背景形状大小,默认 24 */
|
|
1584
|
+
iconBgShapeSize?: number;
|
|
1585
|
+
/** 图标背景边框颜色 */
|
|
1586
|
+
iconBgStrokeColor?: string;
|
|
1587
|
+
/** 图标背景边框宽度,默认 0 */
|
|
1588
|
+
iconBgStrokeWidth?: number;
|
|
1589
|
+
/** 图标背景 padding,默认 0 */
|
|
1590
|
+
iconBgPadding?: number;
|
|
1591
|
+
/** 图标背景圆角半径,默认 0 */
|
|
1592
|
+
iconBgCornerRadius?: number;
|
|
1522
1593
|
/** 是否显示文字标签,默认 true */
|
|
1523
1594
|
showLabel?: boolean;
|
|
1524
1595
|
/** 文字标签字段,默认取 iconField */
|
|
@@ -1600,6 +1671,9 @@ export declare function hexToRgba(hex: string, alpha?: number): string;
|
|
|
1600
1671
|
|
|
1601
1672
|
export declare type IconAnchor = 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
1602
1673
|
|
|
1674
|
+
/** 图标锚点位置 */
|
|
1675
|
+
declare type IconAnchor_2 = 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
1676
|
+
|
|
1603
1677
|
/**
|
|
1604
1678
|
* 图片标注图层(IconLayer)
|
|
1605
1679
|
*
|
|
@@ -2126,6 +2200,44 @@ export declare interface LineLayerProps extends Omit<LayerSchema, 'type' | 'sour
|
|
|
2126
2200
|
onMouseLeave?: (payload: LayerEventPayload) => void;
|
|
2127
2201
|
}
|
|
2128
2202
|
|
|
2203
|
+
export declare const MAKI_ICON_NAMES: string[];
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* Maki Icons — Mapbox Maki icon path data
|
|
2207
|
+
* Source: https://mapbox.com/maki-icons/
|
|
2208
|
+
* License: CC0 1.0 Universal (Public Domain)
|
|
2209
|
+
*/
|
|
2210
|
+
export declare const MAKI_ICONS: Record<string, string>;
|
|
2211
|
+
|
|
2212
|
+
export declare type MakiIconName = keyof typeof MAKI_ICONS;
|
|
2213
|
+
|
|
2214
|
+
/**
|
|
2215
|
+
* 将 Maki 图标路径数据生成 SVG data URL
|
|
2216
|
+
*
|
|
2217
|
+
* @param icon - Maki 图标名(如 "cafe"、"bus")
|
|
2218
|
+
* @param opts - 可选参数:size(默认 32)、fill(默认 "#333")
|
|
2219
|
+
* @returns data:image/svg+xml,... URL,可直接用于 L7 scene.addImage 或 IconLayer iconMap
|
|
2220
|
+
*/
|
|
2221
|
+
export declare function makiIconUrl(icon: string, opts?: {
|
|
2222
|
+
size?: number;
|
|
2223
|
+
fill?: string;
|
|
2224
|
+
}): string;
|
|
2225
|
+
|
|
2226
|
+
/**
|
|
2227
|
+
* 将 Maki 图标生成为带 Pin 背景的 SVG data URL
|
|
2228
|
+
*
|
|
2229
|
+
* 效果类似 Marker variant="icon":水滴型 Pin 背景 + 白色 Maki 图标
|
|
2230
|
+
* 可直接用于 L7 scene.addImage 或 IconLayer iconMap
|
|
2231
|
+
*
|
|
2232
|
+
* @param icon - Maki 图标名(如 "cafe"、"bus")
|
|
2233
|
+
* @param opts - 可选参数:size(默认 40,即 SVG 宽度)、fill(Pin 填充色,默认 "#2563eb")
|
|
2234
|
+
* @returns data:image/svg+xml,... URL
|
|
2235
|
+
*/
|
|
2236
|
+
export declare function makiPinUrl(icon: string, opts?: {
|
|
2237
|
+
size?: number;
|
|
2238
|
+
fill?: string;
|
|
2239
|
+
}): string;
|
|
2240
|
+
|
|
2129
2241
|
declare interface MapEventHandlers {
|
|
2130
2242
|
onMove?: (payload: MapEventPayload) => void;
|
|
2131
2243
|
onZoom?: (payload: MapEventPayload) => void;
|
|
@@ -2240,7 +2352,7 @@ export declare interface MarkerProps extends Omit<MarkerSchema, 'type' | 'conten
|
|
|
2240
2352
|
variant?: MarkerVariant;
|
|
2241
2353
|
/** 语义颜色,默认 primary */
|
|
2242
2354
|
color?: MarkerColor;
|
|
2243
|
-
/**
|
|
2355
|
+
/** Maki 图标名(如 "cafe"、"bus"、"airport"),仅 variant='icon' 时生效 */
|
|
2244
2356
|
icon?: string;
|
|
2245
2357
|
/** 文本标注,显示在 Marker 下方 4px */
|
|
2246
2358
|
label?: string;
|
|
@@ -2279,7 +2391,7 @@ export declare interface MarkerSchema {
|
|
|
2279
2391
|
* Marker 基础形态
|
|
2280
2392
|
* - pin: 水滴型 (32x40px),默认业务点,用于 POI、站点、静态设施
|
|
2281
2393
|
* - circle: 圆型 (24x24px),移动/轻量点,用于实时车辆、传感器
|
|
2282
|
-
* - icon: 图标型,在 Pin 内嵌入
|
|
2394
|
+
* - icon: 图标型,在 Pin 内嵌入 Maki 图标
|
|
2283
2395
|
* - dot: 简化点 (8px),低缩放级降级形态
|
|
2284
2396
|
*/
|
|
2285
2397
|
export declare type MarkerVariant = 'pin' | 'circle' | 'icon' | 'dot';
|