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

Documentation

Modules

  • Constants

Events

  • FEATURE_CLICK
  • FEATURE_HOVER
  • CHANGE_MEASURE
  • CLICK
  • FEATURES_CLICK
  • FIND_IMAGES_LOADED
  • LAYER_AOIS
  • MAP_INITIALIZE
  • MOVE_END
  • POINTER_MOVE
  • TILES_END_LOAD
  • TILES_START_LOAD
  • FEATURE_CLICK
  • FEATURE_HOVER

General

Classes / Controls

  • Bar
  • Button
  • Swipe
  • Toggle

Classes / Managers

  • LayerManager
  • MeasurementManager

Classes

  • Map

Geometry

Classes

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

Classes / Readers

  • GeoJSON
  • WKT

InfoBox

Classes

  • InfoBox

Layers

Classes / Internal

  • AOILayer
  • VexcelLayer

Classes

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

Measurements

Classes / Tools

  • LineTool
  • PointTool
  • PolygonTool

Classes

  • Measure

Services

Classes

  • UserService

Styles

Classes

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

Class

Map

Map(opts)

The map object generates an interactive map. You can customize the map by passing in number of different options. Some of these options can be specified when creating the map while others can be changed at any time. When loading the map, you can specify settings from the MapOptions.

Learn more about initializing maps with our map tutorial

Constructor

# new Map(opts)

Generate object with options

Parameters:
Name Type Attributes Default Description
opts object

Map core options.

target string

Div name where interactive map will reside

token number

Authentication token required to use the map

instanceId target <optional>

Instance Id

center string <optional>

The initial center for the view.

zoom string <optional>

Zoom level for the view.

aois boolean <optional>
false

Load aois for VexcelLayers

init Map~InitOpts <optional>
{layers:true,center:true,zoom:true,callback:null}

Object to establish which instance config it´s applied.

Tutorials:
  • Initialization
  • Init with username/password
  • Init with token
  • Init empty map
  • Map#event:CHANGE_MEASURE
  • Map#event:CLICK
  • Map#event:FEATURES_CLICK
  • Map#event:FIND_IMAGES_LOADED
  • Map#event:LAYER_AOIS
  • Map#event:MAP_INITIALIZE
  • Map#event:MOVE_END
  • Map#event:TILES_END_LOAD
  • Map#event:TILES_START_LOAD
Example

Create basic map. Always need at least a target container and token

const map = new Vexcel.Map({
      target: "map",
      token: API_KEY,
      });

Classes

Map

Methods

# addControl(control)

Add custom control to the map

Parameters:
Name Type Description
control object

element to add to the map

# addInfoBox(infobox)

Add the given infobox to the map. If the infobox has a location we show in the map if not you can show when you need with the function InfoBox~show

Parameters:
Name Type Description
infobox InfoBox

Infobox.

# changeMode(mode) → {Promise.<Map~ResponsePromise>}

Change map mode 2d/3d Select the collection in the top and change mode When change to 2d we force North orientation When change to 3d we persist the view orientation

Parameters:
Name Type Description
mode string

value from MapMode

Promise.<Map~ResponsePromise>

# changeOrientation(orientation) → {Promise.<Map~ResponsePromise>}

Change map orientation ViewerConstants.ViewerModes

Parameters:
Name Type Description
orientation string

value from MapOrientation

Promise.<Map~ResponsePromise>

# getLayerManager() → {LayerManager}

Get layer manager object that manage map layers

LayerManager

# getLocation() → {Location}

Gets the geographic coordinates of center of the view.

location object with [lat,lng] for the center of the image

Location

# getMode() → {module:constants~MapMode}

Return map mode, define is we are in 2d (Vertical) or 3d (Oblique)

mode for current view

module:constants~MapMode

# getViewExtent() → {Extent}

Get the extent for the current view state.

See:
  • Extent
Extent

# getZoom() → {number}

Get the current zoom level. This method may return non-integer zoom levels if the view does not constrain the resolution, or if an interaction or animation is underway.

zoom Zoom level

number

# removeControl(control)

Remove custom control from the map

Parameters:
Name Type Description
control object

element to add to the map

# setLocation(location)

Centers the map in the given point.

Parameters:
Name Type Description
location Location

# setViewExtent(extent)

Fit to extent, move the map to fit this extent

Parameters:
Name Type Description
extent Extent
See:
  • Extent

# setZoom(zoom)

Zoom to a specific zoom level

Parameters:
Name Type Description
zoom number

Zoom level

Type Definitions

# InitOpts

Properties:
Name Type Attributes Default Description
layers boolean <optional>
true

Layers visible at start.

center boolean <optional>
true

Use center defined in instance config. Use over map config.

zoom boolean <optional>
true

Use zoom defined in instance config. Use over map config.

callback function <optional>

Callback called when the map finish the initialization.

Object

# MapStatus

Map status with the relevant info for location zoom extent

Properties:
Name Type Attributes Description
extent Array.<number> <optional>

Extent for map view

center number <optional>

Coordinates for map center

zoom object <optional>

Zoom level

Object

# ResponsePromise

Response promise

Properties:
Name Type Attributes Description
msg string <optional>

status message

status number <optional>

status code

layer object <optional>

layer

Events

object

# CHANGE_MEASURE

Event triggered after creating or editing a new measurement with the measurement tools

Parameters:
Name Type Description
(object}

event - Internal event

Properties:
Name Type Description
measure Measure

Measure object

object

# CLICK

Event Triggered when user single clicks on the map. This event is not triggered if drawing tools are enabled or if the user clicks on a feature on the map.

Properties:
Name Type Description
location Location

Location of the coordinates for this event

drawing boolean

Return if any of drawing/measurement tools are enabled

object

# FEATURES_CLICK

Event Triggered when user clicks on a space on the map occupied by multiple features. Only fired if there is more than one feature

Properties:
Name Type Description
location Location

Location for point clicked

features Array.<Feature>

List of features when you click

Example

Listener in map to listen on features click

core.addListener(Vexcel.Events.MapEvents.FEATURES_CLICK, (e) => {
        e.features.map(feat => console.log(JSON.stringify(feat);)
    });
  }
});

object

# FIND_IMAGES_LOADED

Event triggered after map loads images for the center of the map in the viewport

Properties:
Name Type Description
images Array.<object>

List of images loaded for the center of the map

point Array.<number>

Point of the center of the image

epsg string

Epsg code for point coordinates

# LAYER_AOIS

Event triggered when map loads AOIs for a Vexcel layer

object

# MAP_INITIALIZE

Event triggered after map is initialized and layers are loaded

Properties:
Name Type Description
map Map

Map object

status Map~MapStatus

Object with the status of the map

object

# MOVE_END

Event Triggered after the map is moved.

object

# POINTER_MOVE

Event triggered when a pointer is moved. Note that on touch devices this is triggered when the map is panned, so it is not the same as moving the mouse.

Properties:
Name Type Description
location Location

Location for point

# TILES_END_LOAD

Event triggered when the map finishes loading the tiles

# TILES_START_LOAD

Event triggered when the map starts loading the tiles

Documentation generated by Vexcel Imaging