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
  • VISIBILITY_CHANGE
  • CENTER_DATE_IMAGE
  • CHANGE_MEASURE
  • CLICK
  • COMPLETE_COLLECTIONS
  • FEATURES_CLICK
  • FIND_IMAGES_LOADED
  • FINISH_MEASURE
  • MAP_INITIALIZE
  • MAP_STATUS_EVENT
  • MAP_VISIBILITY_CHANGE
  • 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
  • MeasurementManager
  • OverlayManager

Classes

  • Map

Classes / View

  • MapStatusView

Geometry

Classes

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

Classes / Readers

  • GeoJSON
  • WKT

InfoBox

Classes

  • InfoBox

Layers

Namespaces

  • LayerEvents

Classes

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

Classes / Base Layers

  • BaseGroupLayer
  • 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

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. You must provide at least one of the following parameters: token, apiKey, geoKey, or impersonationKey.

Parameters:
Name Type Attributes Default Description
opts object

Map core options.

target string

Div name where interactive map will reside

token number <optional>

The authentication token, required if no other authentication method is provided.

apiKey number <optional>

The authentication api key, required if no other authentication method is provided.

geoKey number <optional>

The authentication geo key, required if no other authentication method is provided.

impersonationKey number <optional>

The authentication impersonation key, required if no other authentication method is provided.

mapId target <optional>

Map Id. IMPORTANT. If no ID is informed, the used map will be the first map assigned to the user ordered alphabetically.

center Array.<number> <optional>

The initial center for the view.

zoom number <optional>

Zoom level for the view.

maxZoom number <optional>

The maximum zoom level used to determine the resolution constraint.

minZoom number <optional>

The minimum zoom level used to determine the resolution constraint.

mode string <optional>
"2D"

Initial mode in which the map will be initialized

image string <optional>

Initial image in which the map will be initialized, necessary 3D mode

orientation string <optional>
"N"

Initial orientation in which the map will be initialized

layerSwitcher boolean <optional>
false

Add built-in layer switcher control to the map.

zoomControl boolean <optional>
false

Add built-in zoom control to the map.

initialConfig Map~InitOpts <optional>
{overlays:null,imageryLayers:null,center:true,zoom:true,callback:null}

Object to establish which map config it´s applied.

restrictedExtent Extent <optional>

The extent that the map will be restricted to.

Tutorials:
  • Initialization
  • Init with username/password
  • Init with constrained zoom levels
  • Init with token
  • Init empty map
  • Init in 3D mode
  • Init map with a restricted extent
  • Map#event:CENTER_DATE_IMAGE
  • Map#event:CHANGE_MEASURE
  • Map#event:CLICK
  • Map#event:FEATURES_CLICK
  • Map#event:FIND_IMAGES_LOADED
  • Map#event:FINISH_MEASURE
  • Map#event:MAP_INITIALIZE
  • Map#event:MAP_VISIBILITY_CHANGE
  • Map#event:MOVE_END
  • Map#event:START_MEASURE
  • 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

Add the given infobox to the map.

# changeMap(mapId)

Change map.

Parameters:
Name Type Description
mapId number

Map Id. IMPORTANT. If no ID is informed, the used map will be the first instance assigned to the user ordered alphabetically.

CoreMap

# 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 ViewMode

Promise.<Map~ResponsePromise>

# getBrightness() → {number}

Returns the brightness value of the Geomni BASE_LINE when is the base layer. If the base layer is not Geomni BASE_LINE return -1. The default brightness value of Geomni BASE_LINE layer is 100.

A value in the range [0-500]

number

# getCollectionManager() → {CollectionManager}

Get collection manager

CollectionManager

# getImageryLayer() → {ImageryLayer}

Get imagery layer object that manage the imagery data

ImageryLayer

# getLocation() → {Location}

Gets the geographic coordinates of center of the view.

Location

# getMapStatusView() → {MapStatusView}

Get map status view that allow to visualize the status of the map

MapStatusView

# getMeasurementManager() → {MeasurementLayer}

Get measurement manager object that manage measurement tools

MeasurementLayer

# getOverlayManager() → {OverlayManager}

Get overlay manager object that manage map layers

OverlayManager

# 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.

number

# setBrightness(brightness)

Sets the brightness value of the Geomni BASE_LINE when is the base layer.

Parameters:
Name Type Description
brightness number

A value in the range [0-500]. The default brightness value of Geomni BASE_LINE layer is 100;

# setCenter(center, EPSG)

Centers the map in the given point.

Parameters:
Name Type Description
center Array.<number>

The point with the new coordinates where the map will be centered [lat, lng].

EPSG string

epsg code "epsg:4326" by default

# 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

Type Definitions

# InitOpts

Properties:
Name Type Attributes Default Description
overlays Map~VisibilityConfig <optional>
null

Overlays visibility config at start.

imageryLayers Map~VisibilityConfig <optional>
null

ImageryLayers visibility config at start. Value from VexcelLayers

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.

# VisibilityConfig

Properties:
Name Type Attributes Default Description
visible Array.<string> <optional>
null

Names visible at start.

disabled Array.<string> <optional>
null

Names invisible at start.

Events

object

# CENTER_DATE_IMAGE

Event triggered when center image change

object

# CHANGE_MEASURE

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

Parameters:
Name Type Description
event object

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

# COMPLETE_COLLECTIONS

Event triggered when map loads all collections

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

object

# FINISH_MEASURE

Event triggered after finish a new measurement with the measurement tools

Parameters:
Name Type Description
event object

Internal event

Properties:
Name Type Description
measure Measure

Measure object

object

# MAP_INITIALIZE

Event triggered after map is initialized and layers are loaded

Properties:
Name Type Description
map Map

Map object

status MapStatus~status

Object with the status of the map

object

# MAP_STATUS_EVENT

Dispatches a map status update event.

Parameters:
Name Type Description
status MapStatus

The updated map status.

  • event:MapStatusEvent

object

# MAP_VISIBILITY_CHANGE

Event triggered when the layer switcher change layers visibility, only works when layer switcher is enabled

Properties:
Name Type Description
layer BaseLayer

Layer that changed visibility

visible boolean

New visibility state

object

# MOVE_END

Event Triggered after the map is moved.

object

# NO_3D_IMAGES

Event triggered when no images to 3D mode

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

object

# START_MEASURE

Event triggered after start a new measurement with the measurement tools

Parameters:
Name Type Description
event object

Internal event

Properties:
Name Type Description
measure Measure

Measure object

# 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