Class MapEditorViewer

This class performs all the readonly updates on the map

Ssee theMapEditor for read/write updates on the map

Source : file core/mapEditor/MapEditorViewer.js at line 61

Constructor

new MapEditorViewer ( )

The constructor

Source : file core/mapEditor/MapEditorViewer.js at line 105

Public methods

addNote ( noteObjId )

This method add a note on the map This method is called by the 'noteupdated' event listener of the viewer and indirectly by the MapEditor.updateNote( ) method

Source : file core/mapEditor/MapEditorViewer.js at line 194

Parameters

Name Type Description
noteObjId Number

The objId of the note to add

Returns

An object with a reference to the Leaflet objects of the note
Type : NoteLeafletObjects

addRoute ( routeObjId )

This method add a route on the map This method is called by the 'routeupdated' event listener of the viewer and by the MapEditor.updateRoute( ) method

Source : file core/mapEditor/MapEditorViewer.js at line 131

Parameters

Name Type Description
routeObjId Number

The objId of the route to add

Returns

The added Route
Type : Route

addToMap ( objId, leafletObject )

Add a Leaflet object to the map

Source : file core/mapEditor/MapEditorViewer.js at line 117

Parameters

Name Type Description
objId Number

The objId to use

leafletObject LeafletObject

The Leaflet object to add

onGeolocationPositionChanged ( position )

This method is called when the geolocation position is changed

Source : file core/mapEditor/MapEditorViewer.js at line 385

Parameters

Name Type Description
position GeolocationPosition

A JS GeolocationPosition object

onGeolocationStatusChanged ( geoLocationStatus )

This method is called when the geolocation status is changed

Source : file core/mapEditor/MapEditorViewer.js at line 348

Parameters

Name Type Description
geoLocationStatus GEOLOCATION_STATUS

The geolocation status

setLayer ( layer, url )

This method changes the background map. This method is called by the 'layerchange' event listener of the viewer and by the MapEditor.setLayer( ) method

Source : file core/mapEditor/MapEditorViewer.js at line 299

Parameters

Name Type Description
layer MapLayer

The layer to set

url String

The url to use for this layer (reminder: url !== layer.url !!! See MapEditor.setLayer)

zoomTo ( latLng, geometry )

This method zoom to a point or an array of points

Source : file core/mapEditor/MapEditorViewer.js at line 280

Parameters

Name Type Description
latLng Array of Number

The point

geometry Array of Array of Array of Number

The array of points...

Private properties

#currentLayer : LeafletObject

A reference to the L.tileLayer object that contains the current map

Source : file core/mapEditor/MapEditorViewer.js at line 68

#geolocationCircle : LeafletObject

A reference to the L.circleMarker object used for the geolocation

Source : file core/mapEditor/MapEditorViewer.js at line 75

Private getters and setters

readonly static get #DEFAULT_MAX_ZOOM : Number

Simple constant for the max possible zoom

Source : file core/mapEditor/MapEditorViewer.js at line 83

readonly static get #DEFAULT_MIN_ZOOM : Number

Simple constant for the min possible zoom

Source : file core/mapEditor/MapEditorViewer.js at line 91

readonly static get #NOTE_Z_INDEX_OFFSET : Number

Simple constant for the z-index css value for notes

Source : file core/mapEditor/MapEditorViewer.js at line 99

Private methods

#onGeoLocationPositionClick ( clickEvent )

Click on the geo location circle event listener

Source : file core/mapEditor/MapEditorViewer.js at line 363

Parameters

Name Type Description
clickEvent Event

The event to handle