VectorTilesMap

new Supermap3D.VectorTilesMap(options)

Vector tile map class. Reference to various specifications in mapbox's style: "https://docs.mapbox.com/mapbox-gl-js/style-spec/".
Name Type Description
options The parameter object contains the following properties:
Name Type Default Description
url String It is suitable for generating mvt data through SuperMap desktop software and publishing it as a rest-style map service through iServer.
url String The service address is applicable to WMTS services published by third parties.
layer String The layer name is applicable to WMTS services published by third parties.
layerConfig String Layer configuration file.
provider String Map service provider.
name String The name of the map.
tileWidth String The tile width is suitable for WMTS services released by third parties.
tileHeight String The tile height is suitable for WMTS services released by third parties.
format String 'mvt' optional Applicable to WMTS services published by third parties.
tilematrxset String The name of the slicing matrix set is applicable to WMTS services published by third parties.
billboardMode billboardMode optional Set the display mode of the text, and display it in tiles.
localIdeographFontFamily Boolean optional Whether to set the text annotation font to the browser's default font, which can solve the problem of text not being displayed due to Mapbox's inability to recognize the font. The default value is false.
subdomains Array | String Multiple subdomains. When the input parameter is an Array, it supports to load multiple subdomains. When the imput parameter is a String, it only supports to load a single subdomain.
crs String Supports loading data under the third-party coordinate systems EPSG:4490 or EPSG:3857, with the default value being EPSG:4490.

Members

alpha

Gets or sets the overall transparency of the layer, with a value between 0 and 1 (0 is completely transparent).

detailLevelOffset : Number

Set the fine layer of the MVT layer to use the texture of the rough layer. Specify the number of offset layers by numbers. When a positive integer is used, the texture of the fine layer above the current layer is used, and when it is negative, it is offset downward, and number represents the number of offset layers.

enableMorphing : Boolean

Set whether to turn on the gradient (gradient fusion when the upper and lower layers affect the switch) type is bool, the default value is false
Default Value: false

isOverlapDisplayed : Boolean

Gets or sets whether the overlapping part of the layer is displayed. When set to true, the overlapping part is still displayed, that is, it does not participate in avoidance. The default value is false.
Default Value: false

mapboxStyle

Get or set the mapbox standard style object used by the layer, which can be used to modify the map style, style, thematic map, etc. on the front end. Reference to various specifications in mapbox's style: "https://docs.mapbox.com/mapbox-gl-js/style-spec/".

maximumLevel : Number

Get the maximum level of the layer.

minimumLevel : Number

Get the minimum level of the layer.

overlapDisplayedThreshold : Boolean

Set the text/icon avoidance threshold, the default value is 0
Default Value: 0

rectangle : Number

Get the geographical scope of the data.
See:

selectedColor : Boolean

Set the hightlight color for selection, with the default value being Supermap3D.Color.CYAN
Default Value: false

show : Boolean

Get or set the visibility of the layer.

showCallout : Boolean

Gets or sets whether to display the leader line.

style3D : Object

Get or set the display style.
See:

swipeEnabled : Boolean

Set whether to turn on the shutter function, default value: false
Default Value: false

swipeRegion : Boolean

Set the upper left and lower right corners of the rolling shutter area, type: BoundingRectangle, the default value is new, Supermap3D.BoundingRectangle(0.0,0.0,1.0,1.0)
Default Value: new

tileHeight : Number

Get the slice height.

tileWidth : Number

Get the slice width.

tilingScheme

The way to get the data for the global division.

Methods

addLayer(layerObject, before, options)

Add layers.
Name Type Description
layerObject Object The layer parameter object conforming to the layer specification in the style of mapbox
before String Specify a target layer according to the ID, and place the new layer in front of the layer
options Object Other attributes of the layer

getVisibleInViewport(index)Boolean

Obtain the visibility of the viewport corresponding to the layer, which is mainly used in split screen and large screen display.
Name Type Description
index Number Index
Returns:
Visiability
Throws:

queryRenderedFeatures(queryGeometry, params)*

Query the rendered features based on geometric coordinates.
Name Type Description
queryGeometry Array Geographic coordinate point array
params Array Query filter conditions
Returns:

querySourceFeatures(params)

Find characteristic features. According to the specified characteristics, query the elements on the map, and now supports fuzzy query.
Name Type Description
params The specified feature feature is searched based on the feature.
Example:
var result = mvtMap.querySourceFeatures({
sourceLayer: selectLayer.id, //Sublayer name
filter: ["like","NAME","Beijing"] //Set fuzzy query filter conditions. For example, you can find the elements with "Beijing" in the NAME attribute here.
})

refresh()

Refresh the layer to make the modified map style take effect.

removeLayer(id)

Remove the layer with the specified ID.
Name Type Description
id String ID of the layer to be removed

setFilter(layerID, filter)

Set a filter for the layer with the specified ID.
Name Type Description
layerID String The ID of the layer whose filter is to be set
filter Object A filter parameter object conforming to the filter specification in mapbox style

setLayoutProperty(layerId, name, value, options)

Set the layout style for the layer with the specified ID. Through this interface, you can set the text to display in a new line.
Name Type Description
layerId String The ID of the layer whose layout style is to be set
name String The name of the layout style
value String Layout style value
options Object Other options of a layout style parameter object conforming to the filter specification in mapbox style
Example:
//Set the usage of text wrapping
mvt.setLayoutProperty (sublayer name,'text-max-width', the maximum number of characters in a single line of text)
mvt.setLayoutProperty("Gas Station Notes#1", 'text-max-width',5 )
// Set the text layer to not rotate along the line, with a default value of false
mvt.setLayoutProperty("ID of the text layer along the line", 'ignore-line-rotation', true/false )
// Set the position of the text layer along the line to be placed in the order defined by the vector data.
mvt.setLayoutProperty("ID of the text layer along the line", 'symbol-placement', 'line-direction')

setPaintProperty(layerId, name, value, options)

Set the canvas style for the layer with the specified ID.
Name Type Description
layerId String The ID of the layer whose canvas style is to be set.
name String The name of the canvas
value String Canvas value
options Object Other options of a canvas parameter object conforming to the filter specification in mapbox style

setVisibleInViewport(index, visible)

Set the visibility of the viewport corresponding to the layer, which is mainly used for split screen and large screen display.
Name Type Description
index Number Index
visible Boolean Visiability
Throws: