Class: Map

nsVmap.Map

Class nsVmap.Map: initializes the map

Classes

MapPopup
MapTooltip
mapController
mapDirective

Members

oOpenLayersLocationStyle_{ol.style.Style}

Location style

oOpenLayersSelectionStyle_{ol.style.Style}

Selections style

Methods

addCustomProjections()

vmap/map/map.js, line 298

Add projections

addDrawInteraction(opt_options, currentAction){ol.interaction.Draw|Number}

vmap/map/map.js, line 527

Add a draw event on the map.

Name Type Description
options
Name Type Description
clickTolerance number | undefined

The maximum distance in pixels between "down" and "up" for a "up" event to be considered a "click" event and actually add a point/vertex to the geometry being drawn. Default is 6 pixels. That value was chosen for the draw interaction to behave correctly on mouse as well as on touch devices.

features ol.Collection.<ol.Feature> | undefined

Destination collection for the drawn features.

source ol.source.Vector | undefined

Destination source for the drawn features.

snapTolerance number | undefined

Pixel distance for snapping to the drawing finish. Default is 12.

type ol.geom.GeometryType

Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon' or 'Circle'). Required.

maxPoints number | undefined

The number of points that can be drawn before a polygon ring or line string is finished. The default is no restriction.

minPoints number | undefined

The number of points that must be drawn before a polygon ring or line string can be finished. Default is 3 for polygon rings and 2 for line strings.

style ol.style.Style | Array.<ol.style.Style> | ol.style.StyleFunction | undefined

Style for sketch features.

geometryFunction ol.interaction.DrawGeometryFunctionType | undefined

Function that is called when a geometry's coordinates are updated.

geometryName string | undefined

Geometry name to use for features created by the draw interaction.

condition ol.events.ConditionType | undefined

A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled. By default ol.events.condition.noModifierKeys, i.e. a click, adds a vertex or deactivates freehand drawing.

freehandCondition ol.events.ConditionType | undefined

Condition that activates freehand drawing for lines and polygons. This function takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled. The default is ol.events.condition.shiftKeyOnly, meaning that the Shift key activates freehand drawing.

wrapX boolean | undefined

Wrap the world horizontally on the sketch overlay. Default is false.

currentAction string | undefined

name of the current action

addEventOnMap(type, listener, opt_this, currentAction){goog.events.Key}

vmap/map/map.js, line 447

Add a certain type of event on the map.

Name Type Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object

The object to use as this in listener.

currentAction string | undefined

name of the current action

Returns:
Unique key for the listener.

addInteraction(interaction, currentAction){ol.interaction.Interaction}

vmap/map/map.js, line 590

Add a interaction

Name Type Description
interaction ol.interaction.Interaction
currentAction string | undefined

name of the current action

addOverlay(overlay){undefined}

vmap/map/map.js, line 634

Add an overlay witch will be remove when using removeActionsAndTooltips

Name Type Description
overlay ol.Overlay

addTextOverlayFeature(text, coordinates){undefined}

vmap/map/map.js, line 706

Add a text feature

Name Type Description
text string
coordinates array

addVectorLayer(opt_options){undefined}

vmap/map/map.js, line 749

Use this function to add a new vector layer

Name Type Description
options
Name Type Description
style object
extent object
minResolution object
maxResolution object
opacity object
properties object
visible object
zIndex object

getCurrentAction(){string}

vmap/map/map.js, line 1043

currentAction getter

Returns:
currentAction

getLayersToTransform(){nsVmap.Map.layersToTransform_}

vmap/map/map.js, line 1083

layersToTransform_ getter

getLocationOverlay(){ol.layer.Vector} experimental

vmap/map/map.js, line 996

nsVmap.Map.oOpenLayersLocationOverlay_ getter

Returns:
Location overlay

getLocationOverlayFeatures(){ol.Collection.<ol.Feature>} experimental

vmap/map/map.js, line 1006

nsVmap.Map.oOpenLayersLocationOverlayFeatures_ getter

Returns:
Location overlay features

getMapTooltip(){nsVmap.Map.MapTooltip}

vmap/map/map.js, line 1034

vmapTooltip_ getter

getOpenLayersLayers(){Array.<ol.layer>} experimental

vmap/map/map.js, line 914

nsVmap.Map.olLayers_ getter

Returns:
Layers array

getOpenLayersMap(){ol.map} experimental

vmap/map/map.js, line 956

nsVmap.Map.oOpenLayersMap_ getter

Returns:
Used map

getOpenLayersView(){ol.View} experimental

vmap/map/map.js, line 935

nsVmap.Map.olView_ getter

Returns:
Used view

getPrettyScale(scale){String}

vmap/map/map.js, line 258

Get the scale like (1:25,000)

Name Type Description
scale number
Returns:
scale (pretty)

getScale(opt_options){Number|String}

vmap/map/map.js, line 224

Get the current scale

Name Type Description
options
Name Type Description
pretty boolean | undefined

true for pretty format (ex: 1:25,000)

getSelectionOverlay(){ol.layer.Vector} experimental

vmap/map/map.js, line 976

nsVmap.Map.oOpenLayersSelectionOverlay_ getter

Returns:
Selection overlay

getSelectionOverlayFeatures(){ol.Collection.<ol.Feature>} experimental

vmap/map/map.js, line 986

nsVmap.Map.oOpenLayersSelectionOverlayFeatures_ getter

Returns:
Selection overlay features

getSelectionStyle(){ol.style.Style} experimental

vmap/map/map.js, line 1016

nsVmap.Map.oOpenLayersSelectionStyle_ getter

Returns:
Selection overlay

getTextOverlay(){ol.layer.Vector}

vmap/map/map.js, line 1065

vmapTextOverlay_ getter

getTextOverlayFeatures(){nsVmap.Map.vmapTextOverlayFeatures__}

vmap/map/map.js, line 1074

vmapTextOverlayFeatures_ getter

initMapTooltip(){undefined}

vmap/map/map.js, line 798

Initialize the vmapTooltip_

lambertToWGS(coordinates){ol.coordinates}

vmap/map/map.js, line 373

Tansform Lambert93 coordinates to WGS83

Name Type Description
coordinates ol.coordinates

Lambert93 coordinates to transform

Returns:
WGS84 coordinates

removeActionsAndTooltips(){undefined}

vmap/map/map.js, line 644

Remove the mapTooltip and the actions added by addEventOnMap, setEventOnMap, addDrawInteraction or setDrawInteraction

removeActionsOnMap(){undefined}

vmap/map/map.js, line 607

Remove the events and draw interactions added by addEventOnMap, setEventOnMap, addDrawInteraction or setDrawInteraction

reprojectFeatures(oldProjection, newProjection){undefined}

vmap/map/map.js, line 658

Transform the layers contained in layersToTransform to the new projection

Name Type Description
oldProjection ol.proj.ProjectionLike
newProjection ol.proj.ProjectionLike

setCurrentAction(currentAction)

vmap/map/map.js, line 1052

currentAction setter

Name Type Description
currentAction string

setDrawInteraction(opt_options, currentAction){ol.interaction.Draw|Number}

vmap/map/map.js, line 490

Add a draw event on the map and remove the others.

Name Type Description
options
Name Type Description
clickTolerance number | undefined

The maximum distance in pixels between "down" and "up" for a "up" event to be considered a "click" event and actually add a point/vertex to the geometry being drawn. Default is 6 pixels. That value was chosen for the draw interaction to behave correctly on mouse as well as on touch devices.

features ol.Collection.<ol.Feature> | undefined

Destination collection for the drawn features.

source ol.source.Vector | undefined

Destination source for the drawn features.

snapTolerance number | undefined

Pixel distance for snapping to the drawing finish. Default is 12.

type ol.geom.GeometryType

Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon' or 'Circle'). Required.

maxPoints number | undefined

The number of points that can be drawn before a polygon ring or line string is finished. The default is no restriction.

minPoints number | undefined

The number of points that must be drawn before a polygon ring or line string can be finished. Default is 3 for polygon rings and 2 for line strings.

style ol.style.Style | Array.<ol.style.Style> | ol.style.StyleFunction | undefined

Style for sketch features.

geometryFunction ol.interaction.DrawGeometryFunctionType | undefined

Function that is called when a geometry's coordinates are updated.

geometryName string | undefined

Geometry name to use for features created by the draw interaction.

condition ol.events.ConditionType | undefined

A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled. By default ol.events.condition.noModifierKeys, i.e. a click, adds a vertex or deactivates freehand drawing.

freehandCondition ol.events.ConditionType | undefined

Condition that activates freehand drawing for lines and polygons. This function takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled. The default is ol.events.condition.shiftKeyOnly, meaning that the Shift key activates freehand drawing.

wrapX boolean | undefined

Wrap the world horizontally on the sketch overlay. Default is false.

currentAction string | undefined

name of the current action

setEventOnMap(type, listener, opt_this, currentAction){goog.events.Key}

vmap/map/map.js, line 415

Set a event on the map and remove the others.

Name Type Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object

The object to use as this in listener.

currentAction string | undefined

name of the current action

Returns:
Unique key for the listener.

setInteraction(interaction, currentAction){ol.interaction.Interaction}

vmap/map/map.js, line 572

Remove events and interactions and then add a interaction

Name Type Description
interaction ol.interaction.Interaction
currentAction string | undefined

name of the current action

setOpenLayersLayers(layers) experimental

vmap/map/map.js, line 924

nsVmap.Map.olLayers_ setter

Name Type Description
layers Array.<ol.layer.Base>

Layers array

setOpenLayersMap(map) experimental

vmap/map/map.js, line 966

nsVmap.Map.oOpenLayersMap_ setter

Name Type Description
map ol.Map

Map to use

setOpenLayersView(view) experimental

vmap/map/map.js, line 945

nsVmap.Map.olView_ setter

Name Type Description
view ol.View

View to use

setScale(scale){number}

vmap/map/map.js, line 279

Set the map scale

Name Type Description
scale number
Returns:
new scale

setSelectionStyle(style) unstable

vmap/map/map.js, line 1026

nsVmap.Map.oOpenLayersSelectionStyle_ setter

Name Type Description
style ol.style.Style

FeatureOverlay Selection overlay

setTextOverlayFeature(text, coordinates){undefined}

vmap/map/map.js, line 690

Remove the text features and a new one

Name Type Description
text string
coordinates array

WGSToLambert(coordinates){ol.coordinates}

vmap/map/map.js, line 329

Tansform WGS83 coordinates to Lambert93

Name Type Description
coordinates ol.coordinates

WGS coordinates to transform

Returns:
Lambert93 coordinates