Skip to content

Documentation / @geoverse/react / GvMapProps

Interface: GvMapProps ​

Defined in: react/src/components/GvMap.tsx:16

Properties ​

base? ​

ts
optional base?: false | BaseLayerReference;

Defined in: react/src/components/GvMap.tsx:18

底图引用(如 'gd-vec' / 'bd-vec' / 'tiandi-vec'),false 表示无底图。默认 'gd-vec'。受控可切换。


baseConfig? ​

ts
optional baseConfig?: BaseLayerConfig;

Defined in: react/src/components/GvMap.tsx:24

底图配置(离线地址 / 天地图 token 等)。创建时生效。


center? ​

ts
optional center?: Coordinate;

Defined in: react/src/components/GvMap.tsx:20

中心点(WGS-84 经纬度),受控。默认 [118.15, 24.56]。


children? ​

ts
optional children?: ReactNode;

Defined in: react/src/components/GvMap.tsx:33


className? ​

ts
optional className?: string;

Defined in: react/src/components/GvMap.tsx:31


fullScreen? ​

ts
optional fullScreen?: boolean;

Defined in: react/src/components/GvMap.tsx:28

启用全屏控件。创建时生效。


onCenterChange? ​

ts
optional onCenterChange?: (center) => void;

Defined in: react/src/components/GvMap.tsx:43

交互导致中心变化(React 无 v-model,用「值 + onChange」对实现受控)

Parameters ​

center ​

Coordinate

Returns ​

void


onMoveEnd? ​

ts
optional onMoveEnd?: (evt) => void;

Defined in: react/src/components/GvMap.tsx:37

视野移动结束

Parameters ​

evt ​

unknown

Returns ​

void


onPointerMove? ​

ts
optional onPointerMove?: (evt) => void;

Defined in: react/src/components/GvMap.tsx:41

指针移动(载荷为 ol MapBrowserEvent)

Parameters ​

evt ​

unknown

Returns ​

void


onReady? ​

ts
optional onReady?: (map) => void;

Defined in: react/src/components/GvMap.tsx:35

地图实例就绪(StrictMode 下每次挂载都会触发一次)

Parameters ​

map ​

GMap

Returns ​

void


onSingleClick? ​

ts
optional onSingleClick?: (evt) => void;

Defined in: react/src/components/GvMap.tsx:39

单击地图(载荷为 ol MapBrowserEvent)

Parameters ​

evt ​

unknown

Returns ​

void


onZoomChange? ​

ts
optional onZoomChange?: (zoom) => void;

Defined in: react/src/components/GvMap.tsx:45

交互导致层级变化

Parameters ​

zoom ​

number

Returns ​

void


overview? ​

ts
optional overview?: boolean;

Defined in: react/src/components/GvMap.tsx:30

启用鹰眼控件。创建时生效。


scaleLine? ​

ts
optional scaleLine?: boolean;

Defined in: react/src/components/GvMap.tsx:26

显示比例尺控件。创建时生效。


style? ​

ts
optional style?: CSSProperties;

Defined in: react/src/components/GvMap.tsx:32


zoom? ​

ts
optional zoom?: number;

Defined in: react/src/components/GvMap.tsx:22

缩放层级,受控。默认 12。