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

Detailed Description

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

Public Member Functions

const char * abstract () const
 
const char * getBoundingBoxAt (int index, double &minX, double &minY, double &maxX, double &maxY, double **resX=0, double **resY=0) const
 
const char * getCRSAt (int index) const
 
const char * getDataAuthorityAt (int index, const char **href) const
 
const char * getDataLocationAt (int index, const char **format) const
 
const TSLWMSServiceLayerDimensiongetDimensionAt (int index) const
 
const char * getDimensionValue (const char *dimensionName) const
 
const char * getDimensionValue (int index) const
 
const char * getExtentAt (int index, const char **value=0, const char **defaultValue=0, bool *nearestValue=0, bool *multipleValues=0, bool *current=0) const
 
const char * getFeatureListLocationAt (int index, const char **format) const
 
const char * getIdentifierAt (int index, const char **value) const
 
const char * getKeywordAt (int index) const
 
bool getLatLonBoundingBox (double &westBoundLongitude, double &eastBoundLongitude, double &southBoundLatitude, double &northBoundLatitude) const
 
const char * getMetadataLocationAt (int index, const char **format, const char **type) const
 
const TSLWMSServiceLayergetParentLayer () const
 
TSLWMSServiceLayergetParentLayer ()
 
const char * getStyleAt (int index) const
 
const char * getStyleValue () const
 
const TSLWMSServiceLayergetSubLayerAt (int index) const
 
TSLWMSServiceLayergetSubLayerAt (int index)
 
bool getTMCExtent (TSLTMC &minX, TSLTMC &minY, TSLTMC &maxX, TSLTMC &maxY) const
 
bool getVisibility (bool *isDerived=0) const
 
int getVisibilityOrderIndex () const
 
const char * name () const
 
int noOfBoundingBoxes () const
 
int noOfCRSs () const
 
int noOfDataAuthorities () const
 
int noOfDataLocations () const
 
int noOfDimensions () const
 
int noOfExtents () const
 
int noOfFeatureListLocations () const
 
int noOfIdentifiers () const
 
int noOfKeywords () const
 
int noOfMetadataLocations () const
 
int noOfStyles () const
 
int noOfSubLayers () const
 
bool provider (const char **title, const char **url, const char **logoURL, const char **logoFormat, const int **logoWidth, const int **logoHeight) const
 
bool setDimensionValue (const char *dimensionName, const char *value)
 
bool setDimensionValue (int index, const char *value)
 
bool setStyleValue (const char *styleName)
 
bool setVisibility (bool visible, int visibilityOrderIndex=-1)
 
bool supportsCRS (const char *crs) const
 
const char * title () const
 

Static Public Member Functions

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

Member Function Documentation

◆ abstract()

const char * TSLWMSServiceLayer::abstract ( ) const

Queries the layer abstract defined by the service

Returns the abstract if one is defined or null on error or if no abstract is defined.

◆ getBoundingBoxAt()

const char * TSLWMSServiceLayer::getBoundingBoxAt ( int index,
double & minX,
double & minY,
double & maxX,
double & maxY,
double ** resX = 0,
double ** resY = 0 ) const

Gets Nth bounding box defined for the WMS layer

Parameters
indexThe index of the bounding box - use the noOfBoundingBoxes function to find the range
minXThis will be populated with the minimum x value in map units
minYThis will be populated with the minimum y value in map units
maxXThis will be populated with the maximum x value in map units
maxYThis will be populated with the maximum y value in map units
resXIf defined by the service, this will be set to point at the x resolution of the layer. If the layer does not provide this value, then it will be set to NULL.
resYIf defined by the service, this will be set to point at the y resolution of the layer. If the layer does not provide this value, then it will be set to NULL.
Returns
If this method is successful, then the method will return the CRS that these values apply to. If this method fails, for instance due to the index being out of range, then this method will return NULL and all extent and resolution values will be invalid.

◆ getCRSAt()

const char * TSLWMSServiceLayer::getCRSAt ( int index) const

Gets the Nth Coordinate Reference System that can be used with this layer.

◆ getDataAuthorityAt()

const char * TSLWMSServiceLayer::getDataAuthorityAt ( int index,
const char ** href ) const

Queries the Nth data authority defined by the service.

Parameters
indexThe index of the data authority to query
hrefThis will get populated with the href of the data authority link
Returns
the name of the data authority on success, null otherwise.

◆ getDataLocationAt()

const char * TSLWMSServiceLayer::getDataLocationAt ( int index,
const char ** format ) const

Queries the Nth data location defined by the service.

Parameters
indexThe index of the data location to query.
formatThis will get populated with the format of the data location link
Returns
the location of the data on success, null otherwise.

◆ getDimensionAt()

const TSLWMSServiceLayerDimension * TSLWMSServiceLayer::getDimensionAt ( int index) const

Returns the Nth dimension that can be set on this layer.

Parameters
indexThe index of the dimension - use the noOfDimensions function to find the range of valid values.
Returns
the dimension at the given index.

◆ getDimensionValue() [1/2]

const char * TSLWMSServiceLayer::getDimensionValue ( const char * dimensionName) const

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

Parameters
dimensionNameThe name of layer dimension to query.

This method will return null if either the dimension name does not match a dimension defined for this layer or if no value has been assigned to that dimension and the service does not specify a default value for the dimension. Otherwise it will return either the value set for the dimension via setDimensionValue, or if no value has been set it will return the default value.

◆ getDimensionValue() [2/2]

const char * TSLWMSServiceLayer::getDimensionValue ( int index) const

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

Parameters
indexThe index of the dimension. Valid values are between 0 and noOfDimensions() - 1.

This method will return null if the index is invalid, or if no value has been set for the dimension and the service does not specify a default value for the dimension. Otherwise it will return either the value set for the dimension via setDimensionValue, or if no value has been set it will return the default value.

◆ getExtentAt()

const char * TSLWMSServiceLayer::getExtentAt ( int index,
const char ** value = 0,
const char ** defaultValue = 0,
bool * nearestValue = 0,
bool * multipleValues = 0,
bool * current = 0 ) const

Queries the service advertised dimension extent information.

Parameters
indexThe extent information to query - the user can find the range of valid values using the noOfExtents function
valueThe extent range
defaultValueIf the service advertises a default value for this dimension, then this value will be pointed at that value. If not then this will be set to null.
nearestValueIf the service advertises whether user specified values will be snapped to the nearest value then this value will be populated with that value. If not then this will be set to the standard defined default of false.
multipleValuesIf the service advertises whether the user can specify multiple values then this value will be populated with that value. If not then this will be set to the standard defined default of false.
currentIf the service advertises whether the dimension refers to temporal data that is normally kept current and that the request parameter may include the keyword 'current' instead of an ending value, then this value will be populated with that value. If not then this will be set to the standard defined default of false.

On success, this method will return the name of the extent (which will match the corresponding dimension). On failure, for instance due to the index being out of range, then null will be returned.

◆ getFeatureListLocationAt()

const char * TSLWMSServiceLayer::getFeatureListLocationAt ( int index,
const char ** format ) const

Queries the Nth data location defined by the service.

Parameters
indexThe index of the feature list defined by the service
formatThis will get populated with the format of the feature list link
Returns
the location of the feature list on success, null otherwise.

◆ getIdentifierAt()

const char * TSLWMSServiceLayer::getIdentifierAt ( int index,
const char ** value ) const

Queries the Nth identifier defined by the service.

Parameters
indexThe index of the feature list defined by the service
valueThis will get populated with the value of the identifier
Returns
the authority of the identifier on success, null otherwise.

◆ getKeywordAt()

const char * TSLWMSServiceLayer::getKeywordAt ( int index) const

Queries the Nth keyword defined by the service.

Parameters
indexThe index of the keyword defined by the service
Returns
the keyword on success, null otherwise.

◆ getLatLonBoundingBox()

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

Gets latitude/longitude bounding box defined for the WMS 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.

◆ getMetadataLocationAt()

const char * TSLWMSServiceLayer::getMetadataLocationAt ( int index,
const char ** format,
const char ** type ) const

Queries the Nth metadata location defined by the service.

Parameters
indexThe index of the metadata location defined by the service
formatThis will get populated with the format of the metadata
typeThis will get populated with the type of the metadata
Returns
the location of the metadata on success, null otherwise.

◆ getParentLayer() [1/2]

TSLWMSServiceLayer * TSLWMSServiceLayer::getParentLayer ( )

Returns the parent layer of this layer, or NULL if this is the root service layer.

◆ getParentLayer() [2/2]

const TSLWMSServiceLayer * TSLWMSServiceLayer::getParentLayer ( ) const

Returns the parent layer of this layer, or NULL if this is the root service layer.

◆ getStyleAt()

const char * TSLWMSServiceLayer::getStyleAt ( int index) const

Gets the Nth style that can be set on this layer.

◆ getStyleValue()

const char * TSLWMSServiceLayer::getStyleValue ( ) const

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

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

◆ getSubLayerAt() [1/2]

TSLWMSServiceLayer * TSLWMSServiceLayer::getSubLayerAt ( int index)

Gets the Nth sub layer of this layer.

◆ getSubLayerAt() [2/2]

const TSLWMSServiceLayer * TSLWMSServiceLayer::getSubLayerAt ( int index) const

Gets the Nth sub layer of this layer.

◆ getTMCExtent()

bool TSLWMSServiceLayer::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 TSLWMSDataLayer.

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

◆ getVisibility()

bool TSLWMSServiceLayer::getVisibility ( bool * isDerived = 0) const

Queries if the layer is visible.

This method will return true of either the layer is directly visible or visible because one of its parent layers are visible. To determine the reason for the layer being visible, pass a valid value for the isDerived parameter.

Parameters
isDerivedWill be set to true if the layer is not directly visible, but is visible through one of its parents. It will be set to false in all other cases.

◆ getVisibilityOrderIndex()

int TSLWMSServiceLayer::getVisibilityOrderIndex ( ) const

Queries the position that this layer appears in the visible layer stack. The visible layer stack defines the order in which layers are requested from the service. A zero position in the stack indicates the that layer is requested first, meaning the layer will appear at the bottom.

If the layer is not directly visible (it may be visible indirectly through a parent layer) then this method will return -1.

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

◆ layersHaveCompatibleCRS()

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

This method can be used to determine if a set of layers advertised from a WMS 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 TSLWMSServiceLayers 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.

◆ name()

const char * TSLWMSServiceLayer::name ( ) const

If the service metadata defines a name for this layer, then this method will return it. Otherwise it will return false.

◆ noOfBoundingBoxes()

int TSLWMSServiceLayer::noOfBoundingBoxes ( ) const

The number of bounding boxes defined by the service for this layer.

◆ noOfCRSs()

int TSLWMSServiceLayer::noOfCRSs ( ) const

The number of Coordinate Reference Systems defined by the service for this layer.

◆ noOfDataAuthorities()

int TSLWMSServiceLayer::noOfDataAuthorities ( ) const

Returns the number of data authorities defined by the service

◆ noOfDataLocations()

int TSLWMSServiceLayer::noOfDataLocations ( ) const

Returns the number of data locations defined by the service

◆ noOfDimensions()

int TSLWMSServiceLayer::noOfDimensions ( ) const

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

◆ noOfExtents()

int TSLWMSServiceLayer::noOfExtents ( ) const

The number of dimension extents defined by the service for this layer.

◆ noOfFeatureListLocations()

int TSLWMSServiceLayer::noOfFeatureListLocations ( ) const

Returns the number of feature list locations defined by the service

◆ noOfIdentifiers()

int TSLWMSServiceLayer::noOfIdentifiers ( ) const

Returns the number of identifiers defined by the service

◆ noOfKeywords()

int TSLWMSServiceLayer::noOfKeywords ( ) const

Returns the number of keywords defined by the service

◆ noOfMetadataLocations()

int TSLWMSServiceLayer::noOfMetadataLocations ( ) const

Returns the number of metadata locations defined by the service

◆ noOfStyles()

int TSLWMSServiceLayer::noOfStyles ( ) const

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

◆ noOfSubLayers()

int TSLWMSServiceLayer::noOfSubLayers ( ) const

The number of sub layers defined by the service for this layer.

◆ provider()

bool TSLWMSServiceLayer::provider ( const char ** title,
const char ** url,
const char ** logoURL,
const char ** logoFormat,
const int ** logoWidth,
const int ** logoHeight ) const

Queries the layer attribution/provider defined by the service.

Parameters
titleThis will get populated with the title of the provider if one is defined
urlThis will get populated with the url of the provider if one is defined
logoURLThis will get populated with the logo url if one is defined
logoFormatThis will get populated with the logo format if one is defined
logoWidthThis will get populated with the logo width if one is defined
logoHeightThis will get populated with the logo height r if one is defined
Returns
the location of the metadata on success, null otherwise.

◆ setDimensionValue() [1/2]

bool TSLWMSServiceLayer::setDimensionValue ( const char * dimensionName,
const char * value )

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

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

◆ setDimensionValue() [2/2]

bool TSLWMSServiceLayer::setDimensionValue ( int index,
const char * value )

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

Parameters
indexThe index of the dimension to set the value of.
valueThe value to set.
Returns
true on success, false otherwise.

◆ setStyleValue()

bool TSLWMSServiceLayer::setStyleValue ( const char * styleName)

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

Parameters
styleNameThe 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 TSLWMSServiceLayer::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 one of the layers parents is visible then this method will return false.
  • 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 visibilityOrderIndex 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 TSLWMSServiceLayer::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 values returned from getCRSAt and comparing them to the given string.

Parameters
crsThe CRS string to match.

◆ title()

const char * TSLWMSServiceLayer::title ( ) const

Returns the title associated with the layer via the service metadata.