Class: tiledMapLayer

L.supermap.tiledMapLayer

The tiled map layer class. Tiled map layer of REST map service of SuperMap iServer (tiled dynamic REST layer of SuperMap iServer Java 6R+) uses TileImage resources to map out.

L.supermap.tiledMapLayer(url, options)

TiledMapLayer.js, line 14
Name Type Description
url string

The url of tiled map layer.

options Object

The url of tiled map layer.

Name Type Default Description
layersID string optional

Get the map layer ID to be sliced, which is the layer that specifies the slice of the map. It can be a temporary layer set or a combination of layers in the current map.

redirect boolean false optional

Whether redirect or not. If true, the request is redirected to the real URL of the tile. If false, the response body is a byte stream of the tile.

transparent boolean true optional

Whether the tiles are transparent.

cacheEnabled boolean true optional

Weather cache is enabled.

clipRegionEnabled boolean false optional

Whether map clipping is enabled.

clipRegion L.Path optional

The map shows the cropped area. This parameter is a polygon object and valid when clipRegionEnabled = true. the map only shows the part covered by the area.

prjCoordSys Object optional

The coordinate reference system for the requested map. For instance: prjCoordSys={"epsgCode":3857}.

overlapDisplayed boolean false optional

Whether it is overlapped when map objects are in the same range.

overlapDisplayedOptions SuperMap.OverlapDisplayedOptions optional

The filter options for avoiding overlapped display of map objects.

tileversion string optional

The name of tile version. It is valid when cacheEnabled is true.

crs L.Proj.CRS optional

The coordinate system class

serverType SuperMap.ServerType SuperMap.ServerType.ISERVER optional

Type of server iServer|iPortal|online.

tileProxy string optional

Enable managed addresses.

format string 'png' optional

The tile representation type supports four expression types "png", "bmp", "jpg" and "gif".

tileSize number | L.Point 256 optional

Tile size.

attribution string 'Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>' optional

The copyright information.

Fires
Example
L.supermap.tiledMapLayer(url).addTo(map);

Extends

Events

tilesetsinfoloaded

TiledMapLayer.js, line 186

Triggered after the tile set information is set.

Properties:
Name Type Description
tileVersions Array.<Object>

Tile set information.

tileversionschanged

TiledMapLayer.js, line 237

Triggered after the sliced version is switched and redrawn successfully.

Properties:
Name Type Description
tileVersion Object

This version of the slice.

Methods

changeTilesVersion()

TiledMapLayer.js, line 215

Switch to a version of the tile and redraw. Save the version index that needs to switch by this.tempIndex.

getScale(zoom){number}

TiledMapLayer.js, line 109

Get the scale value according to the zoom level.

Name Type Description
zoom number

The zoom level.

Returns:
Type Description
number The scale value.

getScaleFromCoords(coords){number}

TiledMapLayer.js, line 122

Get the scale value according to ranks number.

Name Type Description
coords Object

Ranks number.

Returns:
Type Description
number The scale value.

getTileUrl(coords){string}

TiledMapLayer.js, line 92

Get the URL of the tile according to ranks number.

Name Type Description
coords Object

Ranks number.

Returns:
Type Description
string The URL of the tile.

lastTilesVersion()

TiledMapLayer.js, line 197

Request tiles of last version and redraw.

mergeTileVersionParam(version){boolean}

TiledMapLayer.js, line 258

Change the tile version number in the request URL parameter and redraw.

Name Type Description
version string

The tile version number.

Returns:
Type Description
boolean Whether it is successful.

nextTilesVersion()

TiledMapLayer.js, line 206

Request tiles of next version and redraw.

setTileSetsInfo(tileSets)

TiledMapLayer.js, line 173

Set tilesets information.

Name Type Description
tileSets Object

The tilesets object.

updateCurrentTileSetsIndex(index)

TiledMapLayer.js, line 249

Manually set the current tile set index. currently it is mainly used for control.

Name Type Description
index number

The index.