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:
|
Members
-
Gets or sets whether to display the leader line.
-
Get or set the display style.
See:
Methods
-
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 -
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:
VisiabilityThrows:
-
DeveloperError : the index is 0~3
-
-
Query the rendered features based on geometric coordinates.
Name Type Description queryGeometry
Array Geographic coordinate point array params
Array Query filter conditions Returns:
-
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","京"] //Set fuzzy query filter conditions. For example, you can find the elements with "京" in the NAME attribute here. })
-
Remove the layer with the specified ID.
Name Type Description id
String ID of the layer to be removed -
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 -
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("加油站注记#1", 'text-max-width',5 )
-
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 -
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:
-
DeveloperError : the index is 0~3
-