MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLWMSServiceSettingsCallbacks Class Referenceabstract
Inheritance diagram for TSLWMSServiceSettingsCallbacks:

Detailed Description

This abstract class defines all the potential callbacks that will be sent by the TSLWMSDataLayer when it attempts to load a Web Map Service. The order of the methods is the order in which each will be called depending on the validity of the layer settings.

If the service metadata is loaded successfully then the onCapabilitiesLoaded method will be called first. Provided is a modifiable TSLWMSServiceLayer instance. The user should set all necessary settings on the object, such as the service layers that they wish to be visible, any required layer dimensions and/or layer style values.

If the service metadata is not successfully loaded then the onCapabilitiesLoadFailure method will be called first instead. This callback can however be called later in the callback process to denote an error that was not originally determined.

Assuming the onCapabilitiesLoaded method was called, and the user does not return false to indicate a failure, the layer settings are checked in the following order:

  • onChoiceOfRequestFormats - There are multiple supported GetMap request formats available. The user should indicate which format to use.
  • onNoVisibleLayers - None of the TSLWMSServiceLayers are visible
  • onRequiredDimensionValueNotSet - A visible layer (or sub layer) has a dimension for which a valid value must be provided
  • onNoCommonCRSinVisibleLayers - The set of visible layers (either directly visible or visible by inheritance) do not have a common Coordinate Reference System (CRS)
  • onNoSupportedCRSinVisibleLayers - Although there is a common CRS, MapLink either does not support it or cannot match it to a supported CRS. (Note: MapLink only supports known EPSG systems and CRS:84)
  • onChoiceOfServiceCRSs - Multiple common CRSs are defined for the visible layers, the user should indicate which CRS to use.
  • onUserLinearTransformInvalid - The user provided linear transform cannot fit the entirety of the visible layers' data into the coordinate space

If the user does not return false when any of the above methods are called, then the data layer will recheck the reason for the call. If the test still fails then the method will be called again, if not then the checks will continue to the next test. The user should keep this in mind as this could cause an infinite loop should the user not rectify the problem. Returning false from any of these methods will cause loading to fail and the callback loop to be cancelled.

Assuming the service loaded successfully, then the final callback will be made: onServiceSettingsComplete.

Public Types

enum  CapabilitiesLoadFailureReason {
  LoadingFailedInternetSettings = 0 , LoadingFailedLoadFailed = 1 , LoadingFailedParseFailure = 2 , LoadingFailedServiceUnsupported = 3 ,
  LoadingFailedUnableToDetermineExtent = 4 , LoadingFailedToFitInTMCSpace = 5 , LoadingECPFailedBadAuthnRequest = 6 , LoadingECPFailedFederationMetadataNotAccessible = 7 ,
  LoadingECPFailedBadFederationMetadata = 8 , LoadingECPFailedNoECPSupportingIDPs = 9 , LoadingECPFailedIDPNotAccessible = 10 , LoadingECPFailedBadAuthnResponse = 11 ,
  LoadingECPFailedSPECP = 12 , LoadingECPFailedAccessDenied = 13
}
 

Public Member Functions

virtual bool onCapabilitiesLoaded (TSLWMSServiceLayer *rootLayerInfo)=0
 
virtual void onCapabilitiesLoadFailure (TSLWMSServiceSettingsCallbacks::CapabilitiesLoadFailureReason reason)=0
 
virtual bool onNoVisibleLayers (TSLWMSServiceLayer *rootLayer)=0
 
virtual bool onRequiredDimensionValueNotSet (TSLWMSServiceLayer *rootLayerInfo, TSLWMSServiceLayer *dimensionLayer, const char *dimensionName)=0
 
virtual bool onNoCommonCRSinVisibleLayers (TSLWMSServiceLayer *rootLayer)=0
 
virtual bool onNoSupportedCRSinVisibleLayers (TSLWMSServiceLayer *rootLayer)=0
 
virtual int onChoiceOfRequestFormats (const char **formatChoices, int noOfFormatChoices)=0
 
virtual int onChoiceOfServiceCRSs (const char **crsChoices, int noOfCRSChoices)=0
 
virtual bool onUserLinearTransformInvalid ()=0
 
virtual bool onServiceSettingsComplete ()=0
 
virtual ~TSLWMSServiceSettingsCallbacks ()=0
 

Member Enumeration Documentation

◆ CapabilitiesLoadFailureReason

Enumeration that describes some of the potential reasons why the WMS data layer may fail to load a service:

The LoadingECP* values may also be used when using ECP.

Enumerator
LoadingFailedInternetSettings 

Check your Internet settings as an error was reported.

LoadingFailedLoadFailed 

Failed to load the service level metadata. Perhaps the service is unavailable or inaccessible.

LoadingFailedParseFailure 

Failed to parse the service level metadata. It may be invalid.

LoadingFailedServiceUnsupported 

The service is not supported.

LoadingFailedUnableToDetermineExtent 

The data layer failed to determine the required combined extent of the visible layers. The layers may not advertise a bounding box nor inherit one.

LoadingFailedToFitInTMCSpace 

Failed to automatically calculate a TMC space conversion that would fit the target data. Perhaps try using a user defined TMC scaling and offset.

LoadingECPFailedBadAuthnRequest 
LoadingECPFailedFederationMetadataNotAccessible 

The address of the federation metadata document was not accessible.

LoadingECPFailedBadFederationMetadata 

The federation metadata document format was not valid.

LoadingECPFailedNoECPSupportingIDPs 

The federation metadata document did not contain and IDPs that support ECP communications.

LoadingECPFailedIDPNotAccessible 

The IDP was not accessible.

LoadingECPFailedBadAuthnResponse 

The AuthnResponse from the IDP was not valid.

LoadingECPFailedSPECP 

Failed to forward the AuthnResponse to the Service Provider for authentication

LoadingECPFailedAccessDenied 

Either the IDP or SP rejected the request. Perhaps the credentials provided were incorrect or insufficient.

Constructor & Destructor Documentation

◆ ~TSLWMSServiceSettingsCallbacks()

TSLWMSServiceSettingsCallbacks::~TSLWMSServiceSettingsCallbacks ( )
inlinepure virtual

Member Function Documentation

◆ onCapabilitiesLoaded()

virtual bool TSLWMSServiceSettingsCallbacks::onCapabilitiesLoaded ( TSLWMSServiceLayer * rootLayerInfo)
pure virtual

This callback will be made when the service metadata has been successfully loaded. The client application should set the layer visibilities and set dimension and style values as required.

NOTE: The client application should not store the value of rootLayerInfo. It should only be modified during a callback to the client application. If it is modified outside of one of these callbacks then the changes will either be ignored or could cause a crash.

Parameters
rootLayerInfoThe root layer of the service metadata.

The client application should return true to continue the load, false to cancel and remove all data.

◆ onCapabilitiesLoadFailure()

virtual void TSLWMSServiceSettingsCallbacks::onCapabilitiesLoadFailure ( TSLWMSServiceSettingsCallbacks::CapabilitiesLoadFailureReason reason)
pure virtual

This callback will be made if the WMS data layer fails to load or parse the service capabilities and is intended to provide some feedback as to the reason.

◆ onChoiceOfRequestFormats()

virtual int TSLWMSServiceSettingsCallbacks::onChoiceOfRequestFormats ( const char ** formatChoices,
int noOfFormatChoices )
pure virtual

This callback will be triggered if the data layer has a choice of possible GetMap formats to choose from.

The default implementation would be to return 0, indicating the format at position 0 in the array of choices passed.

Parameters
formatChoicesAn array of strings containing the format values as returned in the service metadata. The order will be the same as the service metadata after unsupported formats have been weeded out.
noOfFormatChoicesThe size of the array specified by the formatChoices parameter.

The client application should return the index of the format that they wish to use. If the returned index is invalid then the load will be cancelled and all loaded data removed.

◆ onChoiceOfServiceCRSs()

virtual int TSLWMSServiceSettingsCallbacks::onChoiceOfServiceCRSs ( const char ** crsChoices,
int noOfCRSChoices )
pure virtual

Indicates the changes made to the layer settings under an onCapabilitiesLoaded callback left a choice of possible coordinate reference systems to use.

The default implementation would be to choose the CRS at index 0.

Parameters
crsChoicesAn array of strings containing the crs values.
noOfCRSChoicesThe size of the array passed as crsChoices.

The client application should return the index of the CRS that wish to use. If the returned index is invalid then the load will be cancelled and all loaded data removed.

◆ onNoCommonCRSinVisibleLayers()

virtual bool TSLWMSServiceSettingsCallbacks::onNoCommonCRSinVisibleLayers ( TSLWMSServiceLayer * rootLayer)
pure virtual

Indicates that the changes made to the layer settings under an onCapabilitiesLoaded callback left 2 or more layers visible, but that there was not a common coordinate reference system shared between them.

Parameters
rootLayerThe root layer of the service metadata.
Returns
The client application should return true to retry the load, false to cancel and remove all data.

◆ onNoSupportedCRSinVisibleLayers()

virtual bool TSLWMSServiceSettingsCallbacks::onNoSupportedCRSinVisibleLayers ( TSLWMSServiceLayer * rootLayer)
pure virtual

Indicates that the changes made to the layer settings under an onCapabilitiesLoaded callback left 1 or more layers visible, but that there was not a supported coordinate reference system shared between them.

Parameters
rootLayerThe root layer of the service metadata.
Returns
The client application should return true to retry the load, false to cancel and remove all data.

◆ onNoVisibleLayers()

virtual bool TSLWMSServiceSettingsCallbacks::onNoVisibleLayers ( TSLWMSServiceLayer * rootLayer)
pure virtual

Indicates the changes made to the layer settings under an onCapabilitiesLoaded callback left no layers visible.

Parameters
rootLayerThe root layer of the service metadata.
Returns
The client application should return true to retry the load, false to cancel and remove all data.

◆ onRequiredDimensionValueNotSet()

virtual bool TSLWMSServiceSettingsCallbacks::onRequiredDimensionValueNotSet ( TSLWMSServiceLayer * rootLayerInfo,
TSLWMSServiceLayer * dimensionLayer,
const char * dimensionName )
pure virtual

Indicates the changes made to the layer settings under an onCapabilitiesLoaded callback left a layer that did not have a required dimension value set.

Parameters
rootLayerInfoThe root layer of the service metadata.
dimensionLayerThe service layer that has the required dimension.
dimensionNameThe name of the dimension that requires a value set for it.

The client application should return true to retry the load, false to cancel and remove all data.

◆ onServiceSettingsComplete()

virtual bool TSLWMSServiceSettingsCallbacks::onServiceSettingsComplete ( )
pure virtual

This callback will be made to indicate the layer settings changed under an onCapabilitiesLoaded callback (or subsequent error callbacks) were accepted and valid. It should be overridden to tidy up any resources allocated.

The client application should return true to continue the load, false to cancel and remove all data.

◆ onUserLinearTransformInvalid()

virtual bool TSLWMSServiceSettingsCallbacks::onUserLinearTransformInvalid ( )
pure virtual

This callback will be made if the user linear transforms specified the TSLWMSDataLayer could not fit the entirety of the loaded data into the coordinate space.

The client application should return true to retry the load, false to cancel and remove all data.