L.supermap.graphicLayer(graphics, options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
graphics |
Array.<L.supermap.graphic> |
The graphic object. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
he optinal parameters.
|
Extends
Methods
-
addGraphics(graphics)
GraphicLayer.js, line 116 -
Adding a point feature does not overwrite the previous feature.
Name Type Description graphics
Array.<L.supermap.graphic> An array of point feature objects.
-
clear()
GraphicLayer.js, line 250 -
Release layer resources.
-
getGraphicBy(property, value){ol.Graphic}
GraphicLayer.js, line 127 -
Traverse each graphic in the Vector's feature array graphics, and return this graphic when 'graphic[property]===value' (and only return the first one).
Name Type Description property
string A property name for graphic.
value
string The value corresponding to the property.
Returns:
Type Description ol.Graphic A matching graphic. -
getGraphicById(graphicId){ol.Graphic}
GraphicLayer.js, line 145 -
Returns the corresponding vector element by giving an id.
Name Type Description graphicId
string Vector attribute id
Returns:
Type Description ol.Graphic A matching graphic. -
getGraphicsByAttribute(attrName, attrValue){Array.<ol.Graphic>}
GraphicLayer.js, line 155 -
Returns a list of all matching features by giving the key and value values of an attribute.
Name Type Description attrName
string A property name for graphic.
attrValue
string The value corresponding to the property.
Returns:
Type Description Array.<ol.Graphic> A matching graphic array. -
getRenderer(){Object}
GraphicLayer.js, line 259 -
Get the renderer.
Returns:
Type Description Object Internal renderer. -
getState(){Object}
GraphicLayer.js, line 268 -
Get the current map and layer status.
Returns:
Type Description Object Map and layer status, including map status information and related status of this layer. -
removeGraphics(graphics)
GraphicLayer.js, line 176 -
Delete feature arrays, all features will be deleted by default.
Name Type Default Description graphics
Array.<ol.Graphic> null optional The graphics array to be deleted.
-
setGraphics(graphics)
GraphicLayer.js, line 103 -
Setting the plotted point feature data will overwrite all previous features.
Name Type Description graphics
Array.<L.supermap.graphic> An array of point feature objects.
-
setStyle(styleOptions)
GraphicLayer.js, line 210 -
Set the overall style of the layer features.
Name Type Description styleOptions
Object Style object.
Name Type Default Description color
Array.<number> [0, 0, 0, 255] optional Point color.
radius
number 10 optional Point radius.
opacity
number 0.8 optional Opacity.
highlightColor
Array optional Highlight color, currently only supports rgba arrays.
radiusScale
number 1 optional Point magnification.
radiusMinPixels
number 0 optional The minimum radius (pixels).
radiusMaxPixels
number Number.MAX_SAFE_INTEGER optional The maximum radius (pixels).
strokeWidth
number 1 optional The size of the border.
outline
boolean false optional Whether to display the border.
-
update()
GraphicLayer.js, line 242 -
Update the layer, call it after the data or style changes.