logo
API Documentation
Tutorials
Getting Started Initialization Layers Third party Controls Geometries Vector styles Measures InfoBox Utils
Releases

Documentation

Modules

  • Constants

Events

  • FEATURE_CLICK
  • FEATURE_HOVER
  • CENTER_DATE_IMAGE
  • CHANGE_MEASURE
  • CLICK
  • COMPLETE_COLLECTIONS
  • FEATURES_CLICK
  • FIND_IMAGES_LOADED
  • FINISH_MEASURE
  • MAP_INITIALIZE
  • MAP_STATUS_EVENT
  • MOVE_END
  • NO_3D_IMAGES
  • POINTER_MOVE
  • START_MEASURE
  • TILES_END_LOAD
  • TILES_START_LOAD
  • FEATURE_CLICK
  • FEATURE_HOVER

General

Classes / Controls

  • Bar
  • Button
  • Swipe
  • Toggle

Classes / Managers

  • CollectionManager
  • OverlayManager

Classes

  • Map

Classes / View

  • MapStatusView

Geometry

Classes

  • Extent
  • Feature
  • Line
  • Location
  • MultiPolygon
  • Point
  • Polygon

Classes / Readers

  • GeoJSON
  • WKT

InfoBox

Classes

  • InfoBox

Layers

Classes

  • ArcGISLayer
  • BingLayer
  • GroupLayer
  • ImageryLayer
  • OSMLayer
  • VectorLayer
  • VectorTileLayer
  • WFSLayer
  • WMSLayer
  • WMTSLayer
  • XYZLayer

Classes / Base Layers

  • BaseLayer
  • BaseVectorLayer

Measurements

Classes / Tools

  • CircleTool
  • HeightTool
  • LineTool
  • PointTool
  • PolygonTool
  • RectangleTool
  • RelativeHeightTool

Classes

  • Measure

Objects

Classes

  • Collection
  • CollectionStatus
  • Image
  • LayerCollections
  • LayerCollectionsStatus
  • MapStatus

Services

Classes

  • UserService

Styles

Classes

  • Circle
  • Fill
  • Icon
  • RegularShape
  • Stroke
  • Style
  • Text

Utils

Classes

  • Transform

Class

Icon

Icon(opts)

Set icon style for vector features.

Learn more about implementing Icons in our Point styles and Point shapes styles tutorials

Constructor

# new Icon(opts)

Initialization object

Parameters:
Name Type Attributes Default Description
opts object

Options

rotateWithView boolean <optional>

If the image should get rotated with the view.

rotation number <optional>

Rotation.

scale number <optional>

Scale.

displacement number <optional>

Displacement.

anchor Array.<number> <optional>
[0.5, 0.5]

Anchor. Default value is the icon center.

color string <optional>

Color to tint the icon. If not specified, the icon will be left as is.

offset Array.<number> <optional>
[0, 0]

Offset, which, together with the size and the offset origin, define the sub-rectangle to use from the original icon image.

displacement Array.<number> <optional>
[0,0]

Displacement the icon

offsetOrigin string <optional>
'top-left'

Origin of the offset: bottom-left, bottom-right, top-left or top-right.

opacity number <optional>
1

Opacity of the icon.

scale number <optional>
1

Scale.

rotateWithView boolean <optional>
false

Whether to rotate the icon with the view.

rotation number <optional>
0

Rotation in radians (positive rotation clockwise).

size number <optional>

Icon size in pixel. Can be used together with offset to define the sub-rectangle to use from the origin (sprite) icon image.

imgSize number <optional>

Image size in pixels. Only required if img is set and src is not, and for SVG images in Internet Explorer 11. The provided imgSize needs to match the actual size of the image.

src string <optional>

Image source URI.

Tutorials:
  • Point styles
  • Point shapes styles

Classes

Icon

Methods

# getAnchor() → {Array.<number>}

Get the anchor point in pixels. The anchor determines the center point for the symbolizer.

Anchor.

Array.<number>

# getDisplacement() → {Array.<number>}

Get the displacement of the shape

Shape's center displacement

Array.<number>

# getFill() → {Fill}

Get the fill style for the shape.

Fill style.

Fill

# getOpacity() → {number}

Get the symbolizer opacity.

Opacity.

number

# getRotateWithView() → {boolean}

Determine whether the symbolizer rotates with the map.

Rotate with map.

boolean

# getRotation() → {number}

Get the symoblizer rotation.

Rotation.

number

# getScale() → {number}

Get the symbolizer scale.

Scale.

number

# getSize() → {Array.<number>}

Get the size of the symbolizer (in pixels).

Size.

Array.<number>

# getSrc() → {string}

Get the image URL.

Image src.

string

# getStroke() → {Stroke}

Get the stroke style for the shape.

Stroke style.

Stroke

# setOpacity(opacity)

Set the opacity.

Parameters:
Name Type Description
opacity number

Opacity.

# setRotateWithView(rotateWithView)

Set whether to rotate the style with the view.

Parameters:
Name Type Description
rotateWithView boolean

Rotate with map.

# setRotation(rotation)

Set the rotation.

Parameters:
Name Type Description
rotation number

Rotation.

# setScale(scale)

Set the scale.

Parameters:
Name Type Description
scale number

Scale.

Documentation generated by Vexcel Imaging