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

Detailed Description

This callback class allows the user of a TSLWMSDataLayer to provide all of the information required to load a WMS layer, without the datalayer having to issue a GetCapabilities request to the WMS server.

The following items are required by the class:

  • Mandatory:
    1. getMapRequestAddress
    2. sub layer parameters [name, crs, and bounding box].
    3. exception format, for example: WMSExceptionFormatINIMAGE
  • Optional:
    1. request format, for example: "image/png"

Classes

struct  TSLWMSUserSubLayer
 

Public Member Functions

virtual const char * getGetMapRequestAddress ()=0
 
virtual TSLWMSUserSubLayergetSubLayers (int &subLayersSize)=0
 
virtual bool allowINIMAGEExceptions ()=0
 
virtual const char * getDefaultOutputRequestFormat ()
 
virtual ~TSLWMSServiceUserSettingsCallbacks ()
 Virtual destructor.
 

Constructor & Destructor Documentation

◆ ~TSLWMSServiceUserSettingsCallbacks()

virtual TSLWMSServiceUserSettingsCallbacks::~TSLWMSServiceUserSettingsCallbacks ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ allowINIMAGEExceptions()

virtual bool TSLWMSServiceUserSettingsCallbacks::allowINIMAGEExceptions ( )
pure virtual

Return whether the exception format INIMAGE is to be added to the GetMap request (URL parameter: &exceptions=INIMAGE)

This was set if the capabilities document contains: <Format>INIMAGE</Format>

or

<GetMap> <Format>application/vnd.ogc.se_inimage</Format>

Returns
True if the INIMAGE exception format is to be added to the request, false otherwise

◆ getDefaultOutputRequestFormat()

virtual const char * TSLWMSServiceUserSettingsCallbacks::getDefaultOutputRequestFormat ( )
inlinevirtual

Return the default output request format.

To be used if the future GetMap request does not have an output format.

The options are:

  1. "application/vnd.ogc.wms_xml"
  2. "text/xml"
  3. "image/gif"
  4. "image/png"
  5. "image/png24"
  6. "image/jpeg"
  7. "image/tiff"
  8. "image/tif"
  9. "application/vnd.ogc.gml"
  10. "text/plain"
  11. "text/html"

The default is: "image/png"

Returns
the default output request format string

◆ getGetMapRequestAddress()

virtual const char * TSLWMSServiceUserSettingsCallbacks::getGetMapRequestAddress ( )
pure virtual

Return the GetMap request address

This was set if the capabilities document contains the following: <GetMap> <DCPType> <HTTP> <Get> <OnlineResource xlink:type="simple" xlink:href="XXXXXXXXXX"> </Get> </HTTP> </DCPType> </GetMap>

Returns
The GetMap request address string

◆ getSubLayers()

virtual TSLWMSUserSubLayer * TSLWMSServiceUserSettingsCallbacks::getSubLayers ( int & subLayersSize)
pure virtual

Return the parameters of the sub layers included in the wms layer.

Each sublayer has a name, outer extent and CRS. This helps when there are multiple sublayers with different extens. If we set one layer visible then reset, it will use the visible sublayer's extent.

This was set if the capabilities document contains: <Name>XXX</Name> <BoundingBox CRS="CRS:X" minx="X.X" miny="X.X" maxx="X.X" maxy="X.X">

An example of handling this method in the application is:

// return the parameters of sub layers included in the wms layer. virtual TSLWMSServiceUserSettingsCallbacks::TSLWMSUserSubLayer* getSubLayers ( int& subLayersSize ) { int size = m_availableLayers.size(); subLayersSize = size; if(size == 0) { return nullptr; }

TSLWMSServiceUserSettingsCallbacks::TSLWMSUserSubLayer* subLayers = new TSLWMSServiceUserSettingsCallbacks::TSLWMSUserSubLayer[size]; for ( int i = 0; i < size; ++i ) { subLayers[i].name = m_availableLayers[i].name.c_str(); subLayers[i].crs = m_availableLayers[i].crs.c_str(); subLayers[i].minX = m_availableLayers[i].bbox.minX; subLayers[i].minY = m_availableLayers[i].bbox.minY; subLayers[i].maxX = m_availableLayers[i].bbox.maxX; subLayers[i].maxY = m_availableLayers[i].bbox.maxY; }

return subLayers; }

Parameters
subLayerSizeset to the number of sub layer names in the returned array of strings
Returns
An array of sub layers