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

Detailed Description

This abstract class should be derived from to create a data source that will be provided to the WMS. Implementations must implement the getLayers and getMap methods and may optionally override the getFeatureInfo method if required.

Refer to the MapLink Developer's Guide for information on how to implement a WMS plug-in.

Public Member Functions

virtual TSLWMSAvailableLayergetLayers (TSLWMSRegister *wmsRegister, const TSLWMSRequest *request)=0
 
virtual bool getMap (TSLWMSGetMapResponse *response, const TSLWMSGetMapRequest *request)=0
 
virtual bool getFeatureInfo (const TSLWMSGetFeatureInfoRequest *request, TSLWMSGetFeatureInfoResponse *response)
 
virtual ~TSLWMSPluginDataSource ()=0
 

Constructor & Destructor Documentation

◆ ~TSLWMSPluginDataSource()

TSLWMSPluginDataSource::~TSLWMSPluginDataSource ( )
inlinepure virtual

The destructor

Member Function Documentation

◆ getFeatureInfo()

virtual bool TSLWMSPluginDataSource::getFeatureInfo ( const TSLWMSGetFeatureInfoRequest * request,
TSLWMSGetFeatureInfoResponse * response )
virtual

This method should be used to implement the GetFeatureInfo capability of the plugin. This method need not be overridden if any of the layers returned during the getLayers call does not have its queryable flag set to true.

To support the GetFeatureInfo request two actions must be completed; The queryable flag of one or more of the layers returned from the getLayers method must be set to true and a format of the GetFeatureInfo response must be declared. To declare a format, use the declareGetFeatureFormat method on the TSLWMSRegister class passed to the getLayers method.

When a GetFeatureInfo request is made to the WMS, once parsed, the request will be passed to the loaded plugins to provide the data to return to the user.

Unlike for GetMap requests, only a single data source can be used to reply to a GetFeatureInfo request. If a request spans multiple data sources an exception will be returned. Querying multiple layers served by a single data source is supported however.

Parameters
requestAn in-memory representation of the request.
responseShould be populated with the data source's response to the request
Returns
Should return true on success, false otherwise. It is preferable that rather than returning false, a TSLWMSExceptionReport object is created, populated and then TSLWMSExceptionReport::throwException called on it. This allows the reason for the failure to be described to the requester.

◆ getLayers()

virtual TSLWMSAvailableLayer * TSLWMSPluginDataSource::getLayers ( TSLWMSRegister * wmsRegister,
const TSLWMSRequest * request )
pure virtual

Once a plugin has been loaded by the MapLink WMS, it will be queried for the layers that is serves. These will be advertised as a sublayer of the unnamed root layer of the WMS via its capabilities.

If the plugin also supports GetFeatureInfo requests then it should register the output formats that it supports via the wmsRegister object passed.

If the plugin requires that the service capabilities are generated dynamically it should turn on support for this feature via the wmsRegister object passed.

Parameters
wmsRegisterThis register should be used to declare which getFeatureInfo response types are supported by this data source.
requestThis will normally be null. It will only be non-null for plugins that have enabled the dynamic capabilities support via the wmsRegister during certain subsequent calls to the function. See the documentation for the TSLWMSRegister::dynamicCapabilities method for details.
Returns
The root layer, of possibly a tree of layers, that this instance of the plug-in serves. Once returned, this tree of layers becomes owned by the WMS, which will delete it. The user should not attempt to use theses layers again as the WMS may delete them at any point.

◆ getMap()

virtual bool TSLWMSPluginDataSource::getMap ( TSLWMSGetMapResponse * response,
const TSLWMSGetMapRequest * request )
pure virtual

When a GetMap request is made to the WMS, once parsed, the request will be passed to the loaded plugins to provide the data to return to the user. The request passed to the plugin will contain a subset of the user requested layers. If a plugin data source advertises that it serves multiple layers, then the request will contain multiple request layers if they are both served by that data source and if they were requested in sequence.

For instance:

If a plugin data source serves named layers A and B, then if a user requests layers=A,B a single getMap request will be made to the plugin for both layers. If a user were to request layers=A,C,B then two separate getMap requests will be made; first for A then after C has been served by another source, B will be requested.

In this example, layer C could well be served by the same plugin but via a different instance of the class.

The derivative class of TSLWMSGetMapResponse passed to this method via the response argument, is dependent upon the request format and the platform the WMS is running upon. Currently only raster responses are available, but future releases of the WMS libraries may support other formats. To find the type of response object passed use TSLWMSGetMapRasterResponse::isRasterResponse, TSLWMSGetMapRasterResponseNT::isRasterResponseNT and TSLWMSGetMapRasterResponseX11::isRasterResponseX11.

Parameters
requestA subset of the user request specific for this data source
responseShould be populated with the data sources response to the request
Returns
Should return true on success, false otherwise. It is preferable that rather than returning false, a TSLWMSExceptionReport object is created, populated and then TSLWMSExceptionReport::throwException called on it. This allows the reason for the failure to be described to the requester.