Namespace: global

Mapspace. global

This is the main namespace of the Global module, that contains the Mapspace.global.Viewer class. This viewer is able to show any type of info, switching from one type of data to another following some rules. For example, this viewer can show ortho and oblique imagery at the same time and at certain resolutions switch between ortho data to oblique data and viceversa.

Actually the viewer is a container for the other types of viewers, so this module is dependent on the rest of the modules.

Source:
mapspace-global/bu.global.jsdoc

Classes

ImageAvailableEvent
Viewer

Namespaces

controldef

Type Definitions


ActionType

Types of actions that result in the application of new options in the viewer.

Name Value
Mapspace.global.ActionType.INITIALIZE initialize
Mapspace.global.ActionType.ORTHOINTERACTED orthointeracted
Mapspace.global.ActionType.OBLIQUEINTERACTED obliqueinteracted
Mapspace.global.ActionType.SYNC sync
Mapspace.global.ActionType.MODECHANGE modechange
Mapspace.global.ActionType.GEOLOCATION geolocation
Source:
mapspace-global/enums.js

ViewerEventType

Type of events for a Mapspace.global.Viewer.

Name Value Description
Mapspace.global.ViewerEventType.VIEWMODECHANGED change:viewmode The view mode has changed.
Mapspace.global.ViewerEventType.SWIPELAYERCHANGED change:swipelayer The swipe layer has changed.
Mapspace.global.ViewerEventType.VIEWERVISIBILITYCHANGED viewervisibilitychanged The visibility changed.
Mapspace.global.ViewerEventType.IMAGEAVAILABILITYCHANGED imageavailabilitychanged The availability of images has changed.
Source:
mapspace-global/enums.js

ViewerOptions

Options for Mapspace.global.Viewer.

Properties:
Name Type Description
name string | undefined

The name of the viewer.

target Element | string | undefined

The DOM target element where this viewer will be appended.

outputprojection string | undefined

The viewer output projection. The 'EPSG:code' string with the projection to use in any control linked to this viewer when showing coordinates.

debugmode boolean | undefined

If activate the debug mode or not. By default is false. This mode is only active when Mapspace.DEBUG global variable is set to true and the user has the required permissions. The mode shows several extra information on top of existing layers and offer a debug panel.

debuggrid boolean | undefined

If activate a debug grid or not. By default is false. This mode is only active when Mapspace.DEBUG global variable is set to true and the user has the required permissions. If debugmode is set to false then this mode is ignored. The mode shows the grid of tiles with IDs for the main tile layer.

time string | undefined

Time filter of the viewer. Valid time values are any string with pattern YYYYMMDD or with pattern YYYYMMDD-YYYYMMDD. First filters images before the date, and second filters images between the dates.

imageid string | undefined

Image ID to open on start if the mode to show in start is Oblique mode.

pixelCenter Mapspace.Coordinate | undefined

Center in pixels. Only used if imageid is set, if not it is ignored. You must ensure that center matches the world coordinates for this pixel and that it is correctly set or initialization of the viewer will produce wrong results.

center Mapspace.Coordinate | undefined

The initial center for the view. The coordinate system for the center is always an EPSG:4326 LanLot. If the mode to show in start is Oblique mode and both a center and an imageid are provided, then the center will be used.

constrainRotation boolean | number | undefined

Rotation constraint. false means no constraint. true means no constraint, but snap to zero near zero. A number constrains the rotation to that number of values. For example, 4 will constrain the rotation to 0, 90, 180, and 270 degrees. The default is true.

enableRotation boolean | undefined

Enable rotation. Default is true. If false a rotation constraint that always sets the rotation to zero is used. The constrainRotation option has no effect if enableRotation is false.

extent Mapspace.Extent | undefined

The extent that constrains the center, in other words, center cannot be set outside this extent. Default is undefined.

maxResolution number | undefined

The maximum resolution used to determine the resolution constraint. It is used together with minResolution (or maxZoom) and zoomFactor. If unspecified it is calculated in such a way that the projection's validity extent fits in a 256x256 px tile. If the projection is Spherical Mercator (the default) then maxResolution defaults to 40075016.68557849 / 256 = 156543.03392804097.

minResolution number | undefined

The minimum resolution used to determine the resolution constraint. It is used together with maxResolution (or minZoom) and zoomFactor. If unspecified it is calculated assuming 29 zoom levels (with a factor of 2). If the projection is Spherical Mercator (the default) then minResolution defaults to 40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253.

maxZoom number | undefined

The maximum zoom level used to determine the resolution constraint. It is used together with minZoom (or maxResolution) and zoomFactor. Default is 28. Note that if minResolution is also provided, it is given precedence over maxZoom.

minZoom number | undefined

The minimum zoom level used to determine the resolution constraint. It is used together with maxZoom (or minResolution) and zoomFactor. Default is 0. Note that if maxResolution is also provided, it is given precedence over minZoom.

projection string | undefined

The projection when in Ortho mode. Default is EPSG:3857 (Spherical Mercator).

resolution number | undefined

The initial resolution for the view. The units are projection units per pixel (e.g. meters per pixel). An alternative to setting this is to set zoom. Default is undefined, and layer sources will not be fetched if neither this nor zoom are defined.

resolutions Array.<number> | undefined

Resolutions to determine the resolution constraint. If set the maxResolution, minResolution, minZoom, maxZoom, and zoomFactor options are ignored.

rotation number | undefined

The initial rotation for the view in decimal degrees (positive rotation clockwise). Default is 0.

zoom number | undefined

Only used if resolution is not defined. Zoom level used to calculate the initial resolution for the view. The initial resolution is determined using the ol.View#constrainResolution method.

zoomFactor number | undefined

The zoom factor used to determine the resolution constraint. Default is 2.

layers Array.<ol.layer.Base> | ol.Collection.<ol.layer.Base> | undefined

Layers. If this is not defined, a viewer with no layers will be rendered. Note that layers are rendered in the order supplied, so if you want, for example, a vector layer to appear on top of a tile layer, it must come after the tile layer.

rotatorType Mapspace.control.RotatorType | undefined

The type of rotator control that must be used as default when a workspace is deserialized. By deafult is Mapspace.control.RotatorType.DEFAULTROTATOR.

pin boolean | undefined

If add a pin icon in the center of the viewer when viewer is loaded first time. By default is false.

label boolean | string | undefined

If show a pin icon and a label in the center of the viewer when viewer is loaded first time. By default is false. If it is true then executes a reverse geocoding in the location and label is the address found. If it is a string then no reverse geocoding is executed and the label is the string.

Source:
mapspace-global/typedefs.js

ViewerProperty

Properties of a Mapspace.global.Viewer.

Name Value
Mapspace.global.ViewerProperty.VIEWMODE viewmode
Mapspace.global.ViewerProperty.SWIPELAYER swipelayer
Source:
mapspace-global/enums.js