Class: Permalink service:gmfPermalink

The Permalink service for GMF, which uses the ngeo.StateManager to manage the GMF application state. Here's the list of states are are managed:

  • the map center and zoom level
  • the current background layer selected
  • whether to add a crosshair feature in the map or not
  • the dimensions value

To have the whole possibilities offer by the permalink, these services should be instantiated: ngeoBackgroundLayerMgr, ngeoFeatureOverlayMgr, ngeoFeatureHelper, gmfPermalinkOptions, gmfThemes, gmfObjectEditingManager, gmfThemeManager, defaultTheme, gmfTreeManager, ngeoWfsPermalink, ngeoAutoProjection and ngeoFeatures.

Parameters:
Name Type Description
$timeout angular.$timeout

Angular timeout service.

$rootScope angular.Scope

Angular rootScope.

$injector angular.$injector

Main injector.

ngeoDebounce ngeo.Debounce

ngeo Debounce service.

ngeoStateManager ngeo.StateManager

The ngeo StateManager service.

ngeoLocation ngeo.Location

ngeo location service.

Members

gmfUser_: gmfx.User

(inner, constant, non-null) gmfPermalinkOptions: gmfx.PermalinkOptions

The options to configure the gmf permalink service with.

(inner, constant, nullable) ngeoFeatureOverlayMgr: ngeo.FeatureOverlayMgr

Methods

defaultThemeName()

Get the default theme from url, local storage, user functionalities or defaultTheme constant.

Returns:
?string

default theme name.

defaultThemeNameFromFunctionalities()

Get the default theme from user functionalities.

Returns:
?string

default theme name.

getBackgroundLayer(layers)

Get the background layer object to use to initialize the map from the state manager.

Parameters:
Name Type Description
layers !Array.

Array of background layer objects.

Returns:
?ol.layer.Base

Background layer.

getFeatures()

Get the ngeo features from the state manager for initialization purpose

Returns:
!Array.

The features read from the state manager.

getMapCenter()

Get the coordinate to use to initialize the map view from the state manager.

Returns:
?ol.Coordinate

The coordinate for the map view center.

getMapCrosshair()

Get the map crosshair property from the state manager, if defined.

Returns:
boolean

Whether map crosshair property is set or not.

getMapTooltip()

Get the tooltip text from the state manager.

Returns:
string|undefined

Tooltip text.

getMapZoom()

Get the zoom level to use to initialize the map view from the state manager.

Returns:
number|undefined

The zoom for the map view.

refreshFirstLevelGroups()

Get the current first level node names in the tree manager and update the correspondent state of the permalink.

setDimensions(dimensions)

Parameters:
Name Type Description
dimensions !Object.

The global dimensions object.

setMap(map)

Bind an ol3 map object to this service. The service will, from there on, listen to the properties changed within the map view and update the following state properties: map_x, map_y and map_zoom.

If the service is already bound to a map, those events are unlistened first.

Parameters:
Name Type Description
map ?ol.Map

The ol3 map object.

setMapCrosshair([opt_center]opt)

Sets the map crosshair to the center (or the map center if nothing provided). Overwrites an existing map crosshair.

Parameters:
Name Type Attributes Description
[opt_center] ?ol.Coordinate= <optional>

Optional center coordinate.

setMapTooltip(tooltipText, [opt_center]opt)

Sets the map tooltip to the center (or the map center if nothing provided). Overwrites an existing map tooltip.

Parameters:
Name Type Attributes Description
tooltipText string

Text to display in tooltip.

[opt_center] ?ol.Coordinate= <optional>

Optional center coordinate.