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

Detailed Description

Specialist class providing additional functions for use when a TSLClientCustomDataLayer implementation is being drawn. This class is not user constructable.

This class provides a means for TSLClientCustomDataLayer derived classes to draw additional TSLDataLayers not present in a TSLDrawingSurface as part of their normal drawing.

Public Member Functions

bool drawLayer (TSLDataLayer *dataLayer, const TSLEnvelope &extent, const char *layerName=NULL, const TSLCustomDataLayerProperties *layerProperties=NULL)
 
const TSLDrawingSurfacedrawingSurface () const
 
const TSLCustomDataLayerPropertiesdataLayerProperties ()
 

Member Function Documentation

◆ dataLayerProperties()

const TSLCustomDataLayerProperties * TSLCustomDataLayerHandler::dataLayerProperties ( )

Provides access to the data layer properties of the TSLCustomDataLayer currently being drawn in a convenient format. For information on the use of the returned TSLCustomDataLayerProperties class see the class documentation and the documentation for the TSLCustomDataLayerHandler::drawLayer() method.

The returned object is owned by MapLink and should not be deleted by the user.

◆ drawingSurface()

const TSLDrawingSurface * TSLCustomDataLayerHandler::drawingSurface ( ) const

Returns the TSLDrawingSurface that the TSLClientCustomDataLayer implementation is being drawn to.

Note that the constness of the returned surface should not be casted away in order to access non-const methods on the drawing surface as this will result in unpredictable behaviour.

◆ drawLayer()

bool TSLCustomDataLayerHandler::drawLayer ( TSLDataLayer * dataLayer,
const TSLEnvelope & extent,
const char * layerName = NULL,
const TSLCustomDataLayerProperties * layerProperties = NULL )

Allows a MapLink data layer to be drawn as part of the drawing of a TSLClientCustomDataLayer. A TSLDataLayer derived class is constructed and populated as normal by a TSLClientCustomDataLayer implementation and passed to this method to be drawn to the drawing surface as part of the rendering of the TSLClientCustomDataLayer. The user retains ownership of the data layer.

Data layers drawn in this fashion should not have been added to the drawing surface as this will result in the layer being drawn twice.

By default a data layer drawn in this fashion inherits the data layer properties of the TSLCustomDataLayer that draws it. This can be overridden by passing a TSLCustomDataLayerProperties instance containing the desired data layer properties in the layerProperties argument.

Limitations

  • Multiple data layers may be drawn in a single TSLClientCustomDataLayer::drawLayer() call, however all layers drawn this way will use the active TSLCoordinateSystem for the drawing surface for all coordinate transformations. Thus if two TSLMapDataLayers are being drawn they must use the same TSLCoordinateSystem for both layers to draw correctly.
  • Transparency for data layers drawn via this method will only function if the parent TSLCustomDataLayer has been set up for transparency to work. For more information see the documentation for the TSLPropertyEnum enumeration.
  • Data layers drawn via this method will use the TSLPropertyBuffered setting of the parent TSLCustomDataLayer regardless of the value set on the TSLCustomDataLayerProperties instance passed in.
  • The TSLPropertyDetect, TSLPropertySelect and TSLPropertyTransparent data layer properties have no effect on data layers drawn via this method.
Parameters
dataLayerThe TSLDataLayer to draw to the drawing surface containing the TSLCustomDataLayer. The user retains ownership of this data layer.
extentThe extent in TMCs of the data layer to draw. In most cases this will be the same as the TSLEnvelope passed to the TSLClientCustomDataLayer::drawLayer() method.
layerNameThe name of the layer being drawn. Defaults to NULL, meaning the layer inherits the name of the parent TSLCustomDataLayer given when it was added to the drawing surface,
layerPropertiesAn instance of the TSLCustomDataLayerProperties class that defines the data layer properties to use when drawing the layer. For information on the available properties see the documentation for the TSLPropertyEnum enumeration. The user retains ownership of this object. Defaults to NULL, meaning the layer uses the properties of the parent TSLCustomDataLayer.
Returns
true if the layer was drawn successfully, false otherwise.