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

Feature

Feature(geometry)

This class contains functionality shared among geometry objects, such as Point, Line, Polygon, and MultiPolygon.

Features can be styled individually with setStyle; otherwise they use the style of their vector layer. Learn more about creating features in the Vector Layer tutorial.

Constructor

# new Feature(geometry)

Parameters:
Name Type Description
geometry Geometry

Any geometry object: Point, Line, Polygon, MultiPolygon

Tutorials:
  • Vector Layer
  • Feature#event:FEATURE_CLICK
  • Feature#event:FEATURE_HOVER
Example

Create simple feature

const location = new Vexcel.Geometry.Location(20, 20);
const point = new Vexcel.Geometry.Point(location);
const feature = new Vexcel.Geometry.Feature(point);

Classes

Feature

Methods

# clone() → {Feature.<Geometry>}

Clone this feature. If the original feature has a geometry it is also cloned.

The clone

Feature.<Geometry>

# get(key) → {any}

Gets a value

Parameters:
Name Type Description
key string
any

# getBoundingBox() → {Extent}

Get extent/bounding box for feature geometry in geographic coordinates [minx, miny, maxx, maxy]

bounding box

Extent

# getGeometry() → {Geometry}

Get the feature's default geometry

The geometry for the feature.

Geometry

# getKeys() → {Array.<string>}

Get a list of object property names.

List of property names.

Array.<string>

# getProperties() → {Object.<string, *>}

Get an object of all property names and values.

Object.

Object.<string, *>

# getStyle() → {Style}

Get the feature's style

The feature style.

Style

# set(key, value)

Sets a value.

Parameters:
Name Type Description
key string

Key name.

value any

Value.

# setGeometry(geometry)

Set the default geometry for the feature.

Parameters:
Name Type Description
geometry Geometry

The new geometry.

# setProperties(values)

Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

Parameters:
Name Type Description
values Object.<string, *>

Values.

# setStyle(styleopt)

Set the style for the feature to override the layer style. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. To unset the feature style, call setStyle() without arguments or a falsey value.

Parameters:
Name Type Attributes Description
style Style <optional>

Style for this feature.

# toGeoJSON() → {string}

Convert feature geometry to GeoJSON string with xy coordinates [long, lat]

string

# toWKT() → {string}

Convert feature geometry to WKT string with xy coordinates [long, lat]

string

Events

# FEATURE_CLICK

Event triggered when a feature receives a click

Parameters:
Name Type Description
location Location

Location of the coordinates for this event

layer VectorLayer

Layer for this feature

Example

Event for click on feature

feature.addListener(Vexcel.Events.MapEvents.FEATURE_CLICK, (e) => {
        console.log(JSON.stringify(e.feature));
    });

# FEATURE_HOVER

Event triggered when hovering over a feature in the map

Parameters:
Name Type Description
location Location

Location of the coordinates for this event

layer VectorLayer

Layer for this feature

hover boolean

if the feature is hovered or not. False it's triggered when pointer does not intersect when the geometry

Example

Event for hover on feature

feature.addListener(Vexcel.Events.MapEvents.FEATURE_HOVER, (e) => {
        console.log(JSON.stringify(e.feature));
    });

Documentation generated by Vexcel Imaging