Global Mapper Software Development Kit (SDK) Reference

Contents


General Overview

The Global Mapper SDK allows the use of Global Mapper loading, rendering, and export technology within your own applications. Using the SDK you can perform a vast array of functions, a few of which include:


GM_3DCloseViewWindow
GM_Error_t32 __stdcall GM_3DCloseViewWindow
    (
    void
    );

Closes the 3D view window if it is open.


GM_3DIsWindowOpen
BOOL __stdcall GM_3DIsWindowOpen
    (
    void
    );

Returns TRUE if the 3D view window is open.


GM_3DSetChangeViewCallback
void __stdcall GM_3DSetChangeViewCallback
    (
    GM_3DChangeViewCallbackFunc aCallbackFunc,
    void*                       aUserData
    );

Sets the callback function to be called when a button is pressed (either a pan or zoom button) in the 3D view that would typically result in a new set of data to be displayed in the 3D window.

Provide this callback if you want to keep your main view in sync with the 3D view, like in the Global Mapper application. If you do not provide a callback, the default behavior is to just update the data displayed in the 3D view independent of any other view.


GM_3DSetView
GM_Error_t32 __stdcall GM_3DSetView
    (
    GM_LayerHandle_t32*     aLayerList,     // IN: List of layers to drape on top of terrain or NULL for all
    uint32                  aLayerCount,    // IN: Number of layers in list (0 for all)
    GM_DrawFlags_t32        aDrawFlags,     // IN: Flags controlling how the draw is performed
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect,     // IN: Pixel bounds to convert from or NULL for last drawn 
    uint32                  aReserved       // IN: Reserved (set to 0)
    );

Sets what to display in the currently open 3D view window. The 3D view window will be opened if necessary.


GM_AddAreaToCustomVectorLayer
GM_DLL_EXPORTED GM_Error_t32 GM_AddAreaToCustomVectorLayer
    (
    GM_LayerHandle_t32      aLayer,             // IN: Layer to add area to
    const GM_AreaFeature_t* aArea,              // IN: Area feature to add
    boolean                 aUseDefaultStyle    // IN: Use default drawing style and font for type rather than style in type structure?
    );

Adds an area feature to a custom vector layer create with the GM_CreateCustomVectorLayer function.


GM_AddCustomAreaClass
GM_Error_t32 __stdcall GM_AddCustomAreaClass
    (
    const char*             aName,              // IN: Custom type name
    const GM_AreaStyle_t*   aStyle,             // IN: Default draw style for features of this type
    AreaFeatureClass_t16*   aFeatureCode        // OUT: Classification code for new type
    );

Adds a new custom area classification. If this function succeeds, the new feature classification code will be returned in the aFeatureCode value. This code can then be used as the feature classification for area features.


GM_AddCustomDatum
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddCustomDatum
    (
    const GM_DatumInfo_t*   aDatumInfo,     // IN: Information about datum transformation to add
    DATUM*                  aDatumCode      // OUT: Datum code assigned to new custom datum
    )

Adds a new custom datum definition based on the provided GM_DatumInfo_t structure. The datum code assigned for the new datum is returned in aDatumCode. If a custom datum with the same name already exists, the parameters for that datum will be updated.

EXAMPLE 1: - Add custom Bursa-Wolfe datum (this is identical to Lisboa 1937 datum)
// Setup the custom datum information
GM_DatumInfo_t theDatumInfo;
::memset( &theDatumInfo, 0, sizeof theDatumInfo );
theDatumInfo.mMethod = GM_Datum_BursaWolfe;
theDatumInfo.mDatumName = "DLx"; 
theDatumInfo.mEllipsoidName = "International 1909 (Hayford/Intl 1924)"; // Name of ellipsoid this datum is based on
theDatumInfo.mDeltaX = -288.88;      
theDatumInfo.mDeltaY = -91.74;       
theDatumInfo.mDeltaZ = 126.24;       
theDatumInfo.mScale = -4.598E-6;     
theDatumInfo.mRotX = -1.6910;       // X rotation in arc seconds      
theDatumInfo.mRotY = 0.41;          // Y rotation in arc seconds
theDatumInfo.mRotZ = -0.211;        // Z rotation in arc seconds

// Add the datum
DATUM theDatumCode = GM_DATUM_UNKNOWN;
GM_Error_t32 theRetCode = GM_AddCustomDatum( &theDatumInfo, &theDatumCode );

GM_AddCustomLineClass
GM_Error_t32 __stdcall GM_AddCustomLineClass
    (
    const char*             aName,              // IN: Custom type name
    const GM_LineStyle_t*   aStyle,             // IN: Default draw style for features of this type
    LineFeatureClass_t16*   aFeatureCode        // OUT: Classification code for new type
    );

Adds a new custom line classification. If this function succeeds, the new feature classification code will be returned in the aFeatureCode value. This code can then be used as the feature classification for line features.


GM_AddCustomPointClass
GM_Error_t32 __stdcall GM_AddCustomPointClass
    (
    const char*             aName,              // IN: Custom type name
    const GM_PointStyle_t*  aStyle,             // IN: Default draw style for features of this type
    PointFeatureClass_t16*  aFeatureCode        // OUT: Classification code for new type
    );

Adds a new custom point classification. If this function succeeds, the new feature classification code will be returned in the aFeatureCode value. This code can then be used as the feature classification for point features.


GM_AddCustomShader
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddCustomShader
    (
    const GM_CustomShader_t*    aShader,    // in: shader to add
    uint32                      aReserved   // reserved, must be 0
    );

Adds a new custom shader for possible use for elevation layer display. Once the shader is added, you can use the GM_SetVerticalDisplayOptions function to make it the active shader for rendering elevation layers or the GM_SetElevationOverrides function to set it as the shader to use for rendering a particular layer.

If a custom shader with the name specified already exists, that shader will be updated. Otherwise a new custom shader with the specified name will be created.


GM_AddCustomSymbol
GM_Error_t32 GM_AddCustomSymbol
    (
    const char* aSymbolFilename,                // Full path to symbol file (BMP or ICO)
    const char* aSymbolName                     // Text name to use when referring to the symbol
    );

Adds a new custom symbol that can be used when drawing point features (see the GM_SetPointFeatureDrawStyle function).


GM_AddLineToCustomVectorLayer
GM_DLL_EXPORTED GM_Error_t32 GM_AddLineToCustomVectorLayer
    (
    GM_LayerHandle_t32      aLayer,             // IN: Layer to add line to
    const GM_LineFeature_t* aLine,              // IN: Line feature to add
    boolean                 aUseDefaultStyle    // IN: Use default drawing style and font for type rather than style in type structure?
    );

Adds a line feature to a custom vector layer create with the GM_CreateCustomVectorLayer function.


GM_AddPointToCustomVectorLayer
GM_DLL_EXPORTED GM_Error_t32 GM_AddPointToCustomVectorLayer
    (
    GM_LayerHandle_t32			aLayer,         // IN: Layer to add point to
    const GM_PointFeature_t*	aPoint,         // IN: Point feature to add
    boolean						aUseDefaultStyle// IN: Use default drawing style and font for type rather than style in type structure?
    );

Adds a point feature to a custom vector layer create with the GM_CreateCustomVectorLayer function.


GM_CalcBearing
GM_Error_t32 GM_CalcBearing
    (
    double  aFromX,     // IN: start X/longitude coordinate
    double  aFromY,     // IN: start Y/latitude coordinate
    double  aToX,       // IN: stop X/longitude coordinate
    double  aToY,       // IN: stop Y/latitude coordinate
    boolean aLatLon,    // IN: TRUE - coordinates are lat/lon, FALSE - coordinates are in the current projection?
    double* aBearing    // OUT: bearing in radians between the points
    );

Calculates the bearing in radians between two points. The points can either be specified as lat/lon values or in the current projection. The bearing retrieved is a cartographic bearing, with 0 being north, PI / 2 being east, PI being south, and 3 * PI / 2 being west.


GM_CalcDistance
GM_Error_t32 GM_CalcDistance
    (
    double  aFromX,     // IN: start X/longitude coordinate
    double  aFromY,     // IN: start Y/latitude coordinate
    double  aToX,       // IN: stop X/longitude coordinate
    double  aToY,       // IN: stop Y/latitude coordinate
    boolean aLatLon,    // IN: TRUE - coordinates are lat/lon, FALSE - coordaintes are in the current projection?
    double* aDist       // OUT: distance in meters between the points
    );

Calculates the great-circle distance in meters between two points. The points can either be specified as lat/lon values or in the current projection.


GM_CalcEnclosedArea
GM_Error_t32 __stdcall GM_CalcEnclosedArea
    (
    const GM_Point_t*       aPtList,    // IN: list of points defining area
    uint32                  aNumPoints, // IN: number of points in list
    const GM_Projection_t*  aProj,      // IN: projection of points in list (use NULL for current projection returned by GM_GetProjection)
    double*                 aArea       // OUT: enclosed area in square meters
    );

Calculates the enclosed area of a list of points. The coordinates in aPtList are in the projection defined by aProj. If NULL is passed for aProj then the current global projection as returned by GM_GetProjection is assumed.


GM_CalcProjectedLocation
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_CalcProjectedLocation
    (
    double  aFromX,     // IN: start X/longitude coordinate
    double  aFromY,     // IN: start Y/latitude coordinate
    double  aBearing,   // IN: bearing in degrees to project along (0 is north, 90 is east, 180 is south, 270 is west)
    double  aDist,      // IN: distance to project along bearing in meters
    double* aToX,       // OUT: stop X/longitude coordinate
    double* aToY,       // OUT: stop Y/latitude coordinate
    boolean aLatLon     // IN: TRUE - coordinates are lat/lon, FALSE - coordinates are in the current projection
    );

Calculates the location of a new point projected from a start point along a given bearing. The input and output points can either be specified as lat/lon values or in the current projection.


GM_CalcScaleRectangle
GM_Error_t32 GM_CalcScaleRectangle
    (
    const GM_Point_t*       aCenterPoint,   // IN: Center point in global coordinates
    double                  aScale,         // IN: Scale to calculate at (i.e. for 1:24K, pass 24000.0)
    HDC                     aDC,            // IN: Device context that will be drawn to
    sint32                  aPixWidth,      // IN: pixel width
    sint32                  aPixHeight,     // IN: pixel height
    GM_Rectangle_t*         aScaleRect      // OUT: rectangle at given scale
    );

Calculates the rectangle in global coordinates required to draw at the provided scale to the given device of the given size.


GM_CalcViewShed
GM_Error_t32 GM_CalcViewShed
    (
    const GM_ViewShedParams_t*  aViewShedParms, // IN: Parameters for creating view shed
    GM_LayerHandle_t32*         aViewShedLayer  // OUT: Created view shed layer
    );

Performs a view-shed analysis on loaded elevation data and creates a new view shed layer with the results. The layer handle returned in aViewShedLayer must be closed with GM_CloseLayer when you are done with it.


GM_CalcVolumeAlongLine
GM_Error_t32 GM_CalcVolumeAlongLine
    (
    GM_LayerHandle_t32              aLayer,         // IN: Layer to get elevations from or NULL for topmost layer at each point
    const GM_LineVolumeParams_t*    aVolumeParms,   // IN: Parameters for line volume calculation
    double*                         aCutVolume,     // OUT: Cut volume in cubic meters
    double*                         aFillVolume     // OUT: Fill volume in cubic meters
    );

Calculates the cut-and-fill volumes along the given line relative to the cut heights for each vertex. The heights used between points will be interpolated between the heights at the start and end of each segment.


GM_CalcVolumeOfArea
GM_Error_t32 GM_CalcVolumeOfArea
    (
    GM_LayerHandle_t32              aLayer,         // IN: Layer to get elevations from or NULL for topmost layer at each point
    const GM_AreaVolumeParams_t*    aVolumeParms,   // IN: Parameters for area volume calculation
    double*                         aCutVolume,     // OUT: Cut volume in cubic meters
    double*                         aFillVolume     // OUT: Fill volume in cubic meters
    );

Calculates the cut-and-fill volumes with the given area relative to the cut height.


GM_CalcWorldRectSize
GM_Error_t32 GM_CalcWorldRectSize
    (
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to calc size of or NULL for last drawn
    double*                 aWidthMeters,   // OUT: Width of rectangle in meters
    double*                 aHeightMeters   // OUT: Height of rectangle in meters
    );

Calculates the width and height of a rectangle in the current projection. The rectangle can either be specified or the last drawn rectangle can be used.


GM_CloseLayer
GM_Error_t32 GM_CloseLayer
    ( 
    GM_LayerHandle_t32  aLayer
    );

The GM_CloseLayer function closes a previously opened layer.


GM_ClosePackage
GM_Error_t32 GM_ClosePackage
    ( 
    GM_PackageHandle_t32    aPackage
    );

Closes a previously opened package that was opened with the GM_LoadPackage function.


GM_ConvertCoordGroundToPixel
GM_Error_t32 GM_ConvertCoordGroundToPixel
    ( 
    double                  aGroundX,       // IN: X Coord in current projection
    double                  aGroundY,       // IN: Y Coord in current projection
    sint32*                 aPixelX,        // OUT: X Coord in pixel space
    sint32*                 aPixelY,        // OUT: Y Coord in pixel space
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect      // IN: Pixel bounds to convert from or NULL for last drawn 
    );

The GM_ConvertCoordGroundToPixel function converts a coordinate between the current projection and pixel space. The conversion space can be either the last drawn coordinate space or the caller can provide the coordinate space to work in.


GM_ConvertCoordGroundToPixelWithOrientation
GM_Error_t32 __stdcall GM_ConvertCoordGroundToPixelWithOrientation
    ( 
    double                  aGroundX,       // IN: X Coord in current projection
    double                  aGroundY,       // IN: Y Coord in current projection
    sint32*                 aPixelX,        // OUT: X Coord in pixel space
    sint32*                 aPixelY,        // OUT: Y Coord in pixel space
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect,     // IN: Pixel bounds to convert from or NULL for last drawn 
    double                  aOrientation    // IN Orientation of coordinate space to use (0 is north up, 90 is east up, 180 is south up, 270 is west up)
    )

Convert a coordinate between the current projection and a pixel coordinate. The conversion space can be either the last drawn coordinate space or the caller can provide the coordinate space to work in. You also supply an orientation angle to perform the conversion with.

The only time that you should need to call this function is if you want to do a coordinate conversion in a different orientation than what has been set globally with GM_SetOrientation.


GM_ConvertCoordPixelToGround
GM_Error_t32 GM_ConvertCoordPixelToGround
    ( 
    sint32                  aPixelX,        // IN: X Coord in pixel space
    sint32                  aPixelY,        // IN: Y Coord in pixel space
    double*                 aGroundX,       // OUT: X Coord in current projection
    double*                 aGroundY,       // OUT: Y Coord in current projection
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect      // IN: Pixel bounds to convert from or NULL for last drawn 
    );

The GM_ConvertCoordPixelToGround function converts a coordinate between pixel space and the current projection. The conversion space can be either the last drawn coordinate space or the caller can provide the coordinate space to work in.


GM_ConvertCoordPixelToGroundWithOrientation
GM_Error_t32 __stdcall GM_ConvertCoordPixelToGroundWithOrientation
    ( 
    sint32                  aPixelX,        // IN: X Coord in pixel space
    sint32                  aPixelY,        // IN: Y Coord in pixel space
    double*                 aGroundX,       // OUT: X Coord in current projection
    double*                 aGroundY,       // OUT: Y Coord in current projection
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect,     // IN: Pixel bounds to convert from or NULL for last drawn 
    double                  aOrientation    // IN Orientation of coordinate space to use (0 is north up, 90 is east up, 180 is south up, 270 is west up)
    )

Convert a coordinate between pixel space and the current projection. The conversion space can be either the last drawn coordinate space or the caller can provide the coordinate space to work in. You also need to supply an orientation (rotation angle) at which to do the conversion.

The only time that you should need to call this function is if you want to do a coordinate conversion in a different orientation than what has been set globally with GM_SetOrientation.


GM_CreateCustomElevGridLayer
GM_LayerHandle_t32 GM_CreateCustomElevGridLayer
    (
    const char*             aDescription,       // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*  aProj,              // IN: Native projection of new layer
    const GM_Point_t*       aTopLeft,           // IN: Ground coordinates of top left sample
    double                  aXSampleSize,       // IN: Size of each grid cell in the x direction
    double                  aYSampleSize,       // IN: Size of each grid cell in the y direction
    sint32                  aNumSamplesX,       // IN: Number of samples in the x direction
    sint32                  aNumSamplesY,       // IN: Number of samples in the y direction
    const void*             aElevGrid,          // IN: Grid of elevation values in row-major order
    GM_GridLayout_t8        aGridLayout,        // IN: Layout of elevation grid
    float                   aNoDataValue        // IN: Value of samples for which the value isn't known (i.e. -9999.9)
    );

Creates a new custom layer that represents an in-memory elevation grid. The handle to the newly created layer is returned. You must call GM_CloseLayer on the returned handle when you are done with it. If a problem occurs, NULL is returned for the layer handle.

The layer handle returned can be used just like any other layer handle. This means that you can do things like generate contours and calculate view sheds using the data.


GM_CreateCustomRasterLayer
GM_LayerHandle_t32 __stdcall GM_CreateCustomRasterLayer
    (
    const char*                 aDescription,       // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*      aProj,              // IN: Native projection of new layer
    const GM_RasterLayout_t*    aRasterLayout,      // IN: Raster layer layout
    const void*                 aDataBuf            // IN: Grid of raster data values in row-major order
    )

Creates a new custom layer that represents an in-memory raster. The handle to the newly created layer is returned. You must call GM_CloseLayer on the returned handle when you are done with it. If a problem occurs, NULL is returned for the layer handle.

The layer handle returned can be used just like any other layer handle.


GM_CreateCustomVectorLayer
GM_DLL_EXPORTED GM_LayerHandle_t32 GM_CreateCustomVectorLayer
    (
    const char*             aDescription,       // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*  aProj               // IN: Native projection of new layer
    );

Creates a new custom layer for adding vector features to. The handle to the newly created layer is returned. You must call GM_CloseLayer on the returned handle when you are done with it. If a problem occurs, NULL is returned for the layer handle. After creating the layer, use the GM_AddAreaToCustomVectorLayer, GM_AddLineToCustomVectorLayer, and GM_AddPointToCustomVectorLayer functions to add features to the layer.


GM_CropLayerCollar
GM_Error_t32 GM_CropLayerCollar
    (
    GM_LayerHandle_t32      aLayer,         // Layer to crop collar from
    boolean                 aCropCollar     // Crop the collar? (TRUE or FALSE)
    );

The GM_CropLayerCollar function allows users to enable and disable the automatic cropping of the collar off of previously loaded USGS DRG and DOQQ quads.

This function is deprecated. You should use the GM_GetRasterDisplayOptions and GM_SetRasterDisplayOptions functions as they offer the collar cropping option as well as several additional display options.


GM_DeleteFeature
GM_Error_t32 GM_DeleteFeature
    (
    GM_LayerHandle_t32      aLayer,             // IN: Layer the point is in
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    uint32                  aFeatureIndex,      // IN: Index of feature in layer
    boolean                 aDelete             // IN: Use TRUE to mark as deleted, FALSE to clear delete flag
    );

Changes the delete status of the area, line, or point feature at the given index in the layer. Note that "deleting" a feature doesn't actually free it or remove it from the list of features for a layer, it just marks it as deleted and makes it inactive for the purposes of drawing. To re-activate a feature that has been marked as deleted, simply call this with the aDelete value set to FALSE.


GM_DrawGridLines
GM_Error_t32 GM_DrawGridLines
    (
    HDC                     aDC,            // Device context to draw to
    boolean                 aLatLonGrid,    // Draw a lat/lon grid or a view projection grid
    double                  aGridSpacing,   // Grid spacing (use 0.0 for default)
    const GM_Rectangle_t*   aWorldBounds,   // World bounds to draw or NULL for all
    sint32                  aLeftPixel,     // Left pixel coordinate to draw to
    sint32                  aTopPixel,      // Top pixel coordinate to draw to
    sint32                  aPixelWidth,    // Width in pixels to draw
    sint32                  aPixelHeight    // Height in pixels to draw
    );

Draws grid lines (either lat/lon or in the view projection) for the specified location to the provided device context at the given location. If aWorldBounds is not NULL, at least the specified area will be drawn. The aspect ratio of the screen pixels will be maintained, so slightly more of the world bounds than specified may be drawn. If aWorldBounds is NULL, the grid bounds rendered will be that of all loaded layers.


GM_DrawGridLinesEx
GM_Error_t32 GM_DrawGridLinesEx
    (
    HDC                     aDC,            // Device context to draw to
    boolean                 aLatLonGrid,    // Draw a lat/lon grid or a view projection grid
    double                  aGridSpacing,   // Grid spacing (use 0.0 for default)
    const GM_Rectangle_t*   aWorldBounds,   // World bounds to draw or NULL for all
    sint32                  aLeftPixel,     // Left pixel coordinate to draw to
    sint32                  aTopPixel,      // Top pixel coordinate to draw to
    sint32                  aPixelWidth,    // Width in pixels to draw
    sint32                  aPixelHeight,   // Height in pixels to draw
    const GM_Rectangle_t*   aMaxGridBounds  // Maximum grid bounds (NULL for loaded data bounds)
    );

Draws grid lines (either lat/lon or in the view projection) for the specified location to the provided device context at the given location. If aWorldBounds is not NULL, at least the specified area will be drawn. The aspect ratio of the screen pixels will be maintained, so slightly more of the world bounds than specified may be drawn. If aWorldBounds is NULL, the grid bounds rendered will be that of all loaded layers.

If aMaxGridBounds is specified the grid lines will be allowed to draw anywhere within the value specified. Otherwise, the grid lines will be clamped at the bounds of all loaded data.


GM_DrawLayer
GM_Error_t32 GM_DrawLayer
    (
    HDC                     aDC,            // Device context to draw to
    GM_LayerHandle_t32      aLayer,         // Layer to draw or NULL for all
    const GM_Rectangle_t*   aWorldBounds,   // World bounds to draw or NULL for all
    sint32                  aLeftPixel,     // Left pixel coordinate to draw to
    sint32                  aTopPixel,      // Top pixel coordinate to draw to
    sint32                  aPixelWidth,    // Width in pixels to draw
    sint32                  aPixelHeight    // Height in pixels to draw
    );

Draws one or more layers to the provided device context at the given location. If aWorldBounds is not NULL, at least the specified area will be drawn. The aspect ratio of the screen pixels will be maintained, so slightly more of the world bounds than specified may be drawn. If aWorldBounds is NULL, the entire specified layer or all of the loaded layers will be rendered.


GM_DrawLayerList
GM_Error_t32 GM_DrawLayerList
    (
    HDC                     aDC,            // Device context to draw to
    GM_LayerHandle_t32*     aLayerList,     // List of layers to draw or NULL for all
    uint32                  aLayerCount,    // Number of layers in list (0 for all)
    GM_DrawFlags_t32        aDrawFlags,     // Flags controlling how the draw is performed
    const GM_Rectangle_t*   aWorldBounds,   // World bounds to draw or NULL for all
    sint32                  aLeftPixel,     // Left pixel coordinate to draw to
    sint32                  aTopPixel,      // Top pixel coordinate to draw to
    sint32                  aPixelWidth,    // Width in pixels to draw
    sint32                  aPixelHeight    // Height in pixels to draw
    );

Draws one or more layers to the provided device context at the given location. If aWorldBounds is not NULL, at least the specified area will be drawn. The aspect ratio of the screen pixels will be maintained, so slightly more of the world bounds than specified may be drawn. If aWorldBounds is NULL, the entire specified layer or all of the loaded layers will be rendered.


GM_DrawLayerListToMemory
GM_Error_t32 GM_DrawLayerListToMemory
    ( 
    GM_LayerHandle_t32*     aLayerList,     // List of layers to draw or NULL for all
    uint32                  aLayerCount,    // Number of layers in list (0 for all)
    GM_DrawFlags_t32        aDrawFlags,     // Flags controlling how the draw is performed
    const GM_Rectangle_t*   aWorldBounds,   // World bounds to draw or NULL for all
    GM_ColorFormat_t32      aColorFormat,   // Color format used in data buffer
    sint32                  aPixelWidth,    // Width in pixels to draw
    sint32                  aPixelHeight,   // Height in pixels to draw
    void*                   aDataBuf,       // Buffer to hold output color data
    sint32                  aRowWidthBytes  // Width of a single row in the array in bytes
    );

Draws one or more layers to the provided memory buffer at the given location. If aWorldBounds is not NULL, at least the specified area will be drawn. The aspect ratio of the screen pixels will be maintained, so slightly more of the world bounds than specified may be drawn. If aWorldBounds is NULL, the entire specified layer or all of the loaded layers will be rendered.


GM_DrawPackageList
GM_Error_t32 GM_DrawPackageList
    (
    HDC                     aDC,            // Device context to draw to
    GM_PackageHandle_t32*   aPackageList,   // List of packages to draw or NULL for all
    uint32                  aPackageCount,  // Number of packages in list (0 for all)
    GM_DrawFlags_t32        aDrawFlags,     // Flags controlling how the draw is performed
    const GM_Rectangle_t*   aWorldBounds,   // World bounds to draw or NULL for all
    sint32                  aLeftPixel,     // Left pixel coordinate to draw to
    sint32                  aTopPixel,      // Top pixel coordinate to draw to
    sint32                  aPixelWidth,    // Width in pixels to draw
    sint32                  aPixelHeight    // Height in pixels to draw
    );

Draws the specified portion of the specified packages to the device context. If no packages are explicitly specified, all packages loaded with the GM_LoadPackage function will be drawn.


GM_ExportElevation
GM_Error_t32 GM_ExportElevation
    (
    const char*                     aFilename,      // Name of new file to create
    GM_ElevationExportFormat_t32    aFormat,        // Format to export
    GM_LayerHandle_t32              aLayer,         // Layer to export or NULL for all
    const GM_Rectangle_t*           aWorldBounds,   // World bounds to export or NULL for all
    sint32                          aPixelWidth,    // Width in samples of new image
    sint32                          aPixelHeight,   // Height in samples of new image
    GM_RasterExportFlags_t32        aFlags,         // Export flags
    GM_ElevUnits_t8                 aElevUnits      // Elevation units for export, if applicable
    );

Exports one or more layers to a new gridded elevation file. If NULL is passed for the layer handle, all elevation layers will be saved to the new elevation file, otherwise only the specified layer will be exported. If NULL is provided for the world bounds, all available data will be exported, otherwise only data within the specified bounds will be exported.

The new elevation file create will be in the current view projection as returned by the GM_GetProjection function. You can change the view projection, and thus the export projection, by calling the GM_SetProjection function.


GM_ExportPackage
GM_Error_t32 __stdcall GM_ExportPackage
    (
    const char*                 aFilename,      // Name of new file to create
    GM_LayerHandle_t32*         aLayerList,     // List of layers to export or NULL for all
    uint32                      aLayerCount,    // Number of layers in list (0 for all)
    const GM_Rectangle_t*       aWorldBounds,   // World bounds to export or NULL for all
    double                      aSimpThreshold, // Simplification threshold, use 0.0 for no simplification
    GM_PackageExportFlags_t32   aFlags          // Export flags
    );

Exports one or more layers to a new Global Mapper package file. If NULL is passed for the layer list handle, all loaded layers will be saved to the new package file, otherwise only the specified layer(s) will be exported. If NULL is provided for the world bounds, the entirety of each layer will be exported, otherwise only data within the specified bounds will be exported.


GM_ExportRaster
GM_Error_t32 GM_ExportRaster
    (
    const char*                 aFilename,      // Name of new file to create
    GM_RasterExportFormat_t32   aFormat,        // Format to export
    GM_LayerHandle_t32          aLayer,         // Layer to export or NULL for all
    const GM_Rectangle_t*       aWorldBounds,   // World bounds to export or NULL for all
    sint32                      aPixelWidth,    // Width in pixels of new image
    sint32                      aPixelHeight,   // Height in pixels of new image
    GM_RasterExportFlags_t32    aFlags          // Export flags
    );

Exports one or more layers to a new raster file. If NULL is passed for the layer handle, all loaded layers will be saved to the new raster file, otherwise only the specified layer will be exported. If NULL is provided for the world bounds, all available data will be exported, otherwise only data within the specified bounds will be exported.

The new raster file create will be in the current view projection as returned by the GM_GetProjection function. You can change the view projection, and thus the export projection, by calling the GM_SetProjection function.


GM_ExportRasterEx
GM_Error_t32 __stdcall GM_ExportRasterEx
    (
    const char*                 aFilename,      // Name of new file to create
    GM_RasterExportFormat_t32   aFormat,        // Format to export
    GM_LayerHandle_t32*         aLayerList,     // List of layers to export or NULL for all
    uint32                      aLayerCount,    // Number of layers in list (0 for all)
    const GM_Rectangle_t*       aWorldBounds,   // World bounds to export or NULL for all
    sint32                      aPixelWidth,    // Width in pixels of new image
    sint32                      aPixelHeight,   // Height in pixels of new image
    GM_RasterExportFlags_t32    aFlags,         // Export flags
    const char*                 aExtraFlags     // Additional text-based flags for some formats (use NULL for defaults)
    )

Exports one or more layers to a new raster file. If NULL is passed for the layer handle, all loaded layers will be saved to the new raster file, otherwise only the specified layer(s) will be exported. If NULL is provided for the world bounds, all available data will be exported, otherwise only data within the specified bounds will be exported.

The new raster file create will be in the current view projection as returned by the GM_GetProjection function. You can change the view projection, and thus the export projection, by calling the GM_SetProjection function.

The aExtraFlags parameter allows the specification of any extra options not supports in the aFlags parameter. The options should be specified with the option name, followed by an equal sign, followed by the option value. Most users will pass NULL for this value unless they need a non-default value for an extra option. Currently the following extra options are supported:


GM_ExportVector
GM_Error_t32 __stdcall GM_ExportVector
    (
    const char*                     aFilename,      // Name of new file to create
    GM_VectorExportFormat_t32       aFormat,        // Format to export
    GM_LayerHandle_t32              aLayer,         // Layer to export or NULL for all
    const GM_Rectangle_t*           aWorldBounds,   // World bounds to export or NULL for all
    GM_VectorExportFlags_t32        aFlags,         // Export flags
    void*                           aFormatOptions  // Format-specific options (NULL for defaults)
    );

Exports one or more layers to a new vector file. If NULL is passed for the layer handle, all vector layers will be saved to the new vector file, otherwise only the specified layer will be exported. If NULL is provided for the world bounds, all available data will be exported, otherwise only data within the specified bounds will be exported.

The new vector file create will be in the current view projection as returned by the GM_GetProjection function. You can change the view projection, and thus the export projection, by calling the GM_SetProjection function.


GM_ExportWebFormat
GM_Error_t32 __stdcall GM_ExportWebFormat
    (
    const char*                     aFilename,      // Name of HTML/XML file to create
    GM_WebExportFormat_t32          aWebFormat,     // Format to export
    GM_LayerHandle_t32*             aLayerList,     // List of layers to export or NULL for all
    uint32                          aLayerCount,    // Number of layers in list (0 for all)
    const GM_Rectangle_t*           aWorldBounds,   // World bounds to export or NULL for all
    const GM_WebFormatExportOpts_t* aExportOpts,    // Export options
    void*                           aReserved       // Reserved for future use, must be NULL
    );

Exports one or more layers to a files to a web format for display in a web browser or other web-based tool. If NULL is passed for the layer handle list, all layers will be saved to the new data set, otherwise only the specified layers will be exported. If NULL is provided for the world bounds, all available data will be exported, otherwise only data within the specified bounds will be exported.


GM_ExportRasterFromBitmap
GM_Error_t32 GM_ExportRasterFromBitmap
    (
    const char*                 aFilename,      // Name of new file to create
    HBITMAP                     aBitmap,        // Handle to bitmap to export
    HDC                         aDC,            // Handle to compatible device context
    GM_RasterExportFormat_t32   aFormat,        // Format to export
    const GM_Rectangle_t*       aWorldBounds,   // World bounds of bitmap or NULL for empty
    GM_RasterExportFlags_t32    aFlags          // Export flags
    );

Generates a new raster image from a bitmap handle. The new raster image will have the same number of pixels as the bitmap. The aFormat parameter specifies what image format to use for the new raster. If aWorldBounds is not NULL, the provided bounds will be used to fill in the spatial information for the new file, if supported by the new file format.


GM_FindNearestAddress
GM_Error_t32 __stdcall GM_FindNearestAddress
    (
    const GM_Point_t*       aSearchPt,          // IN: Search location in current view projection (as returned by GM_SetProjection)
    GM_LayerHandle_t32*     aLayerList,         // IN: List of layers to search or NULL for all vector layers
    uint32                  aLayerCount,        // IN: Number of layers in list (0 for all)
    char*                   aAddressStr,        // I/O: Buffer to hold string for nearest address
    uint32                  aMaxAddressLen,     // IN: Maximum length of string to store in output
    double                  aMaxDistMeters,     // IN: Maximum distance in meters to search around search point
    void*                   aReserved           // IN: Reserved for later use, must be NULL (0)
    );

Searches the provided list of layers for any visible vector line feature within the provided search distance (aMaxDistMeters) which has addressing information in a supported format (i.e. Tiger/Line data).


GM_FindNearestFeatures
GM_Error_t32 __stdcall GM_FindNearestFeatures
    (
    const GM_Point_t*       aPixelSearchPt,     // IN: Search location in pixel coordinates
    GM_LayerHandle_t32*     aLayerList,         // IN: List of layers to search or NULL for all vector layers
    uint32                  aLayerCount,        // IN: Number of layers in list (0 for all)
    GM_FindFlags_t32        aFindFlags,         // IN: Flags controlling how the find is performed
    const GM_Rectangle_t*   aWorldBounds,       // IN: World bounds for search space or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect,         // IN: Pixel bounds for search space or NULL for last drawn 
    GM_FoundFeature_t*      aNearestFeatures,   // OUT: List of nearest features
    uint32                  aMaxFeatures,       // IN: Max number of nearest features to find
    uint32*                 aFoundFeatureCnt,   // OUT: Number of nearest features returned in list
    uint32                  aMaxDistPixels      // IN: Max distance in pixels to search
    );

Searches the provided list of layers for any visible vector features within the provided search distance (aMaxDistPixels) of the pixel search location (aPixelSearchPt). The aFindFlags parameter specifies what types of features to search on.


GM_FlushLayerCache
GM_Error_t32 __stdcall GM_FlushLayerCache
    ( 
    GM_LayerHandle_t32  aLayer
    )

Flushes any in-memory cache for the layer. This is mainly useful in low-memory environments like Windows CE and typically only does anything for raster formats like GeoTIFF files. Most users will never need to call this.


GM_FreeAreaFeature
void GM_FreeAreaFeature
    (
    GM_AreaFeature_t*   aAreaFeature            // Area feature to free
    )

Frees the resources used by the given area feature. This should be called on each area feature returned by GM_GetAreaFeature.


GM_FreeLineFeature
void GM_FreeLineFeature
    (
    GM_LineFeature_t*   aLineFeature            // Line feature to free
    )

Frees the resources used by the given line feature. This should be called on each line feature returned by GM_GetLineFeature.


GM_FreePointFeature
void GM_FreePointFeature
    (
    GM_PointFeature_t*	aPointFeature			// Point feature to free
    )

Frees the resources used by the given point feature. This should be called on each point feature returned by GM_GetPointFeature.


GM_GenerateContours
GM_Error_t32 GM_GenerateContours
    (
    GM_LayerHandle_t32          aLayer,         // IN: Layer to get elevations from or NULL for topmost layer at each point
    const GM_ContourParams_t*   aContourParms,  // IN: Parameters for generating contours
    GM_LayerHandle_t32*         aContourLayer   // OUT: Created contour layer
    );

Generates contours from loaded elevation data and creates a new vector layer with the results. The layer handle returned in aContourLayer must be closed with GM_CloseLayer when you are done with it.

See the definition of the GM_ContourParams_t type in the GlobalMapperInterface.h header file for a description of what options are available when generating the contour lines, iso-height areas, and/or min/max spot elevations.


GM_GenerateElevationGrid
GM_Error_t32 __stdcall GM_GenerateElevationGrid
    (
    GM_LayerHandle_t32*         aLayerList,     // IN: List of layers to use or NULL for all
    uint32                      aLayerCount,    // IN: Number of layers in list (0 for all)
    const GM_GridGenSetup_t*    aGridSetup,     // IN: Grid setup parameters (pass NULL for default options)
    GM_LayerHandle_t32*         aGridLayer,     // OUT: Created grid layer
    GM_LayerHandle_t32*         aTinLayer       // OUT: Created TIN area layer (optional, set to NULL if you don't want)
    );

Generates an elevation grid and optionally a 3D area TIN layer from loaded 3D vector data. The layer handle(s) returned in aGridLayer and (optionally) aTinLayer must be closed with GM_CloseLayer when you are done with them.

See the definition of the GM_GridGenSetup_t type in the GlobalMapperInterface.h header file for a description of what options are available when generating the elevation grid. The default options are all a value of zero, or you can just pass NULL for the aGridSetup parameter to get the default options.


GM_GetAreaFeature
GM_AreaFeature_t* GM_GetAreaFeature
    (
    GM_LayerHandle_t32  aLayer,                 // Layer to get area from
    uint32              aAreaIndex              // Index of area feature to retrieve
    )

Returns the area feature at the given index in the layer. Returns NULL if the layer does not contain an area at the given index or if a registration key was not found and aAreaIndex was greater than GM_MAX_NON_REGISTERED_VECTOR_IDX.

Any features returned from this function must be freed using a call to GM_FreeAreaFeature when you are done accessing the the feature.


GM_GetAreaFeatureClassDrawStyle
GM_Error_t32 GM_GetAreaFeatureClassDrawStyle
    (
    AreaFeatureClass_t16    aFeatureClass,      // IN: Feature class to get draw style for
    GM_AreaStyle_t*         aAreaStyle          // OUT: Current draw style for area classification
    );

Sets the default drawing style to use for a given area feature classification.


GM_GetAvailableProjectionList
const GM_ProjectionInfo_t* __stdcall GM_GetAvailableProjectionList
    (
    uint32*             aProjCnt        // OUT: Number of projections returned in list
    )

Retrieves a list of all available projections and their available parameters, datums, units, etc, including the names of said values. The number of entries in the returned area will be returned in the aProjCnt parameter. The returned pointer will remain valid for the remainder of the program operation or until this function is called again, at which time a new pointer may be returned.


GM_GetAvailableSymbolNames
char** __stdcall GM_GetAvailableSymbolNames
    (
    uint32* aNumSymbols                         // OUT: Number of symbols in returned list
    );

Returns the list of available symbol names. This will be an array of const char* values. The number of entries in the returned area will be returned in the aNumSymbols parameter. The symbol name list is also NULL-terminated if you don't want to keep track of the size of the list separately.


GM_GetElevationOverrides
GM_Error_t32 __stdcall GM_GetElevationOverrides
    (
    GM_LayerHandle_t32          aLayer,     // in: layer to get options for
    GM_ElevationOverrides_t*    aOptions    // out: elevation adjustments
    );

Retrieves the elevation adjustment options that are currently being applied to a given elevation layer.


GM_GetFeatureClassInfo
GM_Error_t32 GM_GetFeatureClassInfo
    (
    FeatureClass_t16        aFeatureClass,      // IN: Feature class to get info for
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    GM_FeatureClassInfo_t*  aFeatureClassInfo   // OUT: Info about the feature class
    )

Retrieves information about the given feature class.


GM_GetFilterString
GM_DLL_EXPORTED const char* GM_GetFilterString
    (
    void
    );

Returns a const pointer to a string containing the filter for all of the types supported by this DLL. This filter string can be used as input to the standard Windows open file dialog.


GM_GetLastDrawnScale
double GM_GetLastDrawnScale
    (
    HDC                     aDC             // Device context that was drawn to
    );

Returns the last drawn scale (i.e. the XXXX portion of 1:XXXX). If nothing has been drawn, 0.0 is returned.


GM_GetLayerInfo
const GM_LayerInfo_t* GM_GetLayerInfo
    (
    GM_LayerHandle_t32    aLayer
    );

Retrieves information about the given layer. If the layer is not loaded, NULL is returned. Otherwise, a const pointer to the layer metadata is returned. See the GM_LayerInfo_t definition in the header file for details.


GM_GetLineFeature
GM_LineFeature_t* GM_GetLineFeature
    (
    GM_LayerHandle_t32  aLayer,                 // Layer to get line from
    uint32              aLineIndex              // Index of line feature to retrieve
    )

Returns the line feature at the given index in the layer. Returns NULL if the layer does not contain a line at the given index or if a registration key was not found and aLineIndex was greater than GM_MAX_NON_REGISTERED_VECTOR_IDX.

Any features returned from this function must be freed using a call to GM_FreeLineFeature when you are done accessing the the feature.


GM_GetLineFeatureClassDrawStyle
GM_Error_t32 GM_GetLineFeatureClassDrawStyle
    (
    LineFeatureClass_t16    aFeatureClass,      // IN: Feature class to get draw style for
    GM_LineStyle_t*         aLineStyle          // OUT: Current draw style for line classification
    );

Sets the default drawing style to use for a given line feature classification.


GM_GetLocationColor
GM_DLL_EXPORTED GM_Error_t32 GM_GetLocationColor
    (
    GM_LayerHandle_t32      aLayer,     // IN: Layer to get color from or NULL for topmost
    double                  aXCoord,    // IN: X coord in current projection
    double                  aYCoord,    // IN: Y coord in current projection
    GM_Color_t*             aColor      // OUT: Color of pixel at location    
    );

Retrieves the color at a given location from a provided layer or from the list of currently loaded raster and elevation layers (topmost layer first).


GM_GetLocationElevation
GM_DLL_EXPORTED GM_Error_t32 GM_GetLocationElevation
    (
    GM_LayerHandle_t32      aLayer,     // IN: Layer to get elevation from or NULL for topmost
    double                  aXCoord,    // IN: X coord in current projection
    double                  aYCoord,    // IN: Y coord in current projection
    float*                  aElev       // OUT: Elevation at location in meters
    );

Retrieves the elevation at a given location from a provided layer or from the list of currently loaded elevation layers (topmost elevation layer first).


GM_GetPackageLayerList
GM_LayerHandle_t32* GM_GetPackageLayerList
    (
    GM_PackageHandle_t32    aPackage,   // IN: package to get list of layers from
    uint32*                 aLayerCount // OUT: Number of layers in returned list
    );

Returns a list of the layers that are in a given package. The pointer returned is temporary and will become invalid with the next call to this function. The package must have been opened with the GM_LoadPackage function.


GM_GetPathProfile
GM_DLL_EXPORTED GM_Error_t32 GM_GetPathProfile
    (
    GM_LayerHandle_t32      aLayer,     // IN: Layer to get elevation from or NULL for topmost
    double                  aStartX,    // IN: Start X coord in current projection
    double                  aStartY,    // IN: Start Y coord in current projection
    double                  aEndX,      // IN: End X coord in current projection
    double                  aEndY,      // IN: End Y coord in current projection
    float*                  aElevList,  // OUT: Buffer to hold list of elevations
    uint32                  aListSize,  // IN: Number of elevations to retrieve
    float                   aDfltElev   // IN: Elev to use when none could be found
    );

Retrieves a list of elevations along a path in the provided layer or from the list of currently loaded elevation layers (topmost elevation layer first).


GM_GetPathProfileLOS
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_GetPathProfileLOS
    (
    GM_LayerHandle_t32          aLayer, // IN: Layer to get elevation from or NULL for topmost
    GM_PathProfileLOSParams_t*  aParams // IN/OUT: Calculation parameters
    );

Retrieves a list of elevations along a path in the provided layer or from the list of currently loaded elevation layers (topmost elevation layer first). Can also perform a line-of-sight calculation and return additional information about a 3D path.


GM_GetPixelColor
GM_DLL_EXPORTED GM_Error_t32 GM_GetPixelColor
    (
    GM_LayerHandle_t32      aLayer,     // IN: Layer to get color from or NULL for topmost
    sint32                  aRow,       // IN: Y coord of pixel (0 is topmost)
    sint32                  aCol,       // IN: X coord of pixel (0 is leftmost)
    GM_Color_t*             aColor      // OUT: Color of pixel at location    
    );

Retrieves the color at a given pixel location from the provided raster layer. If the layer does not contain a valid color value at the provided pixel location (i.e. it is a "no data" or transparent value), GM_Error_NoDataAtLocation will be returned.


GM_GetPixelElevation
GM_DLL_EXPORTED GM_Error_t32 GM_GetPixelElevation
    (
    GM_LayerHandle_t32      aLayer,     // IN: Layer to get elevation from or NULL for topmost
    sint32                  aRow,       // IN: Y coord of pixel (0 is topmost)
    sint32                  aCol,       // IN: X coord of pixel (0 is leftmost)
    float*                  aElev       // OUT: Elevation at location in meters
    );

Retrieves the elevation at a given pixel location from a provided elevation layer. If the layer does not contain a valid elevation sample at the provided pixel location (i.e. it is a "no data" value), GM_Error_NoDataAtLocation will be returned.


GM_GetPointFeature
GM_PointFeature_t* GM_GetPointFeature
    (
    GM_LayerHandle_t32  aLayer,                 // Layer to get point from
    uint32              aPointIndex             // Index of point feature to retrieve
    )

Returns the point feature at the given index in the layer. Returns NULL if the layer does not contain an point at the given index or if a registration key was not found and aPointIndex was greater than GM_MAX_NON_REGISTERED_VECTOR_IDX.

Any features returned from this function must be freed using a call to GM_FreePointFeature when you are done accessing the the feature.


GM_GetPointFeatureClassDrawStyle
GM_Error_t32 GM_GetPointFeatureClassDrawStyle
    (
    PointFeatureClass_t16	aFeatureClass,      // IN: Feature class to get draw style for
    GM_PointStyle_t*        aPointStyle         // OUT: Current draw style for point classification
    );

Sets the default drawing style to use for a given point feature classification.


GM_GetProjection
GM_Error_t32 GM_GetProjection
    (
    GM_Projection_t*    aProj           // OUT: Current view/export projection
    );

Retrieves the global projection that is being used for all rendering and exporting.


GM_GetRasterDisplayOptions
GM_Error_t32 GM_GetRasterDisplayOptions
    (
    GM_LayerHandle_t32          aLayer,     // in: layer to get options for
    GM_RasterDisplayOptions_t*  aOptions    // out: display options for raster layer
    );

Retrieves the options that are used when displaying the given raster layer. This includes things like the translucency and transparency (if any) of the layer, the color intensity of the layer, and whether or not to crop the collar of the layer.


GM_GetSDKBuildDate
GM_DLL_EXPORTED time_t __stdcall GM_GetSDKBuildDate
    (
    void
    )

Returns the date that this SDK was built. Use this to provide more resolution for beta releases than GM_GetSDKVersion provides.


GM_GetSDKVersion
uint32 GM_GetSDKVersion
    (
    void
    );

Returns the version of this SDK. The version is obtained by taking the major version number times 100 and adding the minor version number. For example, version 1.04 would be returned as 104.


GM_GetShaderDisplayOptions
const GM_ShaderOptions_t* GM_GetShaderDisplayOptions
    (
    void
    );

Returns a pointer to the current shader display options that are used when rendering gridded elevation data. The returned pointer is temporary and should be copied if it will be used for an extended period of time on the client side.


GM_GetVerticalDisplayOptions
const GM_VerticalDisplayOptions_t* GM_GetVerticalDisplayOptions
    (
    void
    );

Returns a pointer to the current vertical display options that are used when rendering gridded elevation data. The returned pointer is temporary and should be copied if it will be used for an extended period of time on the client side.


GM_GPSGetAltitude
GM_Error_t32 GM_GPSGetAltitude
    (
    float*                  aAltitude       // out: current GPS altitude in meters
    );

Retrieves the current GPS altitude value in meters. Will return GM_Error_GPSDataNotValid if there if a GPS device is not being tracked with a 3D fix.


GM_GPSGetBearing
GM_Error_t32 GM_GPSGetBearing
    (
    float*                  aBearing        // out: current GPS bearing in radians from due north
    );

Retrieves the current GPS bearing value. Will return GM_Error_GPSDataNotValid if there if either we are not tracking a GPS device or the bearing is not known.


GM_GPSGetFixInfo
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_GPSGetFixInfo
    (
    float*                  aHorzPosError,  // out: current horizontal position error in meters (0.0 if unknown)
    float*                  aVertPosError,  // out: current vertical position error in meters (0.0 if unknown)
    float*                  aPDOP,          // out: current position DOP in meters (0.0 if unknown)
    uint32*                 aNumSats        // out: number of satellites used in fix (0 if unknown)
    );

Retrieves the current GPS fix accuracy statistics.


GM_GPSGetFixType
GM_gps_fix_t8 GM_GPSGetFixType
    (
    void
    );

Returns the current GPS fix type.


GM_GPSGetLocation
GM_Error_t32 GM_GPSGetLocation
    (
    GM_Point_t*             aCurPos,        // out: current GPS location
    boolean                 aGetLatLon      // in: retrieve coordinates in lat/lon/WGS84 rather than global coords
    );

Retrieves the current GPS location value. Will return GM_Error_GPSDataNotValid if there we are not tracking a GPS device or we do not have a position fix.

If aGetLatLon is TRUE, the position returned will be in decimal degrees latitude and longitude in the WGS84 datum. If aGetLatLon is FALSE, the position will be returned in the current global coordinate system, as returned by GM_GetProjection and modified by GM_SetProjection.


GM_GPSGetTime
GM_Error_t32 __stdcall GM_GPSGetTime
    (
    time_t*                 aFixTime
    );

Retrieves the UTC time of the last GPS fix, Will return GM_Error_GPSDataNotValid if there if either we are not tracking a GPS device or the time is not known.


GM_GPSGetVelocity
GM_Error_t32 GM_GPSGetVelocity
    (
    float*                  aVelocity       // out: current GPS velocity in m/s
    );

Retrieves the current GPS velocity value in meters/second. Will return GM_Error_GPSDataNotValid if there if either we are not tracking a GPS device or the velocity is not known.


GM_GPSRenderVessel
GM_Error_t32 GM_GPSRenderVessel
    (
    HDC                     aDC,            // Device context to draw to
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect,     // IN: Pixel bounds to convert from or NULL for last drawn 
    uint32                  aVesselHeight,  // IN: The vessel height in pixels
    uint32                  aVesselWidth,   // IN: The vessel width in pixels
    COLORREF                aVesselColor    // IN: The color to render the vessel in
    );

Renders a GPS vessel to the provided device context at the current GPS location.


GM_GPSStartTrackingSerial
GM_Error_t32 GM_GPSStartTrackingSerial
    ( 
    GM_gps_format_t8        aFormat,        // format (NMEA or Garmin)
    uint8                   aPort,          // COM port for serial connections
    uint32                  aBaud,          // baud rate for serial port
    GM_GPSCallbackFunc      aCallbackFunc,  // optional callback function
    uint32                  aReserved       // 32-bit reserved value (must be 0)
    );

Starts tracking a GPS device connected to a serial port. The GPS will actually be tracked on a background thread, so this function will return quickly and possibly before a connection is established.

If a callback function is provided, it will be called on the GPS thread whenever new GPS locations are received and when the GPS tracking state changes.

If you provide a format value of GPS_FORMAT_AUTODETECT, a GPS connection will automatically be checked for on connected serial and USB devices.


GPS_StartTrackingUSB
GM_Error_t32 GM_GPSStartTrackingUSB
    ( 
    GM_GPSCallbackFunc      aCallbackFunc,  // optional callback function
    uint32                  aReserved       // 32-bit reserved value (must be 0)
    );

Starts tracking a GPS device connected to a USB port. The GPS will actually be tracked on a background thread, so this function will return quickly and possibly before a connection is established.

If a callback function is provided, it will be called on the GPS thread whenever new GPS locations are received and when the GPS tracking state changes.

NOTE: Currently only Garmin USB devices are supported.


GM_GPSStopTracking
GM_Error_t32 GM_GPSStopTracking
    (
    void
    );

Stops tracking any currently connected GPS device.


GM_IsFeatureDeleted
GM_Error_t32 __stdcall GM_IsFeatureDeleted
    (
    GM_LayerHandle_t32      aLayer,             // IN: Layer the point is in
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    uint32                  aFeatureIndex,      // IN: Index of feature in layer
    boolean*                aIsDeleted          // OUT: Returns TRUE if marked as deleted, FALSE if not
    )

Queries the delete status of the area, line, or point feature at the given index in the layer. Use the GM_DeleteFeature function to change the delete status of a feature.


GM_LoadGenericAsciiTextLayer
GM_Error_t32 GM_LoadGenericAsciiTextLayer
    ( 
    const char*                 aFilename,  // IN: filename of ASCII file to load
    GM_LayerHandle_t32*         aLayer,     // OUT: layer handle for loaded layer
    GM_LoadFlags_t32            aLoadFlags, // IN: load flags
    const GM_AsciiFormatInfo_t* aFormatInfo,// IN: optional format info (use NULL to prompt user)
    const GM_Projection_t*      aProj       // IN: optional projection to use for file (use NULL to prompt user)
    );

Loads the given ASCII text file and fills in aLayer with the handle to the layer. The layer handle can be used in other calls into the library. The layer must be closed by calling GM_CloseLayer when the caller is done using it.

The format of the ASCII text file being loaded is described with the aFormatInfo structure provided. If NULL is passed for that structure, a dialog will appear prompting the user for the layout information.


GM_LoadLayer
GM_Error_t32 GM_LoadLayer
    ( 
    const char*         aFilename,
    GM_LayerHandle_t32* aLayer,
    GM_LoadFlags_t32    aLoadFlags
    );

Loads the given file and fills in aLayer with the handle to the layer. The layer handle can be used in other calls into the library. The layer must be closed by calling GM_CloseLayer when the caller is done using it.

This function is deprecated. You should use GM_LoadLayerList as it supports multiple layers being loaded from a single file (this is common with archive files like .zip and .tar.gz as well as multi-map formats like CADRG).


GM_LoadLayerList
GM_Error_t32 GM_LoadLayerList
    ( 
    const char*             aFilename,
    GM_LayerHandle_t32**    aLayerList,
    uint32*                 aNumLoadedLayers,
    GM_LoadFlags_t32        aLoadFlags
    );

Loads the given file and fills in aLayerList with a pointer to a list of layer handles. The number of layers returned in the list is placed in aNumLoadedLayers.

The layer handles can be used in other calls into the library. Each layer handle must be closed by calling GM_CloseLayer when the caller is done using it.

Note that the pointer returned in aLayerList is a temporary pointer that will be invalidated the next time that GM_LoadLayerList is called. The layer handles should be copied out of the returned layer list into local storage of some kind.


GM_LoadLayerListEx
GM_Error_t32 GM_LoadLayerListEx
    ( 
    const char*             aFilename,
    GM_LayerHandle_t32**    aLayerList,
    uint32*                 aNumLoadedLayers,
    GM_LoadFlags_t32        aLoadFlags,
    const char*             aExtraLoadOptions
    );

Loads the given file and fills in aLayerList with a pointer to a list of layer handles. The number of layers returned in the list is placed in aNumLoadedLayers.

The layer handles can be used in other calls into the library. Each layer handle must be closed by calling GM_CloseLayer when the caller is done using it.

Note that the pointer returned in aLayerList is a temporary pointer that will be invalidated the next time that GM_LoadLayerList is called. The layer handles should be copied out of the returned layer list into local storage of some kind.

The aExtraLoadOptions value allows you to provide a string containing additional type-specific load options to the load operation. The formats supported for the various import types are specified below.

Supported Extra Load Options
GM_LoadPackage
GM_Error_t32 GM_LoadPackage
    ( 
    const char*             aFilename,
    GM_PackageHandle_t32*   aPackage,
    GM_LoadFlags_t32        aLoadFlags
    );

Loads a new Global Mapper package (.gmp) file. You can also load package files with the GM_LoadLayerList command if you don't need to operate on the package as a whole.

A handle to the package is returned in aPackage. This package handle can be used in package-specific routines like GM_DrawPackageList. Each package handle must be closed by calling GM_ClosePackage when the caller is done using it.


GM_LoadProjectionFile
GM_Error_t32 __stdcall GM_LoadProjectionFile
    (
    const char*             aFilename,  // filename of projection file to load
    GM_Projection_t*        aProj       // buffer in which to place decoded projection.
    );

Initializes a GM_Projection_t structure from a projection (PRJ, Ozi .map, etc.) file.


GM_LoadProjectionFromEPSGCode
GM_Error_t32 __stdcall GM_LoadProjectionFromEPSGCode
    (
    uint32                  aEpsgCode,  // IN: EPSG code to get projection from
    GM_Projection_t*        aProj       // OUT: buffer in which to place decoded projection.
    );

Initializes a GM_Projection_t structure from an EPSG projection code.


GM_LoadRectifiedLayer
GM_DLL_EXPORTED GM_Error_t32 GM_LoadRectifiedLayer
    ( 
    const char*                     aFilename,
    GM_LayerHandle_t32*             aLayer,
    GM_LoadFlags_t32                aLoadFlags,
    const GM_GroundControlPoint_t*  aGCPList,
    uint32                          aNumGCPs,
    const GM_Projection_t*          aProj
    );

Loads the given file and fills in aLayer with the handle to the layer. The layer handle can be used in other calls into the library. The layer must be closed by calling GM_CloseLayer when the caller is done using it.

The layer will be positioned according to the ground control point (GCP) list provided. The ground coordinates in the GCP list must be given in the projection specified by aProj.


GM_LoadTerraServerLayer
GM_DLL_EXPORTED GM_Error_t32 GM_LoadTerraServerLayer
    (
    const char*             aThemeName, // in: name of the theme to load ("drg", "doq", etc.) or NULL to ask user
    const GM_Rectangle_t*   aLatLonRect,// in: lat/lon rect to import (NULL to ask user)
    GM_LayerHandle_t32*     aLayer      // out: handle to loaded TerraServer layer
    );

Loads data from the TerraServer, including DRG, DOQ, and urban area imagery. If either the aThemeName or aLatLonRect values are NULL, a dialog will be displayed asking the user which theme and bounds to load.

Valid theme names are as follows:

The layer handle returned in aLayer must be freed with a call to GM_CloseLayer when the caller is done using it.


GM_MapCatalogAddFile
GM_Error_t32 GM_MapCatalogAddFile
    (
    GM_LayerHandle_t32      aCatalogLayer,  // IN: Handle to map catalog layer (either from loading or GM_CreateMapCatalog)
    const char*             aFilename       // IN: Filename of map to add to the catalog
    );

Adds a new map to the map catalog from a file on disk. The aCatalogLayer parameter should have either been created using GM_MapCatalogCreate or loaded with one of the GM_LoadLayer* functions.


GM_MapCatalogAddLayer
GM_Error_t32 GM_MapCatalogAddLayer
    (
    GM_LayerHandle_t32      aCatalogLayer,  // IN: Handle to map catalog layer (either from loading or GM_CreateMapCatalog)
    GM_LayerHandle_t32      aMapLayer       // IN: Handle of loaded map layer to add to the catalog
    );

Adds a new map to the map catalog from a layer that has already been loaded. The aCatalogLayer parameter should have either been created using GM_MapCatalogCreate or loaded with one of the GM_LoadLayer* functions.

Note that the layer provided will remain open as a separate layer as well. If this is not the desired behavior, simply call GM_CloseLayer on the map layer after adding it to the catalog layer.


GM_MapCatalogCreate
GM_LayerHandle_t32 GM_MapCatalogCreate
    (
    const char*             aDescription,   // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*  aProj           // IN: Native projection of new layer (NULL for Geographic/WGS84/Arc Degrees)
    );

Creates a new map catalog layer with the given description and native projection. Once you have created a new map catalog, use the handle returned in calls to GM_MapCatalogAddFile or GM_MapCatalogAddLayer to add new maps to the catalog. Use GM_MapCatalogSave to save the map catalog to a disk file that can later be loaded using any of the GM_LoadLayer* functions.


GM_MapCatalogGetInfo
GM_Error_t32 GM_MapCatalogGetInfo
    (
    GM_LayerHandle_t32      aCatalogLayer,  // IN: Handle to map catalog layer (either from loading or GM_CreateMapCatalog)
    GM_MapCatalogInfo_t*    aCatalogInfo    // OUT: Structure holding catalog information
    );

Retrieves information and statistics about the catalog (use GM_GetLayerInfo for generic information).


GM_MapCatalogGetMapInfo
const GM_LayerInfo_t* GM_MapCatalogGetMapInfo
    (
    GM_LayerHandle_t32      aCatalogLayer,  // IN: Handle to map catalog layer (either from loading or GM_CreateMapCatalog)
    uint32                  aMapIndex       // IN: Index of map (0-based) to get info about
    );

Retrieves information about a map in a catalog (use GM_GetMapCatalogInfo to get the map count). Returns NULL if the catalog is not valid or no map exists in the catalog at the given index. Otherwise, consider the returned pointer temporary. It will become invalid after the next call to this function.


GM_MapCatalogRemoveMap
GM_Error_t32 GM_MapCatalogRemoveMap
    (
    GM_LayerHandle_t32      aCatalogLayer,  // IN: Handle to map catalog layer (either from loading or GM_CreateMapCatalog)
    uint32                  aMapIndex       // IN: Index of map (0-based) to remove from map catalog
    );

Removes the map at the given index from the map catalog.


GM_MapCatalogSave
GM_Error_t32 GM_MapCatalogSave
    (
    GM_LayerHandle_t32      aCatalogLayer,  // IN: Handle to map catalog layer (either from loading or GM_CreateMapCatalog)
    const char*             aFilename       // IN: Filename to save map catalog to
    );

Saves the given map catalog to the given file on disk.


GM_MapCatalogSetDisplayInfo
GM_Error_t32 GM_MapCatalogSetDisplayInfo
    (
    GM_LayerHandle_t32          aCatalogLayer,  // IN: Handle to map catalog layer (either from loading or GM_CreateMapCatalog)
    GM_MapCatalogDisplayType_t8 aDisplayType,   // IN: Controls when layers in catalog are displayed
    double                      aDisplayValue,  // IN: First value related to display type
    double                      aDisplayValue2, // IN: Optional econd value for range of scales (use 0.0 if doesn't apply)
    boolean                     aHideBounds     // IN: Hide layer bounds when not drawing a layer?
    );

Sets when the layers in a map catalog should be displayed. The aDisplayValue and aDisplayValue2 parameters have the following meanings based on the value of aDisplayType:


GM_ProjectionGetBase
GM_Error_t32 GM_ProjectionGetBase
    (
    const GM_Projection_t*  aProjIn,    // IN: projection to convert from (NULL for current)
    GM_Projection_t*        aProjBase   // OUT: projection on which the input projection is based
    );

Retrieves the underlying base projection that forms the basis for a given projection. For example, the underlying Transverse Mercator projection will be returned for a UTM projection. For core projections, like Transverse Mercator, the output will just match the input.


GM_ProjectPoint
GM_Error_t32 GM_ProjectPoint
    (
    double                  aXIn,       // IN: X coordinate of input point
    double                  aYIn,       // IN: Y coordinate of input point
    double*                 aXOut,      // OUT: X coordinate of output point
    double*                 aYOut,      // OUT: Y coordinate of output point
    const GM_Projection_t*  aProjIn,    // IN: projection to convert from (NULL for current)
    const GM_Projection_t*  aProjOut    // IN: projection to convert to (NULL for current)
    );

This function projects a point from one coordinate system to another. If NULL is passed for either projection parameter, the current view/export projection will be used. This function provides an easy way to convert from latitude/longitude coordinates (or coordinates in any other supported projection) to any other projection, including the current view projection.

For examples on how to set up projection definitions, see the documentation for the GM_SetProjection function.


GM_ProjectRectangle
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_ProjectRectangle
    (
    const GM_Rectangle_t*   aRectIn,    // IN: Rectangle to convert in input projection
    GM_Rectangle_t*         aRectOut,   // OUT: Rectangle in output projection
    const GM_Projection_t*  aProjIn,    // IN: projection to convert from (NULL for current)
    const GM_Projection_t*  aProjOut    // IN: projection to convert to (NULL for current)
    );

Projects a rectangle from one coordinate system to another. If NULL is passed for either projection parameter, the current view projection will be used.

Note that this should be used rather than simply calling GM_ProjectPoint on the corners of a rectangle because many rectangles will NOT be rectangular in other projections, resulting in min/max values along on edge, or in some cases, like polar stereographic, the min/max values may be interior to the rectangle.

For examples on how to set up projection definitions, see the documentation for the GM_SetProjection function.


GM_RepositionLayer
GM_DLL_EXPORTED GM_Error_t32 GM_RepositionLayer
    ( 
    GM_LayerHandle_t32              aLayer,
    const GM_GroundControlPoint_t*  aGCPList,
    uint32                          aNumGCPs,
    const GM_Projection_t*          aProj
    );

Repositions/reprojects the given layer.

The layer will be positioned according to the ground control point (GCP) list provided. The ground coordinates in the GCP list must be given in the projection specified by aProj. If you just want to change the native projection of the layer, provide NULL for the aGCPList parameter and provide the new native projection with the aProj parameter.


GM_SaveProjectionToFile
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_SaveProjectionToFile
    (
    const char*             aFilename,  // filename of projection file to save to
    const GM_Projection_t*  aProj,      // projection to save
    uint32                  aReserved   // reserved for future use, must be 0
    );

Saves a GM_Projection_t structure to a projection (PRJ) file.


GM_SelectAreaStyle
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_SelectAreaStyle
    (
    GM_AreaStyle_t* aAreaStyle	// IN/OUT: Area style buffer - make sure to initialize before passing in
    );

Displays a dialog allowing the user to graphically select an area style.


GM_SelectFile
GM_Error_t32 GM_SelectFile
    ( 
    char*       aFilename,  // buffer in which to place selected filename (must be at least _MAX_PATH characters in length)
    const char* aFilterStr, // filter string for open dialog (NULL for default)
    const char* aInitialDir,// initial directory to start in (NULL for current)
    HWND        aParentWnd  // handle to parent window for file selection dialog
    );

Displays a file dialog that allows the user to select a file to load.


GM_SelectLineStyle
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_SelectLineStyle
    (
    GM_LineStyle_t* aLineStyle	// IN/OUT: Line style buffer - make sure to initialize before passing in
    );

Displays a dialog allowing the user to graphically select a line style.


GM_SelectProjection
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_SelectProjection
    (
    GM_Projection_t*        aSelProj,   // out: projection selected by user
    const GM_Projection_t*  aInitProj   // in: initial projection to use (NULL for default)
    );

Displays the projection selection dialog to allow the user to select a projection. If aInitProj is provided, the projection dialog is initialized to that projection.


GM_SelectProjectionEx
GM_Error_t32 __stdcall GM_SelectProjectionEx
    (
    GM_Projection_t*        aSelProj,   // out: projection selected by user
    const GM_Projection_t*  aInitProj,  // in: initial projection to use (NULL for default)
    const POINT*            aDlgPos,    // in: position of top left corner (in screen coordinates) for projection dialog (NULL for default)
    GM_SelectProjFlags_t32  aFlags,     // in: additional flags for projection selection
    void*                   aReserved   // in: reserved for future use (must be NULL)
    )

Displays the projection selection dialog to allow the user to select a projection. If aInitProj is provided, the projection dialog is initialized to that projection. The caller can also optionally provide an initial location for the projection dialog on the screen as well as flags controlling the selection of the projection.


GM_SetAreaFeatureClassDrawStyle
GM_Error_t32 GM_SetAreaFeatureClassDrawStyle
    (
    AreaFeatureClass_t16    aFeatureClass,      // IN: Feature class to set draw style for
    const GM_AreaStyle_t*   aAreaStyle          // IN: New style to use for area (NULL to reset to default)
    );

Sets the default style and font to use for drawing areas with the given area classification. Pass NULL for the area style to reset the default drawing style to the default style for that classification of area.

Typically, when modifying the drawing style of a area class you'll want to call GM_GetAreaFeatureClassDrawStyle to get the current drawing style, then just change what you need, then pass your copy in to this function.


GM_SetAreaFeatureDrawStyle
GM_Error_t32 GM_SetAreaFeatureDrawStyle
    (
    GM_LayerHandle_t32      aLayer,             // Layer the area is in
    uint32                  aAreaIndex,         // Index of area in layer
    const GM_AreaStyle_t*   aAreaStyle          // New style to use for area
    );

Sets the style and font to use for drawing the given area object. Pass NULL for the area style to reset the drawing style to the default style for the classification of the area.

Typically, when modifying the drawing style of an area you'll want to call GM_GetAreaFeature to get the current drawing style, then copy the mAreaStyle member of the GM_AreaFeature_t and just change what you need, then pass your copy in to this function.


GM_SetAreaFeaturePointList
GM_Error_t32 GM_SetAreaFeaturePointList
    (
    GM_LayerHandle_t32      aLayer,             // Layer the area is in
    uint32                  aAreaIndex,         // Index of area in layer
    uint32                  aHoleIndex,         // Index of hole to apply locations to (0 for main parent area, 1 for first hole, etc.)
    const GM_Point_t*       aPointList,         // New list of points for area
    uint32                  aPointCount,        // Number of points in list (must be >= 3)
    boolean                 aPosInLayerCoords   // Are the position in the layer coordinate system or the current coordinate system?
    );

Sets the list of point locations to use for the given area feature. The positions can either be specified in the native projection system of the layer (aPosInLayerCoords is TRUE) or in the current projection as returned by GM_GetProjection (aPosInLayerCoords is FALSE).

The aHoleIndex parameter allows you to set the position list for holes within an area as well as the main parent area. To set the position list for the main parent area, use a value of 0 for aHoleIndex. To set the position of one of the holes in the area, set aHoleIndex to the 1-based index of the hole in the area.


GM_SetBackgroundColor
COLORREF GM_SetBackgroundColor
    (
    COLORREF                aBgColor
    );

Sets the background color to use when drawing and exporting layers. The old background color is returned.


GM_SetElevationOverrides
GM_Error_t32 __stdcall GM_SetElevationOverrides
    (
    GM_LayerHandle_t32                  aLayer,     // in: layer to set options for
    const GM_ElevationOverrides_t*      aOptions    // in: elevation adjustment options for raster layer
    )

Sets the elevation adjustment options that are currently being applied to a given elevation layer. You should typically first call GM_GetElevationOverrides to get the current elevation adjustments for a layer, then change the appropriate options, then call this to modify the adjustments for the layer.


GM_SetFeatureAttrList
GM_Error_t32 __stdcall GM_SetFeatureAttrList
    (
    GM_LayerHandle_t32      aLayer,             // IN: Layer the feature is in
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    uint32                  aFeatureIndex,      // IN: Index of feature in layer
    const GM_AttrValue_t*   aAttrList,          // IN: New list of attributes to associate with feature
    uint16                  aNumAttrs           // IN: Number of attributes in aAttrList
    );

Sets the attribute list to use for a given area, line, or point feature in the given layer.


GM_SetFeatureClass
GM_Error_t32 __stdcall GM_SetFeatureClass
    (
    GM_LayerHandle_t32      aLayer,             // IN: Layer the feature is in
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    uint32                  aFeatureIndex,      // IN: Index of feature in layer
    FeatureClass_t16        aFeatureClass       // IN: New feature class to assign to feature
    );

Sets the feature class for the given area, line, or point feature in the given layer.


GM_SetFeatureClassEnabled
boolean GM_SetFeatureClassEnabled
    (
    FeatureClass_t16        aFeatureClass,      // IN: Feature class to get info for
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    boolean                 aEnable             // IN: Enable or disable the feature class
    )

Enables or disables the display of the given feature class. The previous enable/disable state is returned.


GM_SetFeatureLabel
GM_Error_t32 __stdcall GM_SetFeatureLabel
    (
    GM_LayerHandle_t32      aLayer,             // IN: Layer the feature is in
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    uint32                  aFeatureIndex,      // IN: Index of feature in layer
    const char*             aLabel              // IN: New display label for feature.
    )

Sets the display label for the given area, line, or point feature in the given layer.


GM_SetLayerDescription
GM_Error_t32 __stdcall GM_SetLayerDescription
    (
    GM_LayerHandle_t32  aLayer,         // layer to set description for
    const char*         aDesc           // description to use (pass NULL to restore default)
    );

Sets the description to use for this layer in the GM_LayerInfo_t structure and when adding it to a map catalog.


GM_SetLayerEnabled
GM_Error_t32 GM_SetLayerEnabled
    (
    GM_LayerHandle_t32  aLayer,         // layer to enable or disable
    boolean             aEnable         // enable or disable the layer?
    );

Sets whether or not a given layer is enabled for display. If disabled, the layer will never be drawn or used as input for other translucent or texture-mapped layers.

All layers are enabled by default when initially loaded.


GM_SetLayerLabelAttribute
GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_SetLayerLabelAttribute
    (
    GM_LayerHandle_t32      aLayer,             // Layer to modify labels for
    const char*             aAttrName,          // Name of attribute to use for naming labels
    uint32                  aReserved           // Reserved value for future expansion (must be zero)
    );

Sets the name of the feature attribute to use for the display label for features that don't already have a display label.


GM_SetLineFeatureClassDrawStyle
GM_Error_t32 GM_SetLineFeatureClassDrawStyle
    (
    LineFeatureClass_t16    aFeatureClass,      // IN: Feature class to set draw style for
    const GM_LineStyle_t*   aLineStyle          // IN: New style to use for line (NULL to reset to default)
    );

Sets the default style and font to use for drawing lines with the given line classification. Pass NULL for the line style to reset the default drawing style to the default style for that classification of line.

Typically, when modifying the drawing style of a line class you'll want to call GM_GetLineFeatureClassDrawStyle to get the current drawing style, then just change what you need, then pass your copy in to this function.


GM_SetLineFeatureDrawStyle
GM_Error_t32 GM_SetLineFeatureDrawStyle
    (
    GM_LayerHandle_t32      aLayer,             // Layer the line is in
    uint32                  aLineIndex,         // Index of line in layer
    const GM_LineStyle_t*   aLineStyle          // New style to use for line
    );

Sets the pen style and font to use for drawing the given line object. Pass NULL for the line style to reset the drawing style to the default style for the classification of the line.

Typically, when modifying the drawing style of a line you'll want to call GM_GetLineFeature to get the current drawing style, then copy the mLineStyle member of the GM_LineFeature_t and just change what you need, then pass your copy in to this function.


GM_SetLineFeaturePointList
GM_Error_t32 GM_SetLineFeaturePointList
    (
    GM_LayerHandle_t32      aLayer,             // Layer the line is in
    uint32                  aLineIndex,         // Index of line in layer
    const GM_Point_t*       aPointList,         // New list of points for line
    uint32                  aPointCount,        // Number of points in list (must be >= 2)
    boolean                 aPosInLayerCoords   // Are the position in the layer coordinate system or the current coordinate system?
    );

Sets the list of point locations to use for the given line feature. The positions can either be specified in the native projection system of the layer (aPosInLayerCoords is TRUE) or in the current projection as returned by GM_GetProjection (aPosInLayerCoords is FALSE).


GM_SetOrientation
GM_Error_t32 GM_SetOrientation
    (
    double              aOrientation    // Orientation of bitmap (0 is north up, 90 is east up, 180 is south up, 270 is west up)
    );

Allows for drawing data with a direction other than north to the top of the screen for most projections. A value of 0.0 is the default and implies no rotation. Technically, the orientation value is the number of degrees to rotate the rendered data counter-clockwise.


GM_SetPointFeatureClassDrawStyle
GM_Error_t32 GM_SetPointFeatureClassDrawStyle
    (
    PointFeatureClass_t16   aFeatureClass,      // IN: Feature class to set draw style for
    const GM_PointStyle_t*	aPointStyle         // IN: New style to use for point (NULL to reset to default)
    );

Sets the default style and font to use for drawing points with the given point classification. Pass NULL for the point style to reset the default drawing style to the default style for that classification of point.

Typically, when modifying the drawing style of a point class you'll want to call GM_GetPointFeatureClassDrawStyle to get the current drawing style, then just change what you need, then pass your copy in to this function.


GM_SetPointFeatureDrawStyle
GM_Error_t32 GM_SetPointFeatureDrawStyle
    (
    GM_LayerHandle_t32      aLayer,             // Layer the point is in
    uint32                  aPointIndex,        // Index of point in layer
    const GM_PointStyle_t*  aPointStyle         // New style to use for point
    );

Sets the symbol and font to use for drawing the given point feature. Pass NULL for the point style to reset the drawing style to the default style for the classification of the point.

Typically, when modifying the drawing style of a point you'll want to call GM_GetPointFeature to get the current drawing style, then copy the mPointStyle member of the GM_PointFeature_t and just change what you need, then pass your copy in to this function. You can add new symbols using the GM_AddCustomSymbol function.


GM_SetMessageCallback
void GM_SetMessageCallback
    (
    GM_MessageCallbackFunc aCallbackFunc
    );

Sets the function to call to display error and warning messages generated during SDK operations. If a message callback is provided, a message dialog will not be shown, instead the callback function will be called with the error or warning message that would have been displayed. The callback is then free to do whatever they'd like, including just ignore the message, in which case the error code will still be returned from the function generating the message like normal.


GM_SetPointFeaturePosition
GM_Error_t32 GM_SetPointFeaturePosition
    (
    GM_LayerHandle_t32      aLayer,             // Layer the point is in
    uint32                  aPointIndex,        // Index of point in layer
    const GM_Point_t*       aPosition,          // New location of point
    boolean                 aPosInLayerCoords   // Is the position in the layer coordinate system or the current coordinate system?
    );

Sets the position to use for the given point feature. The position can either be specified in the native projection system of the layer (aPosInLayerCoords is TRUE) or in the current projection as returned by GM_GetProjection (aPosInLayerCoords is FALSE).


GM_SetProgressCallback
void GM_SetProgressCallback
    (
    GM_ProgressCallbackFunc aCallbackFunc
    );

Sets the function to call to report the progress of an operation, like the loading of a file. If a progress callback is provided, a progress dialog will not be shown, instead the callback function will be called. Pass NULL in for the callback function to restore the standard progress reporting dialog.


GM_SetQueryProjectionCallback
GM_DLL_EXPORTED void __stdcall GM_SetQueryProjectionCallback
    (
    GM_QueryProjectionCallbackFunc  aCallbackFunc
    );

Sets the function to call to select a projection for a layer when being loaded if the projection for that layer cannot be automatically determined. If a callback is provided, it will be called rather than the projection selection dialog being displayed. Pass NULL in for the callback function to restore the standard projection selection dialog.


GM_SetProjection
GM_Error_t32 GM_SetProjection
    (
    const GM_Projection_t*  aProj
    );

Sets the new projection. This is the projection that all draws and exports will be done in. It is also the projection that all world bound rectangles will be in.

EXAMPLE 1: - Set projection to UTM Zone 15
GM_Projection_t theUtmProj;
::memset( &theUtmProj, 0, sizeof theUtmProj );
theUtmProj.mProjSys = GM_PRJ_UTM;
theUtmProj.mDatum = GM_DATUM_WGS_84;
theUtmProj.mUnit = GM_PRJ_UNIT_METERS;
theUtmProj.mAttrList[0].mAttr = ZONE;
theUtmProj.mAttrList[0].mValue = 15;
theUtmProj.mNumAttrs = 1;
GM_SetProjection( &theUtmProj );
EXAMPLE 2: - Set projection to Geographic (unprojected lat/lon)
GM_Projection_t theGeoProj;
::memset( &theGeoProj, 0, sizeof theGeoProj );
theGeoProj.mProjSys = GM_PRJ_GEO;
theGeoProj.mDatum = GM_DATUM_WGS_84;
theGeoProj.mUnit = GM_PRJ_UNIT_ARC_DEGREES;
GM_SetProjection( &theGeoProj );

GM_SetRasterDisplayOptions
GM_Error_t32 GM_SetRasterDisplayOptions
    (
    GM_LayerHandle_t32                  aLayer,     // in: layer to set options for
    const GM_RasterDisplayOptions_t*    aOptions    // in: display options for raster layer
    );

Sets the options to use when displaying the given raster layer. This includes things like the translucency and transparency (if any) of the layer, the color intensity of the layer, and whether or not to crop the collar of the layer.

Typically you'll want to first call the GM_GetRasterDisplayOptions function for a layer to retrieve the current display options, then modify the options that you want to change, then call GM_SetRasterDisplayOptions to change the options. This will prevent you from inadvertently chaning an option that you didn't mean to change.


GM_SetRegistrationInfo
GM_Error_t32 GM_SetRegistrationInfo
    (
    const char* aRegName,   // name provided for the registration information
    uint32      aRegKey     // registration key
    );

Sets the registration name and code to use for this instance of the DLL. This can be used rather than the GMDLL_regkey.txt file to supply the registration information. Will return GM_Error_NotRegistered if the