MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLWMTSServiceLayer Class Reference

Detailed Description

This class represents a layer in the WMTS service metadata. It is not user-creatable but instead can either be retrieved from a TSLWMTSDataLayer, that has a service loaded, or is provided by most of the callbacks on the TSLWMTSServiceSettingsCallbacks abstract class.

Changing the settings on this class should only take place during the user callbacks, when an instance is passed to a user-derived TSLWMTSServiceSettingsCallbacks class. The callbacks will be fired once a service has been loaded on to the TSLWMTSDataLayer.

Public Member Functions

const char * getAbstractAt (int index) const
 
const char * getAdditionalPrefixParameters () const
 
const char * getCurrentImageFormat () const
 
const TSLWMTSServiceDimensiongetDimensionAt (int index) const
 
const char * getDimensionValue (const char *dimensionIdentifier) const
 
const char * getImageFormatAt (int index) const
 
bool getLatLonBoundingBox (double &westBoundLongitude, double &eastBoundLongitude, double &southBoundLatitude, double &northBoundLatitude) const
 
const TSLWMTSServiceStylegetStyleAt (int index) const
 
const char * getStyleValue () const
 
const TSLWMTSServiceTileMatrixSetgetTileMatrixSetAt (int index) const
 
const char * getTitleAt (int index) const
 
bool getTMCExtent (TSLTMC &minX, TSLTMC &minY, TSLTMC &maxX, TSLTMC &maxY) const
 
bool getVisibility () const
 
int getVisibilityOrderIndex () const
 
const char * identifier () const
 
int numAbstracts () const
 
int numDimensions () const
 
int numImageFormats () const
 
int numStyles () const
 
int numTileMatrixSets () const
 
int numTitles () const
 
int selectedTileMatrixSet () const
 
bool selectTileMatrixSet (int index)
 
void setAdditionalPrefixParameters (const char *prefix)
 
bool setDimensionValue (const char *dimensionIdentifier, const char *value)
 
bool setImageFormat (const char *format)
 
bool setStyleValue (const char *styleIdentifier)
 
bool setVisibility (bool visible, int visibilityOrderIndex=-1)
 
bool supportsCRS (const char *crs) const
 

Static Public Member Functions

static bool layersHaveCompatibleCRS (const TSLWMTSServiceLayer **layers, int numLayers)
 

Member Function Documentation

◆ getAbstractAt()

const char * TSLWMTSServiceLayer::getAbstractAt ( int index) const

Queries the Nth abstract defined by the service.

Parameters
indexThe index of the abstract defined by the service - use the num Abstracts function to find the range of valid values.
Returns
the abstract on success, null otherwise.

◆ getAdditionalPrefixParameters()

const char * TSLWMTSServiceLayer::getAdditionalPrefixParameters ( ) const

Returns the additional URL parameters that will be passed as part of each request to the server. The string will be passed verbatim, between the '?' and the first parameter (i.e. "...?[here]server=WMTS&...").

◆ getCurrentImageFormat()

const char * TSLWMTSServiceLayer::getCurrentImageFormat ( ) const

Returns the current image format that will be used in requests to the service for this layer. If no request format has yet been set through either the data layer's callback sequence or the setImageFormat() method, this method returns NULL.

◆ getDimensionAt()

const TSLWMTSServiceDimension * TSLWMTSServiceLayer::getDimensionAt ( int index) const

This method is used to query the dimensions defined for this layer.

Parameters
indexThe index of the dimension - use the numDimensions function to find the range of valid values.

On success, this method will return the dimension's metadata. On failure, for instance due to the index being out of range, then null will be returned.

◆ getDimensionValue()

const char * TSLWMTSServiceLayer::getDimensionValue ( const char * dimensionIdentifier) const

This method returns the value that the data layer will use/used to request map tiles for the queried layer dimension.

Parameters
dimensionIdentifierThe name of the layer dimension to query.

This method will return null of either the dimension name does not match a dimension defined for this layer or if no value has been assigned to that dimension. If a value has been assigned to that dimension then it will be returned.

◆ getImageFormatAt()

const char * TSLWMTSServiceLayer::getImageFormatAt ( int index) const

Returns the Nth image format available for this layer.

◆ getLatLonBoundingBox()

bool TSLWMTSServiceLayer::getLatLonBoundingBox ( double & westBoundLongitude,
double & eastBoundLongitude,
double & southBoundLatitude,
double & northBoundLatitude ) const

Gets latitude/longitude bounding box defined for the WMTS layer

Parameters
westBoundLongitudeThis will be populated with the west-most bounding longitude.
eastBoundLongitudeThis will be populated with the east-most bounding longitude.
southBoundLatitudeThis will be populated with the south-most bounding latitude.
northBoundLatitudeThis will be populated with the north-most bounding latitude.

If the layer defines a lat/long bounding box then the provided parameters will be populated and true returned, false otherwise.

◆ getStyleAt()

const TSLWMTSServiceStyle * TSLWMTSServiceLayer::getStyleAt ( int index) const

This method is used to query the styles defined for this layer.

Parameters
indexThe index of the style - use the numStyles function to find the range of valid values.

On success, this method will return the style's metadata. On failure, for instance due to the index being out of range, then null will be returned.

◆ getStyleValue()

const char * TSLWMTSServiceLayer::getStyleValue ( ) const

Queries the style that will be passed to the service for each tile for this layer.

The value of this property can be set via the setStyleValue method. If no style has been set and the service defines a default style for the layer this method will return the default style value.

◆ getTileMatrixSetAt()

const TSLWMTSServiceTileMatrixSet * TSLWMTSServiceLayer::getTileMatrixSetAt ( int index) const

This method is used to query the tile matrix set links defined for this layer.

Parameters
indexThe index of the tile matrix set link - use the numTileMatrixSets function to find the range of valid values.

On success, this method will return the metadata of the linked-to tile matrix set, along with the limits defined in the tile matrix set link. On failure, for instance due to the index being out of range, then null will be returned.

◆ getTitleAt()

const char * TSLWMTSServiceLayer::getTitleAt ( int index) const

Queries the Nth title defined by the service.

Parameters
indexThe index of the title defined by the service - use the numTitles function to find the range of valid values.
Returns
the title on success, null otherwise.

◆ getTMCExtent()

bool TSLWMTSServiceLayer::getTMCExtent ( TSLTMC & minX,
TSLTMC & minY,
TSLTMC & maxX,
TSLTMC & maxY ) const

Returns the TMC extent of this layer based on the coordinate system in use by the owning TSLWMTSDataLayer.

If the layer's callback sequence has not finished, this method will return false.

◆ getVisibility()

bool TSLWMTSServiceLayer::getVisibility ( ) const

Queries if the layer is visible.

◆ getVisibilityOrderIndex()

int TSLWMTSServiceLayer::getVisibilityOrderIndex ( ) const

Queries the position that this layer appears in the visible layer stack. The visible layer stack defines the z-order in which layers appear. A zero position in the stack indicates the that layer will appear at the bottom.

If the layer is not visible then this method will return -1.

Use setVisibility to modify the visibility order of service layers.

NOTE: The visibility order returned is only valid while no changes are made to the visibility of this or any other service layer.

◆ identifier()

const char * TSLWMTSServiceLayer::identifier ( ) const

Returns the identifier (name) associated with the layer via the service metadata.

◆ layersHaveCompatibleCRS()

static bool TSLWMTSServiceLayer::layersHaveCompatibleCRS ( const TSLWMTSServiceLayer ** layers,
int numLayers )
static

This method can be used to determine if a set of layers advertised from a WMTS have one or more compatible coordinate systems, and thus can be displayed simultaneously in the data layer.

The data layer will internally ensure that visible layers have a compatible coordinate system, so the use of this method is not required. This method is mainly useful for identifying and presenting valid combinations of layers as part of a user interface.

Parameters
layersAn array of TSLWMTSServiceLayers to check for CRS compatibility
numLayersThe number of layers in the layers array.
Returns
true if all the layers in the array define one or more common coordinate systems, otherwise returns false.

◆ numAbstracts()

int TSLWMTSServiceLayer::numAbstracts ( ) const

Returns the number of abstracts defined by the service.

◆ numDimensions()

int TSLWMTSServiceLayer::numDimensions ( ) const

The number of dimensions defined by the service for this layer.

◆ numImageFormats()

int TSLWMTSServiceLayer::numImageFormats ( ) const

The number of image formats defined by the service for this layer.

◆ numStyles()

int TSLWMTSServiceLayer::numStyles ( ) const

The number of styles defined by the service for this layer.

◆ numTileMatrixSets()

int TSLWMTSServiceLayer::numTileMatrixSets ( ) const

Returns the number of tile matrix set links defined by the service for this layer.

◆ numTitles()

int TSLWMTSServiceLayer::numTitles ( ) const

Returns the number of titles defined by the service.

◆ selectedTileMatrixSet()

int TSLWMTSServiceLayer::selectedTileMatrixSet ( ) const

Queries the index of the tile matrix set link that will be passed to the service for this layer (or -1, meaning unset).

The value of this property should be set via the selectTileMatrixSet method.

◆ selectTileMatrixSet()

bool TSLWMTSServiceLayer::selectTileMatrixSet ( int index)

Sets which tile matrix set link to use for this layer.

Parameters
indexThe index of the tile matrix set link to use, using the same indices as getTileMatrixSetAt. Use the numTileMatrixSets function to find the range of valid values.
Returns
true on success, false otherwise.

◆ setAdditionalPrefixParameters()

void TSLWMTSServiceLayer::setAdditionalPrefixParameters ( const char * prefix)

Sets additional URL parameters to pass as part of each request to the server. The provided string is passed verbatim, between the '?' and the first parameter (i.e. "...?[here]server=WMTS&...").

Parameters
prefixThe string to insert.

◆ setDimensionValue()

bool TSLWMTSServiceLayer::setDimensionValue ( const char * dimensionIdentifier,
const char * value )

Sets the value that the data layer will send to the service for the corresponding dimension.

Parameters
dimensionIdentifierThe name of dimension to set the value of
dimensionValueThe value to set.
Returns
true on success, false otherwise.

◆ setImageFormat()

bool TSLWMTSServiceLayer::setImageFormat ( const char * format)

Sets the image format that the data layer will use when requesting tiles from this layer from the service.

Parameters
formatThe format to use.
Returns
true if the requested format is valid for this layer, false otherwise.

◆ setStyleValue()

bool TSLWMTSServiceLayer::setStyleValue ( const char * styleIdentifier)

Sets the name of the style that the data layer will send to the service for this layer.

Parameters
styleIdentifierThe name of the style to use. Null is a valid value, to set the style to the default.
Returns
true on success, false otherwise.

◆ setVisibility()

bool TSLWMTSServiceLayer::setVisibility ( bool visible,
int visibilityOrderIndex = -1 )

Set the visibility of this layer according to the following rules which are applied in order:

  • if visible is false and the visibility of the layer is already false then this method will return true without performing any change.
  • if visible is false and the visibility of the layer is currently true then this method will set the layer to be non-visible and return true.
  • if visible is true and the visibility of the layer is currently false then this method will set the layer to be visible and return true. The visibility OrderIndex will be used to determine the order the layer will appear.
  • if visible is true and the visibility of the layer is currently true then this method will use visibilityOrderIndex to change the current layer order and return true.

If visibilityOrderIndex is less than 0 or greater than the number of currently visible layers, then the layer will appear as the top-most visible layer else it will appear in the visibility order at the index specified.

Parameters
visibleIndicates of the layer should be visible
visibilityOrderIndexIgnored if visible != true. Indicates the order the layer should appear in the layer stack.
Returns
true on success as defined above, else false.

◆ supportsCRS()

bool TSLWMTSServiceLayer::supportsCRS ( const char * crs) const

Convenience method that returns true if the given Coordinate Reference System (CRS) string matches one of the coordinate systems supported by this layer. This method is equivalent to looping through all TSLWMTSServiceTile MatrixSets on this layer and comparing their CRS strings to the given string.

Parameters
crsThe CRS string to match.