Geoportal SDK 2D/3D API Reference

Namespace: LayerOptions

Gp.LayerOptions

Layer options object.

Holds options for a specific layer present on the map. May be used at map creation (See layersOptions property of Gp.MapOptions object used as a parameter of Gp.Map.load() function) or for map modification (See Gp.Map.addLayers() or Gp.Map.modifyLayers()).

Given a specific layer type, availables options are the following :

Common properties

Common 2D/3D properties

property Type Description
format String The layer's format. Supported values are : 'kml', 'gpx', 'geojson', 'wmts', 'wms', 'wfs', 'mapbox' or 'osm'. This property is optionnal for Geoportal layers but mandatory for others.
url String Mandatory for non Geoportal layers. The url to the file or the Web Service providing the layer.
title String The layer's name displayed in the LayerSwitcher control.
description String The layer's description.
opacity Float The layer's opacity (between 0 and 1). Default value is 1.
visibility Boolean If true, the layer is visible. Default value is true.
minZoom Integer If the current zoom level is lower than the minZoom of the layer, the layer is not displayed. Default value is given by the autoconfiguration service for Geoportal layers. For others layers, default value is the minZoom of the map.
maxZoom Integer If the current zoom level is upper than the maxZoom of the layer, the layer is not displayed. Default value is given by the autoconfiguration service for Geoportal layers. For others layers, default value is the maxZoom of the map.
position Number The layer's position in map, compared to other layers positions. Allows to organize layers order explicitely. By default the layer will be displayed above other layers.
legends Array[Gp.Services.Config.Legend] The layer's legends links.
metadata Array[Gp.Services.Config.Metadata] The layer's metadata links.
originators Array[Gp.Services.Config.Originator] Options about the layers's providers.

WMTS specific properties

Common 2D/3D properties

property Type Description
layer String The layer's Identifier to add (found in GetCapabilities response).
tileMatrixSet String The name of the layer's TileMatrixSet (see in GetCapabilities response).
topLeftCorner Gp.Point The layer's origin coordinates (found in GetCapabilities response).
resolutions Array[Float] The layer's resolutions list (found in GetCapabilities response).
matrixIds Array[String] The layer's zoom levels ids (found in GetCapabilities response).
outputFormat String The output image format (Mime-type)
styleName String The layer's style name to apply (found in GetCapabilities response).

Specific 2D properties

property Type Description
grayScaled Boolean If true, the layer is displayed in gray-scale.
queryable Boolean If true, user clicks on map will trigger getFeatureInfo request on the layer. Not yet implemented for WMTS.
gfiFormat String If queryable == true, indicates the format mime-type of the response of GetFeatureInfo requests. default : "text/html". Not yet implemented for WMTS.

Specific 3D properties

property Type Description
tileMatrixSetLimits Object Tiles limits of the tileMatrixSet used.
type String If "elevation", the layer is displayed as an elevation layer (DTM). Else, set "color"

KML specific properties

Common 2D/3D properties

property Type Description
extractStyles Boolean If true, the styles of the features are recovered from the kml file. True by default

Specific 2D properties

property Type Description
showPointNames Boolean If true, show names as labels for placemarks which contain points.
zoomToExtent Boolean If true, zoom into the extent of features.
projection String coordinate reference system id used for Layer (default is map projection)

MapBox specific properties

Specific 2D properties

property Type Description
urlService String -
outputFormat String -
projection String -
url String -
defaultThemeName String -
defaultThemeThumbnail String -
defaultThemeDescription String -
themesSummary String -
themes Gp.ThemesOptions options for layer styles
filtersSummary String -
filters Gp.FiltersOptions options for layer filters
queryable Boolean If true, user clicks on map will trigger getFeatureInfo request on the layer
mapboxOptions Object -

KML, GPX, GeoJSON and MapBox specific properties

Common 2D/3D properties

property Type Description
styleOptions Gp.StyleOptions options for layer style (points, strokes, polygons)

WMS specific properties

Common 2D/3D properties

property Type Description
layers Array[String] layers List of layer's identifiers to add (found in GetCapabilities response).
version String The version of the Web Service providing the layer. Default : "1.3.0"
stylesNames Array[String] List of the styles names to apply to layers (see in GetCapabilities response).
outputFormat String The output image format (Mime-type)
projection String Coordinate reference system id used for Layer (default is map projection)

Specific 2D properties

property Type Description
grayScaled Boolean If true, the layer is displayed in gray-scale.
queryable Boolean If true, user clicks on map will trigger getFeatureInfo request on the layer.
gfiFormat String If queryable == true, indicates the format mime-type of the response of GetFeatureInfo requests. default : "text/html"
backgroundColor String The layer's background RVB color in hexadecimal.
tiled Boolean If true, map will load WMS layer in a tiled way. Otherwise, layer will be displayed with an unique GetMap request covering the whole map view (default).

Specific 3D properties

property Type Description
bbox Array[Float] Bounding box where to display the layer. The array must be "[west, south, east, north]". If the layer is in PM, the bbox needs to be in planar coordinates. World extent by default
type String If "elevation", the layer is displayed as an elevation layer (DTM)

Elevation Layers specific properties

To add a Digital Terrain Model Layer (DTM) in WMS or WMTS, the property "type" of the layerOptions must be set to "elevation"

property Type Description
type String If "elevation", the layer is displayed as an elevation layer (DTM) in 3D, and hidden in 2D (else, set "color")

WFS specific properties

Specific 2D properties

property Type Description
version String The version of the Web Service providing the layer. Default : "2.0.0"
typeNames String List of the features's name to add (see in GetCapabilities response).
outputFormat String The output format (Mime-type) to use for WFS requests (outputFormat parameter)
maxFeatures Integer Maximal number of features in the layer.
projection String Coordinate reference system id used for Layer (default is map projection)
TODO
  • finish description for tile vector layer (MapBox)