Hierarchy

  • PermalinkService

Constructors

  • The Permalink service for GMF, which uses the ngeo.statemanager.Service 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

    For time layers the time range or time value is added

    It can also be used to add different types of things in the map, such as features, external data sources, etc.

    This is made using parameters in the url, which can be static (i.e. parameters that always have the same name) or dynamic (i.e. parameters that have a static prefix but with a full name being dynamic).

    Here's a complete list of possible parameters and what they do. But first, a legend

    === Parameters [type] ===

    • [paramameter_name] (type) [parameter documentation]

    === Parameters (static) ===

    A static parameter always have the same name.

    • baselayer_ref - "string" The name of the base layer that should be set visible as default in the map. If none is set, then the default one in the loaded theme is set instead.

    • eds_n (string), eds_u (string) These parameters stand for:

      • eds_n: "External Data Sources Names"
      • eds_u: "External Data Sources URLs" These parameters define external WMS/WMTS data sources to add to the map upon initialization. Both values are comma-separated lists, eds_u containing the urls to the services and eds_n the layer names (separated by ;). Here's an example: &eds_n=a;b;c,d,e&eds_u=host1.com,host2.com,host3.com, which reads as:
      • host1.com - layers: a, b and c
      • host2.com - layers: d
      • host3.com - layers: e For these parameters to work properly, they must define the same number of elements, i.e. same number of names and urls.
    • map_crosshair (boolean) If this parameter set to true, then a crosshair marker will be added to the center of the map upon initialization. The marker will stay at this location.

    • map_tooltip (string) If set, then the text defined in this parameter will be added as a tooltip at center of the map upon initialization.

    • map_x (number), map_y (number) These two parameters define a coordinate the map view should be centered to upon initialization. The value must be in the map view projection.

    • map_zoom (number) Defines the zoom level the map view should be zoomed to upon initialization.

    • rl_features (string) This parameter defines vector features to add to the map upon initialization. In addition, if the application includes the draw tool, the features added can be modified. The draw tool can also be used to add new features, which are automatically added in the url.

    • tree_groups (string) Defines the layer groups that should be added to the layer tree upon application initialization as a comma-separated list. For example: Layers,Filters,Externals

    • wfs_layer (string) If set, this parameter defines the name of a layer that supports WFS to use to fetch features and add them to the map upon initialization. The dynamic parameter wfs_[] is required to identify the features to fetch.

    • wfs_ngroups (number) If set, then wfs_layer represents the name of a group and this property defines how many layers are in it. Requires wfs_layer to be set.

    • wfs_show_features (boolean) If set to false or 0, then the features returned by the wfs_layer parameter will not be shown in the map.

    === Parameters (dynamic) ===

    Dynamic parameters have variable names, which is always composed of:

    • a static prefix
    • a variable suffix

    The same dynamic parameter can be set multiple times, with different suffix values as name.

    For example: &wfs_a=&wfs_b=.

    • wfs_ is the static prefix

    • the name used as reference for this dynamic parameter is wfs_[]

    • therefore, this example has 2 wfs_[] parameters set, with a and b being the variable suffix

    • dim_[] (string) Variable suffix: the name of a dimension Value: * Defines the value of a specific dimension to set upon loading the application. For example: &dim_time=2019-01-25T14:45:51.986Z. WMS data sources that support the dimension set will be initialized with its value.

    • tree_enable_[] (boolean) Variable suffix: the name of a layer group Value: whether the group should be enabled or not in the layer tree For example: &tree_enable_polygon=true&tree_enable_point=false means that the group polygon will be enabled in the layer tree, but not point.

    • tree_group_layers_[] (string) Variable suffix: the name of a layer group Value: a comma-separated list of layers within the group that should be enabled upon initialization. For example: &tree_group_layers_polygon=forest,lake means that only the layers forest and lake within the group polygon would be enabled upon initialization.

    • tree_opacity_[] (number) Variable suffix: the name of a layer group Value: Number between 0 (transparent) and 1 (opaque) Defines the opacity of a layer group upon initialization.

    • tree_time_[] (date) Variable suffix: the name of a layer group or layer Value: a date or date interval with the resolution of the time of the layer or group Defines the time or time interval for a time layer or a group.

    • wfs_[] (string) Variable suffix: the name of an attribute Value: A comma-separated list of values for the attribute This parameter requires wfs_layer in order to work properly. If set, it defines the filters to build to fetch the features to add to the map. For example: &wfs_layer=fuel&wfs_osm_id=1420918679,441134960 the layer fuel will be fetched features with the attribute osm_id equal to 1420918679 or 441134960. If wfs_ngroups is set, then an index is added to after the prefix of the wfs_[] parameter, for example: wfs_ngroups=2&wfs_0_[]=&wfs_1_[]=

    === More documentation ===

    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.

    Used functionalities:

    • default_theme: Theme to use by default.

    Ng Inject

    Ngdoc

    service

    Ngname

    gmfPermalink

    Parameters

    • $q: IQService

      The Angular $q service.

    • $timeout: ITimeoutService

      Angular timeout service.

    • $rootScope: IScope

      Angular rootScope.

    • $injector: IInjectorService

      Main injector.

    • ngeoDebounce: miscDebounce<(() => void)>

      ngeo Debounce factory.

    • gettextCatalog: gettextCatalog

      Gettext service.

    • ngeoEventHelper: EventHelper

      Ngeo event helper service

    • ngeoStateManager: StatemanagerService

      The ngeo statemanager service.

    • ngeoLocation: StatemanagerLocation

      ngeo location service.

    • gmfLayerBeingSwipe: any
    • gmfPermalinkOptions: any

      The options.

    • gmfDataSourcesManager: any

      The gmf datasourcemanager service.

    • ngeoWMSTime: WMSTime

      The ngeo wmstime service

    Returns PermalinkService

Properties

$timeout_: ITimeoutService
crosshairEnabledByDefault_: boolean
crosshairFeature_: Feature<Geometry>
crosshairStyle_: StyleLike
defaultTheme_: string
featureHashFormat_: default
featureHelper_: FeatureHelper
featureOverlay_: FeatureOverlay
gmfDataSourcesManager_: any
gmfExternalDataSourcesManager_: any
gmfLayerBeingSwipe_: any
gmfObjectEditingManager_: any
gmfThemeManager_: any
gmfThemes_: any
gmfTreeManager_: any
gmfUser: any
listenerKeys_: EventsKey[]
mapTooltip_: default
mapViewPropertyChangeEventKey_: EventsKey

The key for map view 'propertychange' event.

map_: Map
ngeoAutoProjection_: AutoProjectionService
ngeoBackgroundLayerMgr_: MapBackgroundLayerManager
ngeoDebounce_: miscDebounce<(() => void)>
ngeoEventHelper_: EventHelper
ngeoFeatures_: Collection<Feature<Geometry>>
ngeoLocation_: StatemanagerLocation
ngeoQuerent_: Querent
ngeoStateManager_: StatemanagerService
ngeoWMSTime_: WMSTime
ngeoWfsPermalink_: WfsPermalinkService
pointRecenterZoom_: number
q_: IQService
rootScope_: IScope
setExternalDataSourcesStatePromise_: IPromise<void>
sourceProjections_: Projection[]

A list of projections that the coordinates in the permalink can be in.

Methods

  • Listen to any changes that may occur within the feature in order to update the state of the permalink accordingly.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns void

  • Clean the permalink parameters

    Parameters

    • groups: any[]

      firstlevel groups of the tree

    Returns void

  • Contains the layer name

    Returns

    The containing status

    Parameters

    • layer: BaseLayer

      The layer to inspect

    • name: string

      The layer name to find

    Returns boolean

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

    Returns

    default theme name.

    Returns string

  • Get the default theme from user functionalities.

    Returns

    default theme name.

    Returns string

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

    Returns

    Background layer.

    Parameters

    • layers: BaseLayer[]

      Array of background layer objects.

    Returns BaseLayer

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

    Returns

    Opacity.

    Returns number

  • Get the ngeo features from the state manager for initialization purpose

    Returns

    The features read from the state manager.

    Returns Feature<Geometry>[]

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

    Returns

    The coordinate for the map view center.

    Returns Coordinate

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

    Returns

    Whether map crosshair property is set or not.

    Returns boolean

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

    Returns

    The zoom for the map view.

    Returns number

  • Called when the background layer changes. Update the state using the background layer label, i.e. its name.

    Returns void

  • Parameters

    • evt: Event | BaseEvent

      Collection event.

    Returns void

  • Parameters

    • evt: Event | BaseEvent

      Collection event.

    Returns void

  • Called when layer being swipe

    Parameters

    • layer: LayerGroup | Layer<Source, LayerRenderer<any>>

      layer object.

    • oldLayer: LayerGroup | Layer<Source, LayerRenderer<any>>

      old layer object.

    Returns void

  • Parameters

    • event: Event | BaseEvent

      Collection event.

    Returns void

  • Called once upon initialization of the permalink service if there's at least one feature in the ngeoFeatures collection, then called every time the collection changes or any of the features within the collection changes.

    Returns void

  • Parameters

    • event: Event | BaseEvent

      Collection event.

    Returns void

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

    Returns void

  • Listen to the map view property change and update the state accordingly.

    Parameters

    • map: Map

      The ol3 map object.

    • oeFeature: Feature<Geometry>

      ObjectEditing feature

    Returns void

  • Unregister any event listener from the feature.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns void

  • Parameters

    • dimensions: Object

      The global dimensions object.

    Returns void

  • 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

    • map: Map

      The ol3 map object.

    Returns void

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

    Parameters

    • Optional opt_center: Coordinate

      Optional center coordinate.

    Returns void

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

    Parameters

    • tooltipText: string

      Text to display in tooltip.

    • Optional opt_center: Coordinate

      Optional center coordinate.

    Returns void

  • Return true if there is a theme specified in the URL path.

    Returns

    theme in path.

    Parameters

    • pathElements: string[]

      Array of path elements.

    Returns boolean

Generated using TypeDoc