new mapboxgl.supermap.Graphic(lngLat, style, attributes)
Graphic.js, line 9
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
lngLat |
Object | Array.<number> |
coordinate.format:Longitude and latitude array or object containing {lng, lat} format. |
|||||||||
style |
Object |
Graphic parameter.
|
|||||||||
attributes |
Object |
optional
Attribute information. |
Example
var graphic = new mapboxgl.supermap.Graphic(
{
lng:116,
lat:39
},{
color:[255,0,0],
radius:30
}
});
Methods
-
getAttributes(){Object}
Graphic.js, line 101 -
Get attribute information.
Returns:
Type Description Object Attribute information. -
getId(){string}
Graphic.js, line 36 -
Get the current ID.
Returns:
Type Description string id -
getLngLat(){Object}
Graphic.js, line 54 -
Get latitude and longitude coordinates.
Returns:
Type Description Object Latitude and longitude coordinates,the data format is {lng, lat}. -
getStyle(){Object}
Graphic.js, line 83 -
Get style.
Returns:
Type Description Object Point style. -
setAttributes(attributes)
Graphic.js, line 92 -
Set property information.
Name Type Description attributes
Object optional Attribute information.
-
setId(id)
Graphic.js, line 45 -
Set the current feature ID.
Name Type Description id
string feature ID.
-
setLngLat(lngLat)
Graphic.js, line 63 -
Set latitude and longitude coordinates.
Name Type Description lngLat
Object Latitude and longitude coordinates,the data format is {lng, lat}.
-
setStyle(style)
Graphic.js, line 72 -
Set the point style.
Name Type Description style
Object Style option.
Name Type Description color
Array optional color.
radius
number optional radius.