Skip to content

Documentation / @geoverse/core-ol / GMapOptions

Interface: GMapOptions

Defined in: packages/core-ol/src/map/gmap.ts:43

GMap 构造选项

Extends

  • MapOptions

Properties

base?

ts
optional base?: false | BaseLayerReference;

Defined in: packages/core-ol/src/map/gmap.ts:48

内置底图(默认 'gd-vec' 高德矢量;传 false 则不加底图)。 注意:使用 tiandi-* 底图需在 baseConfig.tiandituToken 提供天地图 token。


baseConfig?

ts
optional baseConfig?: BaseLayerConfig;

Defined in: packages/core-ol/src/map/gmap.ts:50

底图配置:离线/自定义瓦片地址、天地图 token


center?

ts
optional center?: Coordinate;

Defined in: packages/core-ol/src/map/gmap.ts:52

初始中心点(WGS-84 经纬度),默认 [118.15, 24.56]


controls?

ts
optional controls?: Collection<Control> | Control[];

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:159

Controls initially added to the map. If not specified, module :ol/control/defaults.defaults is used. In a worker, no controls are added by default.

Inherited from

ts
MapOptions.controls

fullScreen?

ts
optional fullScreen?: boolean;

Defined in: packages/core-ol/src/map/gmap.ts:60

是否显示全屏控件,默认 false


interactions?

ts
optional interactions?: Collection<Interaction> | Interaction[];

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:169

Interactions that are initially added to the map. If not specified, module :ol/interaction/defaults.defaults is used. In a worker, no interactions are added by default.

Inherited from

ts
MapOptions.interactions

keyboardEventTarget?

ts
optional keyboardEventTarget?: string | HTMLElement | Document;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:180

The element to listen to keyboard events on. This determines when the KeyboardPan and KeyboardZoom interactions trigger. For example, if this option is set to document the keyboard interactions will always trigger. If this option is not specified, the element the library listens to keyboard events on is the map target (i.e. the user-provided div for the map). If this is not document, the target element needs to be focused for key events to be emitted, requiring that the target element has a tabindex attribute.

Inherited from

ts
MapOptions.keyboardEventTarget

layers?

ts
optional layers?: 
  | LayerGroup
  | BaseLayer<{
[x: string]: any;
}>[]
  | Collection<BaseLayer<{
[x: string]: any;
}>>;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:187

Layers. If this is not defined, a map with no layers will be rendered. Note that layers are rendered in the order supplied, so if you want, for example, a vector layer to appear on top of a tile layer, it must come after the tile layer.

Inherited from

ts
MapOptions.layers

maxTilesLoading?

ts
optional maxTilesLoading?: number;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:196

Maximum number tiles to load simultaneously.

Inherited from

ts
MapOptions.maxTilesLoading

maxZoom?

ts
optional maxZoom?: number;

Defined in: packages/core-ol/src/map/gmap.ts:56


minZoom?

ts
optional minZoom?: number;

Defined in: packages/core-ol/src/map/gmap.ts:55


moveTolerance?

ts
optional moveTolerance?: number;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:202

The minimum distance in pixels the cursor must move to be detected as a map move event instead of a click. Increasing this value can make it easier to click on the map.

Inherited from

ts
MapOptions.moveTolerance

overlays?

ts
optional overlays?: Collection<Overlay> | Overlay[];

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:206

Overlays initially added to the map. By default, no overlays are added.

Inherited from

ts
MapOptions.overlays

overview?

ts
optional overview?: boolean;

Defined in: packages/core-ol/src/map/gmap.ts:62

是否启用鹰眼控件,默认 false


pixelRatio?

ts
optional pixelRatio?: number;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:164

The ratio between physical pixels and device-independent pixels (dips) on the device.

Inherited from

ts
MapOptions.pixelRatio

scaleLine?

ts
optional scaleLine?: boolean;

Defined in: packages/core-ol/src/map/gmap.ts:58

是否显示比例尺控件,默认 false


showOverview?

ts
optional showOverview?: boolean;

Defined in: packages/core-ol/src/map/gmap.ts:64

鹰眼初始是否展开,默认 false


target?

ts
optional target?: string | HTMLElement | HTMLCanvasElement | OffscreenCanvas;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:220

The container for the map, either the element itself or the id of the element. If not specified at construction time, module :ol/Map~Map#setTarget must be called for the map to be rendered. If passed by element, the container can be in a secondary document. For use in workers or when exporting a map, use an OffscreenCanvas or HTMLCanvasElement as target, with a width and height in physical pixels, optionally multiplied by and a scale transform matching the map's pixel ratio. For accessibility (focus and keyboard events for map navigation), the target element must have a properly configured tabindex attribute. If the target element is inside a Shadow DOM, the tabindex atribute must be set on the custom element's host element. Note: CSS transform support for the target element is limited to scale.

Inherited from

ts
MapOptions.target

view?

ts
optional view?: View | Promise<ViewOptions>;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Map.d.ts:226

The map's view. No layer sources will be fetched unless this is specified at construction time or through module :ol/Map~Map#setView.

Inherited from

ts
MapOptions.view

zoom?

ts
optional zoom?: number;

Defined in: packages/core-ol/src/map/gmap.ts:54

初始层级,默认 12