| GlsMap Toolkit 1.10.1

Classes | Public Types | Public Member Functions | List of all members
disti::ShapefileMapChartDataSource Class Reference
Shapefile

`#include <gls_map_shapefile.h>`

Inheritance diagram for disti::ShapefileMapChartDataSource:

## Classes
class | RenderingAttorney
struct | ShapePoint

## Public Types
typedef Shapefile::LibraryID | LibraryID
typedef Shapefile::LayerID | LayerID
typedef void(* | RenderPointFeatureCB) (void *const userData, const char *featureSet, const char *featureType, double longitude, double latitude, const glsColor &color, const GeoRect &region, const double logicalHeight)
typedef void(* | RenderLineFeatureCB) (void *const userData, const char *featureSet, const char *featureType, const DynamicArray< ShapePoint > &points, const GeoRect &region, const double logicalHeight)

## Public Member Functions
| ShapefileMapChartDataSource ()
| ~ShapefileMapChartDataSource ()
bool | LoadLibraryAs (const char *shapefileRootPath, LibraryID libraryID)
bool | UnloadLibrary (LibraryID libraryID)
DynamicArray< LibraryID > | GetLoadedLibraries () const
bool | EnableLibraryRendering (LibraryID libraryID, bool enable=true)
bool | IsLibraryRenderingEnabled (LibraryID libraryID, bool &isEnabled) const
DynamicArray< const char * > | GetOrderedFeatureSetNames (LibraryID libraryID) const
bool | SetOrderedFeatureSetNames (LibraryID libraryID, const DynamicArray< const char * > &orderedFeatureSetNames)
DynamicArray< const char * > | GetFeatureTypes (LibraryID libraryID, const char *featureSet) const
bool | GetFeatureSetVisibility (LibraryID libraryID, const char *featureSet, const char *featureType, bool &isVisible) const
bool | SetFeatureSetVisibility (LibraryID libraryID, const char *featureSet, const char *featureType, bool isVisible)
bool | GetFeatureSetPointStyle (LibraryID libraryID, const char *featureSet, const char *featureType, glsColor &color, RenderPointFeatureCB &renderCB, void *&userData, bool &useMapScale) const
bool | SetFeatureSetPointStyle (LibraryID libraryID, const char *featureSet, const char *featureType, const glsColor &color, const RenderPointFeatureCB renderCB=NULL, void *const userData=NULL, const bool useMapScale=false)
bool | GetFeatureSetLineStyle (LibraryID libraryID, const char *featureSet, const char *featureType, glsColor &color, float &width, uint16_t &stipplePattern, int &stippleMultiplier) const
bool | GetFeatureSetLineStyle (const LibraryID libraryID, const char *const featureSet, const char *const featureType, RenderLineFeatureCB &renderCB, void *&userData) const
bool | SetFeatureSetLineStyle (LibraryID libraryID, const char *featureSet, const char *featureType, glsColor color, float width=DEF_LINE_WIDTH, uint16_t stipplePattern=DEF_LINE_STIPPLE_PATTERN, int stippleMultiplier=0)
bool | SetFeatureSetLineStyle (LibraryID libraryID, const char *featureSet, const char *featureType, const RenderLineFeatureCB renderCB, void *const userData=NULL)
bool | GetFeatureSetFillStyle (LibraryID libraryID, const char *featureSet, const char *featureType, glsColor &color, bool &drawBoundary, glsColor &boundaryColor, float &boundaryWidth, uint16_t &boundaryStipplePattern, int &boundaryStippleMultiplier) const
bool | SetFeatureSetFillStyle (LibraryID libraryID, const char *featureSet, const char *featureType, const glsColor &color, bool drawBoundary=false, const glsColor &boundaryColor=glsColor(0, 0, 0, 255), float boundaryWidth=DEF_LINE_WIDTH, uint16_t boundaryStipplePattern=DEF_LINE_STIPPLE_PATTERN, int boundaryStippleMultiplier=0)
bool | GetFeatureSetTextStyle (LibraryID libraryID, const char *featureSet, const char *featureType, GlsFontBase *&glsFont, glsColor &textColor, double &scale, double &xOffset, double &yOffset, bool &isVisible) const
bool | SetFeatureSetTextStyle (LibraryID libraryID, const char *featureSet, const char *featureType, GlsFontBase *glsFont, const glsColor &textColor=glsColor(0, 0, 0, 255), double scale=1.0, double xOffset=0.0f, double yOffset=0.0f, bool isVisible=true)
bool | SetCacheDimensions (LibraryID libraryID, double degreesLongitude, double degreesLatitude)
bool | LowerAsyncCellRenderPriority (bool belowNormal)
bool | GetAvailableCoverage (GeoRect *dest) DISTI_METHOD_OVERRIDE
LayerID | GetBestLayer (GlsMapView *view, GlsMapChart *chart) const DISTI_METHOD_OVERRIDE
void | GetCellList (const GeoRect &coverage, LayerID layerID, double viewLogicalHeight, double viewGeoHeight, MapChartCellList &viewList) DISTI_METHOD_OVERRIDE
Public Member Functions inherited from disti::GlsMapChartDataSource
virtual | ~GlsMapChartDataSource ()
virtual bool | GetAvailableCoverage (GeoRect *dest)=0
virtual unsigned long | GetBestLayer (GlsMapView *view, GlsMapChart *chart) const
virtual void | GetCellList (const GeoRect &coverage, unsigned long layerID, double viewLogicalHeight, double viewGeoHeight, MapChartCellList &viewList)=0
virtual void | PostDraw (GlsMapView *view, GlsMapChart *chart)
virtual bool | AreAllCellsLoaded (GlsMapView *view, GlsMapChart *chart)

## Additional Inherited Members
Protected Member Functions inherited from disti::GlsMapChartDataSource
| GlsMapChartDataSource ()

## Detailed Description

Note
  The ESRI Shapefile specification does not deal with shapefiles at different scales or levels of detail (e.g., 1:100k, 1:250k, 1:1M, etc.). This program, paralleling the DNC map data source, calls these different shapefiles "libraries". Multiple libraries can be loaded simultaneously and then unloaded when desired, all in the same data source.
  The ESRI Shapefile specification calls sets of features "layers", but the MapToolkit already used that term to refer to the different bin sizes it renders the Shapefile's vector data at. Due to existing virtual function names with "layer" in them, we retain MapToolkit's use of the term and substitute "feature set" (or use "Shapefile layer" when necessary) for Shapfile's notion of a "layer".

A feature set often (but not always) comes from a single .shp file with a single Shapefile layer and contains different subtypes of features (e.g., natural.shp may have feature types "forest", "river", etc.).

Note
  Each library has a set of attributes (visibility, color, etc.) for each of its feature sets, and each feature set has optional attributes to override the defaults for a specific feature type within set. These default and overridden attributes can be controlled with the setter and getter member functions.

For instance, the "natural" feature set could have black as the line color for all its features but override it to blue for rivers and green for forests.

## Member Typedef Documentation

## ◆ RenderLineFeatureCB

typedef void(* disti::ShapefileMapChartDataSource::RenderLineFeatureCB) (void *const userData, const char *featureSet, const char *featureType, const DynamicArray< ShapePoint > &points, const GeoRect &region, const double logicalHeight)

Draw callback for a user supplied line feature render routine. This routine is called with the model matrix loaded appropriately as to draw at the correct location.

Parameters

  userData | user supplied data for callback (supplied with SetPointFeatureRenderCB())
  featureSet | The name of the feature set (often corresponds to a single .shp file).
  featureType | The name of a type of feature within the feature set (e.g., in a "natural" feature set, there might be "water" and "forest" among others).
  points | the vertices of the path.
  region | region of the chart that is rendering
  logicalHeight | height in logical units corresponding to height of render region

## ◆ RenderPointFeatureCB

typedef void(* disti::ShapefileMapChartDataSource::RenderPointFeatureCB) (void *const userData, const char *featureSet, const char *featureType, double longitude, double latitude, const glsColor &color, const GeoRect &region, const double logicalHeight)

Draw callback for a user supplied point feature render routine. This routine is called with the model matrix loaded appropriately as to draw at the correct location using the origin (i.e., a vertex draw to (0,0) will map to the correct location as described by pointCoord. This routine does not need to save the model stack as the caller will push and pop (save) it accordingly.

Parameters

  userData | user supplied data for callback (supplied with SetPointFeatureRenderCB())
  featureSet | The name of the feature set (often corresponds to a single .shp file).
  featureType | The name of a type of feature within the feature set (e.g., in a "natural" feature set, there might be "water" and "forest" among others).
  longitude | longitude of point feature
  latitude | longitude of point feature
  color | color assigned to point feature
  region | region of the chart that is rendering
  logicalHeight | height in logical units corresponding to height of render region

## Member Function Documentation

## ◆ EnableLibraryRendering()

bool disti::ShapefileMapChartDataSource::EnableLibraryRendering | ( | LibraryID | libraryID,
|  | bool | enable = `true`
| ) |  |

Enable a given library to render. By default, only one library is set to render at a time. This function allows the user to render multiple libraries at a time, which may be useful if the libraries have orthogonal features in them, e.g., one library for roads, one for buildings, etc. (More commonly, a library has multiple feature sets within it, and each library covers the same geographic area but represents a different scale or level of detail.) Libraries are rendered in the order of their LibraryIDs, starting with the smallest value on the "bottom" of the texture and the next smallest writing on top of it (possibly overwriting).

Parameters

  libraryID | The library to update. If not found, this function emits a warning to the console and returns false without changing rendering.
  enable | Whether the library should be enabled (defaults to true).

Returns
  true if the library was found.

See also
  IsLibraryRenderingEnabled()
  LoadLibraryAs()

## ◆ GetAvailableCoverage()

bool disti::ShapefileMapChartDataSource::GetAvailableCoverage | ( | GeoRect * | dest | ) |
| virtual

See base class.

Implements disti::GlsMapChartDataSource.

## ◆ GetBestLayer()

ShapefileMapChartDataSource::LayerID disti::ShapefileMapChartDataSource::GetBestLayer | ( | GlsMapView * | view,
|  | GlsMapChart * | chart
| ) |  | const
| virtual

See base class

Note
  : "Layer" here refers to internal resolution level, not Shapefile layer.

Reimplemented from disti::GlsMapChartDataSource.

## ◆ GetCellList()

void disti::ShapefileMapChartDataSource::GetCellList | ( | const GeoRect & | coverage,
|  | LayerID | layerID,
|  | double | viewLogicalHeight,
|  | double | viewGeoHeight,
|  | MapChartCellList & | viewList
| ) |  |
| virtual

See base class.

Implements disti::GlsMapChartDataSource.

## ◆ GetFeatureSetFillStyle()

bool disti::ShapefileMapChartDataSource::GetFeatureSetFillStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | glsColor & | color,
|  | bool & | drawBoundary,
|  | glsColor & | boundaryColor,
|  | float & | boundaryWidth,
|  | uint16_t & | boundaryStipplePattern,
|  | int & | boundaryStippleMultiplier
| ) |  | const

Retrieves the current fill style of the features in feature set.

Parameters

  | libraryID | The library to query.
  | featureSet | The name of the feature set (often corresponds to a single .shp file). If null or not found, it emits a warning to the console and returns false.
  | featureType | The name of a type of feature within the feature set (e.g., in the "natural" feature set, there might be "water" and "forest" among others). If null or empty, it returns the default visibility for the feature set. If not found, it emits a warning to the console and returns false.
  [out] | color | The fill color for the requested features.
  [out] | drawBoundary | Whether or not to draw the area boundary
  [out] | boundaryColor | The boundary color for the requested features.
  [out] | boundaryWidth | The line width
  [out] | boundaryStipplePattern | The stipple pattern for lines (see documentation of glLineStipple())
  [out] | boundaryStippleMultiplier | The multiplier for stippling (see documentation of glLineStipple())

Returns
  true if the feature set and type (if not null/empty) were found. If false, the output parameter is unchanged.

## ◆ GetFeatureSetLineStyle() [1/2]

bool disti::ShapefileMapChartDataSource::GetFeatureSetLineStyle | ( | const LibraryID | libraryID,
|  | const char *const | featureSet,
|  | const char *const | featureType,
|  | RenderLineFeatureCB & | renderCB,
|  | void *& | userData
| ) |  | const

Retrieves the current line callback for the feature set.

Parameters

  | libraryID | The library to query.
  | featureSet | The name of the feature set (often corresponds to a single .shp file). If null or not found, it emits a warning to the console and returns false.
  | featureType | The name of a type of feature within the feature set (e.g., in the "natural" feature set, there might be "water" and "forest" among others). If null or empty, it returns the default line style for the feature set. If not found, it emits a warning to the console and returns false.
  [out] | renderCB | The line callback
  [out] | userData | The user data passed to the callback

Returns
  true if the feature set and type were found and they were set with the corresponding overload of SetFeatureSetLineStyle(); false otherwise. (If returning false, the output parameters are unchanged.)

## ◆ GetFeatureSetLineStyle() [2/2]

bool disti::ShapefileMapChartDataSource::GetFeatureSetLineStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | glsColor & | color,
|  | float & | width,
|  | uint16_t & | stipplePattern,
|  | int & | stippleMultiplier
| ) |  | const

Retrieves the current line style of the features in feature set.

Parameters

  | libraryID | The library to query.
  | featureSet | The name of the feature set (often corresponds to a single .shp file). If null or not found, it emits a warning to the console and returns false.
  | featureType | The name of a type of feature within the feature set (e.g., in the "natural" feature set, there might be "water" and "forest" among others). If null or empty, it returns the default line style for the feature set. If not found, it emits a warning to the console and returns false.
  [out] | color | The line color for the requested features.
  [out] | width | The line width for the requested features.
  [out] | stipplePattern | The line stipple pattern for the requested features.
  [out] | stippleMultiplier | The line stipple multiplier for the requested features.

Returns
  true if the feature set and type were found and they were set with the corresponding overload of SetFeatureSetLineStyle(); false otherwise. (If returning false, the output parameters are unchanged.)

## ◆ GetFeatureSetPointStyle()

bool disti::ShapefileMapChartDataSource::GetFeatureSetPointStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | glsColor & | color,
|  | RenderPointFeatureCB & | renderCB,
|  | void *& | userData,
|  | bool & | useMapScale
| ) |  | const

Retrieves the current point style of the features in feature set.

Parameters

  | libraryID | The library to query.
  | featureSet | The name of the feature set (often corresponds to a single .shp file). If null or not found, it emits a warning to the console and returns false.
  | featureType | The name of a type of feature within the feature set (e.g., in the "natural" feature set, there might be "water" and "forest" among others). If null or empty, it returns the default point style for the feature set. If not found, it emits a warning to the console and returns false.
  [out] | color | The point color for the requested features.
  [out] | renderCB | render callback else NULL for no callback
  [out] | userData | user supplied data to be handed to callback
  [out] | useMapScale | true if point feature should scale with the map (will become larger as the view zooms in), false is point feature should scale to attempt maintain the same size in logical space regardless of the map zoom

Returns
  true if the feature set and type (if not null/empty) were found. If false, the output parameters are unchanged.

## ◆ GetFeatureSetTextStyle()

bool disti::ShapefileMapChartDataSource::GetFeatureSetTextStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | GlsFontBase *& | glsFont,
|  | glsColor & | textColor,
|  | double & | scale,
|  | double & | xOffset,
|  | double & | yOffset,
|  | bool & | isVisible
| ) |  | const

Retrieves the current text style of the features in feature set.

Parameters

  | libraryID | The library to query.
  | featureSet | The name of the feature set (often corresponds to a single .shp file). If null or not found, it emits a warning to the console and returns false.
  | featureType | The name of a type of feature within the feature set (e.g., in the "natural" feature set, there might be "water" and "forest" among others). If null or empty, it returns the default visibility for the feature set. If not found, it emits a warning to the console and returns false.
  [out] | glsFont | The instance of a font in this GL Studio project
  [out] | textColor | The text color for the requested features.
  [out] | isVisible | Whether the text is visible for the requested features.
  [out] | scale | The scale of the text (default = 1.0)
  [out] | xOffset | horizontal offset from the default text location (text starts at the center of its objects extents)
  [out] | yOffset | vertical offset from the default text location (text starts at the center of its objects extents)

Note
  This function does not take ownership of the strings passed in.

Returns
  true if the feature set and type (if not null/empty) were found. If false, the output parameters are unchanged.

## ◆ GetFeatureSetVisibility()

bool disti::ShapefileMapChartDataSource::GetFeatureSetVisibility | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | bool & | isVisible
| ) |  | const

Retrieves the current visibility of the features in the given feature set, optionally limited to a single feature type.

Parameters

  | libraryID | The library to query.
  | featureSet | The name of the feature set (often corresponds to a single .shp file). If null, empty, or not found, it emits a warning to the console and returns false.
  | featureType | The name of a type of feature within the feature set (e.g., in a "natural" feature set, there might be "water" and "forest" among others). If null or empty, it returns the default visibility for the feature set. If not found, it emits a warning to the console and returns false.
  [out] | isVisible | Whether the requested features are visible.

Returns
  true if the feature set and type (if not null/empty) were found. If false, the output parameter is unchanged.

## ◆ GetFeatureTypes()

DynamicArray< const char * > disti::ShapefileMapChartDataSource::GetFeatureTypes | ( | LibraryID | libraryID,
|  | const char * | featureSet
| ) |  | const

Returns a list of feature types in the given featureSetName within the given library.

Parameters

  libraryID | The library to query.
  featureSet | The name of the feature set. If null or not found, this function emits an error to the console and returns an empty array.

Note
  The caller is NOT responsible to delete/free the pointers in the returned array. They are guaranteed valid until LoadLibraryAs() or UnloadLibrary() is called for this library.

## ◆ GetLoadedLibraries()

DynamicArray< ShapefileMapChartDataSource::LibraryID > disti::ShapefileMapChartDataSource::GetLoadedLibraries | ( |  | ) | const

Returns a list of all currently loaded library IDs.

See also
  LoadLibraryAs()
  UnloadLibrary()

## ◆ GetOrderedFeatureSetNames()

DynamicArray< const char * > disti::ShapefileMapChartDataSource::GetOrderedFeatureSetNames | ( | LibraryID | libraryID | ) | const

Returns a list of feature set names in the order they are to be drawn, from bottom to top.

Parameters

  libraryID | The library to query. If not found, the function emits a warning to the console and returns an empty array.

Note
  The caller is NOT responsible to delete the pointers in the array. They are guaranteed valid until LoadLibraryAs() or UnloadLibrary() is called for this libraryID.

See also
  SetOrderedFeatureSetNames()
  GetFeatureNames()

## ◆ IsLibraryRenderingEnabled()

bool disti::ShapefileMapChartDataSource::IsLibraryRenderingEnabled | ( | LibraryID | libraryID,
|  | bool & | isEnabled
| ) |  | const

Query whether a given library is set to render.

Parameters

  | libraryID | The library to update. If not found, this function emits a warning to the console and returns false without changing the output parameter.
  [out] | isEnabled | Whether the library is enabled

Returns
  true if the library was found.

See also
  EnableLibraryRendering()

## ◆ LoadLibraryAs()

bool disti::ShapefileMapChartDataSource::LoadLibraryAs | ( | const char * | shapefileRootPath,
|  | LibraryID | libraryID
| ) |  |

Load a Shapefile (or files) from the given path and associate it with a given library identifier.

Parameters

  shapefileRootPath | path to Shapefile or directory containing Shapefile(s). Multiple files in one folder will be considered one library. If null, empty, or not found, the function emits an error and returns false.
  libraryID | The library ID (see note), often the scale of this library. It acts as a handle to this library for other operations on it using this data source.

If the path loads successfully but the ID has already been used, it will unload the old data and replace it with the data from this path after emitting a warning to the console (unload first to avoid the warning).

The library ID also controls what order multiple enabled libraries are rendered in, starting with the lowest libraryID and going to the largest.

Note
  This method can be called repeatedly to add multiple libraries to this data source. The loading of different libraries can take place in any order, and multiple libraries can be loaded into the same data source object. Only the first library loaded is enabled for rendering; EnableLibraryRendering() controls which library or libraries render. The libraryID controls the order of rendering when multiple libraries are enabled.

See also
  UnloadLibrary()
  GetLoadedLibraries()
  EnableLibraryRendering()

Note
  We would name this LoadLibrary(), but Windows #defines LoadLibrary, which interferes.

Returns
  Returns whether the path was loaded successfully.

## ◆ SetCacheDimensions()

bool disti::ShapefileMapChartDataSource::SetCacheDimensions | ( | LibraryID | libraryID,
|  | double | degreesLongitude,
|  | double | degreesLatitude
| ) |  |

Sets the geographical size of the region to cache. Each library has its own cache region.

Parameters

  libraryID | The library whose cache size to adjust.
  degreesLongitude | the width of cache size in degrees of longitude
  degreesLatitude | the height of cache size in degrees of latitude

Returns
  true if the library was found.

## ◆ SetFeatureSetFillStyle()

bool disti::ShapefileMapChartDataSource::SetFeatureSetFillStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | const glsColor & | color,
|  | bool | drawBoundary = `false`,
|  | const glsColor & | boundaryColor = `glsColor( 0, 0, 0, 255 )`,
|  | float | boundaryWidth = `DEF_LINE_WIDTH`,
|  | uint16_t | boundaryStipplePattern = `DEF_LINE_STIPPLE_PATTERN`,
|  | int | boundaryStippleMultiplier = `0`
| ) |  |

Sets the fill style for polygon features in the feature set.

Parameters

  libraryID | The library to query.
  featureSet | The name of the feature set. If null, sets the style for all features sets. If non-null and not found, this function emits a warning to the console and returns false
  featureType | The name of the feature. If null or empty, it applies to the default attributes for the feature set. If not found, it creates a new feature attribute override entry.
  color | The RGBA color value for filling polygons.
  boundaryColor | The boundary color for the requested features.
  drawBoundary | Whether or not to draw the area boundary
  boundaryWidth | The line width
  boundaryStipplePattern | The stipple pattern for lines (see documentation of glLineStipple())
  boundaryStippleMultiplier | The multiplier for stippling (see documentation of glLineStipple())

Note
  This can be called multiple times, once with featureType == NULL to set the default and then with featureType != NULL to change specific features.

Returns
  true if the feature set was found.

## ◆ SetFeatureSetLineStyle() [1/2]

bool disti::ShapefileMapChartDataSource::SetFeatureSetLineStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | const RenderLineFeatureCB | renderCB,
|  | void *const | userData = `NULL`
| ) |  |

Sets the line callback for features in a set.

Parameters

  libraryID | The library to query.
  featureSet | The name of the feature set. If null, sets the style for all features sets. If non-null and not found, this function emits a warning to the console and returns false
  featureType | The name of the feature. If null or empty, it applies to the default attributes for the feature set. If not found, it creates a new feature attribute override entry.
  renderCB | the line callback
  userData | The optional user data passed to the callback, can be NULL if unused.

Note
  There are two overloads of this function – this one that supplies OpenGL line settings and another that supplies a user callback for custom drawing. Calling this function with the same libraryID, featureSet, and featureType as a previously configured with OpenGL line settings will discard the OpenGL line settings.

Returns
  true if the feature set was found. Will return false and have no effect if renderCB is NULL.

## ◆ SetFeatureSetLineStyle() [2/2]

bool disti::ShapefileMapChartDataSource::SetFeatureSetLineStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | glsColor | color,
|  | float | width = `DEF_LINE_WIDTH`,
|  | uint16_t | stipplePattern = `DEF_LINE_STIPPLE_PATTERN`,
|  | int | stippleMultiplier = `0`
| ) |  |

Sets the line style (outline for polygon features) for features in a set.

Parameters

  libraryID | The library to query.
  featureSet | The name of the feature set. If null, sets the style for all features sets. If non-null and not found, this function emits a warning to the console and returns false
  featureType | The name of the feature. If null or empty, it applies to the default attributes for the feature set. If not found, it creates a new feature attribute override entry.
  color | The RGBA color value for lines
  width | The line width
  stipplePattern | The stipple pattern for lines (see documentation of glLineStipple())
  stippleMultiplier | The multiplier for stippling (see documentation of glLineStipple())

Note
  There are two overloads of this function – this one that supplies OpenGL line settings and another that supplies a user callback for custom drawing. Calling this function with the same libraryID, featureSet, and featureType as a previously configured with a callback will discard the callback.

Returns
  true if the feature set was found.

## ◆ SetFeatureSetPointStyle()

bool disti::ShapefileMapChartDataSource::SetFeatureSetPointStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | const glsColor & | color,
|  | const RenderPointFeatureCB | renderCB = `NULL`,
|  | void *const | userData = `NULL`,
|  | const bool | useMapScale = `false`
| ) |  |

Sets the point style (outline for polygon features) for features in a set.

Parameters

  libraryID | The library to query.
  featureSet | The name of the feature set. If null, sets the style for all features sets. If non-null and not found, this function emits a warning to the console and returns false
  featureType | The name of the feature. If null or empty, it applies to the default attributes for the feature set. If not found, it creates a new feature attribute override entry.
  color | The RGBA color value for points
  renderCB | render callback else NULL for no callback
  userData | user supplied data to be handed to callback
  useMapScale | true if point feature should scale with the map (will become larger as the view zooms in), false is point feature should scale to attempt maintain the same size in logical space regardless of the map zoom

Note
  This can be called multiple times, once with featureType == NULL to set the default and then with featureType != NULL to change specific features.

Returns
  true if the feature set was found.

## ◆ SetFeatureSetTextStyle()

bool disti::ShapefileMapChartDataSource::SetFeatureSetTextStyle | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | GlsFontBase * | glsFont,
|  | const glsColor & | textColor = `glsColor( 0, 0, 0, 255 )`,
|  | double | scale = `1.0`,
|  | double | xOffset = `0.0f`,
|  | double | yOffset = `0.0f`,
|  | bool | isVisible = `true`
| ) |  |

Sets the text style for a feature set.

Parameters

  libraryID | The library to query.
  featureSet | The name of the feature set. If null, sets the style for all features sets. If non-null and not found, this function emits a warning to the console and returns false
  featureType | The name of the feature. If null or empty, it applies to the default attributes for the feature set. If not found, it creates a new feature attribute override entry.
  glsFont | The instance of a font in this GL Studio project
  textColor | Color of the text. (Defaults to black.)
  isVisible | Whether the text is visible for the requested features.
  scale | The scale of the text (default = 1.0)
  xOffset | horizontal offset from the default text location (text starts at the center of its objects extents)
  yOffset | vertical offset from the default text location (text starts at the center of its objects extents)

Note
  This can be called multiple times, once with featureType == NULL to set the default and then with featureType != NULL to change specific features.
  This function does not take ownership of the strings passed in.

Returns
  true if the feature set was found.

## ◆ SetFeatureSetVisibility()

bool disti::ShapefileMapChartDataSource::SetFeatureSetVisibility | ( | LibraryID | libraryID,
|  | const char * | featureSet,
|  | const char * | featureType,
|  | bool | isVisible
| ) |  |

Sets the visibility for features in a feature set.

Parameters

  libraryID | The library to update.
  featureSet | The name of the feature set. If null, sets the visibility for all features sets. If non-null and not found, this function emits a warning to the console and returns false without changing visibility.
  featureType | The type of feature within the feature set. If null or empty, it applies to the default feature set. If not found, it creates a new feature attribute override entry.
  isVisible | The visibility to be applied.

Note
  This can be called multiple times, once with featureType == NULL to set the default and then with featureType != NULL to change specific features.

Returns
  true if the feature set and was found.

## ◆ SetOrderedFeatureSetNames()

bool disti::ShapefileMapChartDataSource::SetOrderedFeatureSetNames | ( | LibraryID | libraryID,
|  | const DynamicArray< const char * > & | orderedFeatureSetNames
| ) |  |

Sets the feature set names in the order they are to be drawn.

Parameters

  libraryID | The library to update.
  orderedFeatureSetNames | The list of names in order from bottom to top. If any feature set name is null, empty, or does not exist or if a name is missing from the list, a warning is emitted to the console, and the function returns false without changing draw order.

Note
  Use GetOrderedFeatureSetNames() to get a valid list of feature set names, reorder them in place, and pass the result into this function.
  This function does NOT take ownership of the strings in the array, though it may already have ownership if the array is a reordering of the result of GetOrderedFeatureSetNames().

Returns
  true if all names were applied.

## ◆ UnloadLibrary()

bool disti::ShapefileMapChartDataSource::UnloadLibrary | ( | LibraryID | libraryID | ) |

Unloads a given library.

Returns
  true if the library was found.

See also
  LoadLibraryAs()
  GetLoadedLibraries()

The documentation for this class was generated from the following files:

- gls_map_shapefile.h
- gls_map_shapefile.cpp