Skip to content

Documentation / @geoverse/core-ol / OceanSource

Class: OceanSource ​

Defined in: packages/core-ol/src/sources/ocean.ts:13

电子海图瓦片源(EPSG:3395 WGS-84 墨卡托,基于 ol 10 ImageTile)。

默认使用船讯网公网海图;离线部署传 url 覆盖。 使用前需先调用 registerProjections()。

Extends ​

  • ImageTileSource

Constructors ​

Constructor ​

ts
new OceanSource(options?): OceanSource;

Defined in: packages/core-ol/src/sources/ocean.ts:14

Parameters ​

options? ​

Options = {}

Returns ​

OceanSource

Overrides ​

ts
ImageTile.constructor

Properties ​

bandCount ​

ts
bandCount: number;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:204

Inherited from ​

ts
ImageTile.bandCount

disposed ​

ts
protected disposed: boolean;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Disposable.d.ts:15

The object has already been disposed.

Inherited from ​

ts
ImageTile.disposed

loading ​

ts
loading: number | boolean;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:114

This source is currently loading data. Sources that defer loading to the map's tile queue never set this to a truthy value.

Inherited from ​

MassSource.loading


nodataBandIndex ​

ts
nodataBandIndex: number | undefined;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:209

The 1-based band index for the nodata alpha band.

Inherited from ​

ts
ImageTile.nodataBandIndex

on ​

ts
on: TileSourceOnSignature<EventsKey>;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:118

Inherited from ​

SuperMapRestSource.on


once ​

ts
once: TileSourceOnSignature<EventsKey>;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:122

Inherited from ​

SuperMapRestSource.once


projection ​

ts
protected projection: Projection | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:98

Inherited from ​

MassSource.projection


tileGrid ​

ts
protected tileGrid: TileGrid | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:136

Inherited from ​

SuperMapRestSource.tileGrid


tileOptions ​

ts
protected tileOptions: Options;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:151

Inherited from ​

SuperMapRestSource.tileOptions


tmpSize ​

ts
protected tmpSize: Size;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:141

Inherited from ​

SuperMapRestSource.tmpSize


transformMatrix ​

ts
transformMatrix: Transform | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:228

Inherited from ​

ts
ImageTile.transformMatrix

un ​

ts
un: TileSourceOnSignature<void>;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:126

Inherited from ​

SuperMapRestSource.un


viewRejector ​

ts
protected viewRejector: (arg0) => void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:139

Parameters ​

arg0 ​

Error

Returns ​

void

Inherited from ​

ts
ImageTile.viewRejector

viewResolver ​

ts
protected viewResolver: (arg0) => void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:134

Parameters ​

arg0 ​

ViewOptions

Returns ​

void

Inherited from ​

ts
ImageTile.viewResolver

zDirection ​

ts
zDirection: number | NearestDirectionFunction;

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

zDirection hint, read by the renderer. Indicates which resolution should be used by a renderer if the views resolution does not match any resolution of the tile source. If 0, the nearest resolution will be used. If 1, the nearest lower resolution will be used. If -1, the nearest higher resolution will be used.

Inherited from ​

SuperMapRestSource.zDirection

Methods ​

addChangeListener() ​

ts
addChangeListener(key, listener): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:145

Parameters ​

key ​

string

Key name.

listener ​

Listener

Listener.

Returns ​

void

Inherited from ​

ts
ImageTile.addChangeListener

addEventListener() ​

ts
addEventListener(type, listener): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/events/Target.d.ts:50

Parameters ​

type ​

string

Type.

listener ​

Listener

Listener.

Returns ​

void

Inherited from ​

ts
ImageTile.addEventListener

applyProperties() ​

ts
protected applyProperties(source): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:172

Apply any properties from another object without triggering events.

Parameters ​

source ​

BaseObject

The source object.

Returns ​

void

Inherited from ​

ts
ImageTile.applyProperties

changed() ​

ts
changed(): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Observable.d.ts:65

Increases the revision counter and dispatches a 'change' event.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.changed

clear() ​

ts
clear(): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:227

Remove all cached reprojected tiles from the source. The next render cycle will create new tiles.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.clear

dispatchEvent() ​

ts
dispatchEvent(event): boolean | undefined;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/events/Target.d.ts:61

Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

Parameters ​

event ​

string | BaseEvent

Event object.

Returns ​

boolean | undefined

false if anyone called preventDefault on the event object or if any of the listeners returned false.

Api ​

Inherited from ​

ts
ImageTile.dispatchEvent

dispose() ​

ts
dispose(): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Disposable.d.ts:19

Clean up.

Returns ​

void

Inherited from ​

ts
ImageTile.dispose

disposeInternal() ​

ts
protected disposeInternal(): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Disposable.d.ts:24

Extension point for disposable objects.

Returns ​

void

Inherited from ​

ts
ImageTile.disposeInternal

get() ​

ts
get(key): any;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:114

Gets a value.

Parameters ​

key ​

string

Key name.

Returns ​

any

Value.

Api ​

Inherited from ​

ts
ImageTile.get

getAttributions() ​

ts
getAttributions(): Attribution | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:150

Get the attribution function for the source.

Returns ​

Attribution | null

Attribution function.

Api ​

Inherited from ​

ts
ImageTile.getAttributions

getAttributionsCollapsible() ​

ts
getAttributionsCollapsible(): boolean;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:155

Returns ​

boolean

Attributions are collapsible.

Api ​

Inherited from ​

ts
ImageTile.getAttributionsCollapsible

getGutterForProjection() ​

ts
getGutterForProjection(projection): number;

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

Parameters ​

projection ​

Projection

Projection.

Returns ​

number

Gutter.

Inherited from ​

ts
ImageTile.getGutterForProjection

getInterpolate() ​

ts
getInterpolate(): boolean;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:184

Returns ​

boolean

Use linear interpolation when resampling.

Inherited from ​

ts
ImageTile.getInterpolate

getKey() ​

ts
getKey(): string;

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

Return the key to be used for all tiles in the source.

Returns ​

string

The key for all tiles.

Inherited from ​

ts
ImageTile.getKey

getKeys() ​

ts
getKeys(): string[];

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:120

Get a list of object property names.

Returns ​

string[]

List of property names.

Api ​

Inherited from ​

ts
ImageTile.getKeys

getListeners() ​

ts
getListeners(type): Listener[] | undefined;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/events/Target.d.ts:69

Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

Parameters ​

type ​

string

Type.

Returns ​

Listener[] | undefined

Listeners.

Inherited from ​

ts
ImageTile.getListeners

getProjection() ​

ts
getProjection(): Projection | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:161

Get the projection of the source.

Returns ​

Projection | null

Projection.

Api ​

Inherited from ​

ts
ImageTile.getProjection

getProperties() ​

ts
getProperties(): NoInfer<{
[x: string]: any;
}>;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:126

Get an object of all property names and values.

Returns ​

NoInfer<{ [x: string]: any; }>

Object.

Api ​

Inherited from ​

ts
ImageTile.getProperties

getPropertiesInternal() ​

ts
getPropertiesInternal(): 
  | Partial<NoInfer<{
[x: string]: any;
}>>
  | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:131

Get an object of all property names and values.

Returns ​

| Partial<NoInfer<{ [x: string]: any; }>> | null

Object.

Inherited from ​

ts
ImageTile.getPropertiesInternal

getReprojTile_() ​

ts
getReprojTile_(
   z, 
   x, 
   y, 
   targetProj, 
   sourceProj, 
   tileCache?): ImageTile;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:258

Parameters ​

z ​

number

Tile coordinate z.

x ​

number

Tile coordinate x.

y ​

number

Tile coordinate y.

targetProj ​

Projection

The output projection.

sourceProj ​

Projection

The input projection.

tileCache? ​

LRUCache<Tile>

Tile cache.

Returns ​

ImageTile

Tile.

Inherited from ​

ts
ImageTile.getReprojTile_

getResolutions() ​

ts
getResolutions(projection?): number[] | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:166

Parameters ​

projection? ​

Projection

Projection.

Returns ​

number[] | null

Resolutions.

Inherited from ​

ts
ImageTile.getResolutions

getRevision() ​

ts
getRevision(): number;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Observable.d.ts:72

Get the version number for this object. Each time the object is modified, its version number will be incremented.

Returns ​

number

Revision.

Api ​

Inherited from ​

ts
ImageTile.getRevision

getState() ​

ts
getState(): State;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:176

Get the state of the source, see import("./Source.js").State for possible states.

Returns ​

State

State.

Api ​

Inherited from ​

ts
ImageTile.getState

getTile() ​

ts
getTile(
   z, 
   x, 
   y, 
   pixelRatio, 
   projection?, 
   tileCache?): ImageTile | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:269

Parameters ​

z ​

number

Tile coordinate z.

x ​

number

Tile coordinate x.

y ​

number

Tile coordinate y.

pixelRatio ​

number

Pixel ratio.

projection? ​

Projection

Projection.

tileCache? ​

LRUCache<Tile>

Tile cache.

Returns ​

ImageTile | null

Tile (or null if outside source extent).

Inherited from ​

ts
ImageTile.getTile

getTileCoordForTileUrlFunction() ​

ts
getTileCoordForTileUrlFunction(tileCoord, projection?): TileCoord;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:222

Returns a tile coordinate wrapped around the x-axis. When the tile coordinate is outside the resolution and extent range of the tile grid, null will be returned.

Parameters ​

tileCoord ​

TileCoord

Tile coordinate.

projection? ​

Projection

Projection.

Returns ​

TileCoord

Tile coordinate to be passed to the tileUrlFunction or null if no tile URL should be created for the passed tileCoord.

Inherited from ​

ts
ImageTile.getTileCoordForTileUrlFunction

getTileGrid() ​

ts
getTileGrid(): TileGrid | null;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:192

Return the tile grid of the tile source.

Returns ​

TileGrid | null

Tile grid.

Api ​

Inherited from ​

ts
ImageTile.getTileGrid

getTileGridForProjection() ​

ts
getTileGridForProjection(projection): TileGrid;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:197

Parameters ​

projection ​

Projection

Projection.

Returns ​

TileGrid

Tile grid.

Inherited from ​

ts
ImageTile.getTileGridForProjection

getTilePixelRatio() ​

ts
getTilePixelRatio(pixelRatio): number;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:205

Get the tile pixel ratio for this source. Subclasses may override this method, which is meant to return a supported pixel ratio that matches the provided pixelRatio as close as possible.

Parameters ​

pixelRatio ​

number

Pixel ratio.

Returns ​

number

Tile pixel ratio.

Inherited from ​

ts
ImageTile.getTilePixelRatio

getTilePixelSize() ​

ts
getTilePixelSize(
   z, 
   pixelRatio, 
   projection): Size;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:212

Parameters ​

z ​

number

Z.

pixelRatio ​

number

Pixel ratio.

projection ​

Projection

Projection.

Returns ​

Size

Tile size.

Inherited from ​

ts
ImageTile.getTilePixelSize

getTileSize() ​

ts
protected getTileSize(z): Size;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:243

Get the source tile size at the given zoom level. This may be different than the rendered tile size.

Parameters ​

z ​

number

Tile zoom level.

Returns ​

Size

The source tile size.

Inherited from ​

ts
ImageTile.getTileSize

getView() ​

ts
getView(): Promise<ViewOptions>;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:170

Returns ​

Promise<ViewOptions>

A promise for view-related properties.

Inherited from ​

ts
ImageTile.getView

getWrapX() ​

ts
getWrapX(): boolean | undefined;

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

Returns ​

boolean | undefined

Wrap X.

Inherited from ​

ts
ImageTile.getWrapX

handleTileChange_() ​

ts
handleTileChange_(event): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:200

Handle tile change events.

Parameters ​

event ​

BaseEvent

Event.

Returns ​

void

Inherited from ​

ts
ImageTile.handleTileChange_

hasListener() ​

ts
hasListener(type?): boolean;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/events/Target.d.ts:75

Parameters ​

type? ​

string

Type. If not provided, true will be returned if this event target has any listeners.

Returns ​

boolean

Has listeners.

Inherited from ​

ts
ImageTile.hasListener

hasProperties() ​

ts
hasProperties(): boolean;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:135

Returns ​

boolean

The object has properties.

Inherited from ​

ts
ImageTile.hasProperties

notify() ​

ts
notify(key, oldValue): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:140

Parameters ​

key ​

string

Key name.

oldValue ​

any

Old value.

Returns ​

void

Inherited from ​

ts
ImageTile.notify

onceInternal() ​

ts
protected onceInternal(type, listener): EventsKey | EventsKey[];

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Observable.d.ts:86

Parameters ​

type ​

string | string[]

Type.

listener ​

(arg0) => unknown

Listener.

Returns ​

EventsKey | EventsKey[]

Event key.

Inherited from ​

ts
ImageTile.onceInternal

onInternal() ​

ts
protected onInternal(type, listener): EventsKey | EventsKey[];

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Observable.d.ts:79

Parameters ​

type ​

string | string[]

Type.

listener ​

(arg0) => unknown

Listener.

Returns ​

EventsKey | EventsKey[]

Event key.

Inherited from ​

ts
ImageTile.onInternal

refresh() ​

ts
refresh(): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:189

Refreshes the source. The source will be cleared, and data from the server will be reloaded.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.refresh

removeChangeListener() ​

ts
removeChangeListener(key, listener): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:150

Parameters ​

key ​

string

Key name.

listener ​

Listener

Listener.

Returns ​

void

Inherited from ​

ts
ImageTile.removeChangeListener

removeEventListener() ​

ts
removeEventListener(type, listener): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/events/Target.d.ts:80

Parameters ​

type ​

string

Type.

listener ​

Listener

Listener.

Returns ​

void

Inherited from ​

ts
ImageTile.removeEventListener

set() ​

ts
set(
   key, 
   value, 
   silent?): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:158

Sets a value.

Parameters ​

key ​

string

Key name.

value ​

any

Value.

silent? ​

boolean

Update without triggering an event.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.set

setAttributions() ​

ts
setAttributions(attributions): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Source.d.ts:197

Set the attributions of the source.

Parameters ​

attributions ​

AttributionLike | undefined

Attributions. Can be passed as string, Array<string>, module:ol/source/Source~Attribution, or undefined.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.setAttributions

setKey() ​

ts
protected setKey(key): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/Tile.d.ts:175

Set the value to be used as the key for all tiles in the source.

Parameters ​

key ​

string

The key for tiles.

Returns ​

void

Inherited from ​

ts
ImageTile.setKey

setLoader() ​

ts
protected setLoader(loader): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:248

Parameters ​

loader ​

Loader

The data loader.

Returns ​

void

Inherited from ​

ts
ImageTile.setLoader

setProperties() ​

ts
setProperties(values, silent?): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:166

Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

Parameters ​

values ​

Partial<NoInfer<Properties>>

Values.

silent? ​

boolean

Update without triggering an event.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.setProperties

setState() ​

ts
setState(state): void;

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

Set the state of the source.

Parameters ​

state ​

State

State.

Returns ​

void

Inherited from ​

ts
ImageTile.setState

setTileGridForProjection() ​

ts
setTileGridForProjection(projection, tilegrid): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:282

Sets the tile grid to use when reprojecting the tiles to the given projection instead of the default tile grid for the projection.

This can be useful when the default tile grid cannot be created (e.g. projection has no extent defined) or for optimization reasons (custom tile size, resolutions, ...).

Parameters ​

projection ​

ProjectionLike

Projection.

tilegrid ​

TileGrid

Tile grid to use for the projection.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.setTileGridForProjection

setTileSizes() ​

ts
protected setTileSizes(tileSizes): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/DataTile.d.ts:235

Set the source tile sizes. The length of the array is expected to match the number of levels in the tile grid.

Parameters ​

tileSizes ​

Size[]

An array of tile sizes.

Returns ​

void

Inherited from ​

ts
ImageTile.setTileSizes

setUrl() ​

ts
setUrl(url): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/source/ImageTile.d.ts:108

Parameters ​

url ​

UrlLike

The new URL.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.setUrl

unInternal() ​

ts
protected unInternal(type, listener): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Observable.d.ts:93

Unlisten for a certain type of event.

Parameters ​

type ​

string | string[]

Type.

listener ​

(arg0) => unknown

Listener.

Returns ​

void

Inherited from ​

ts
ImageTile.unInternal

unset() ​

ts
unset(key, silent?): void;

Defined in: node_modules/.pnpm/ol@10.9.0/node_modules/ol/Object.d.ts:179

Unsets a property.

Parameters ​

key ​

string

Key name.

silent? ​

boolean

Unset without triggering an event.

Returns ​

void

Api ​

Inherited from ​

ts
ImageTile.unset