SDK Scale Bar Support

DanaBDanaB Global Mapper UserPosts: 13
edited February 2012 in SDK
Hi Mike

I dont see from the GlobalMapperInterface.h file any support for a Scale Bar. Any pointers in how to accomplish this (a scalebar control on top of the map with scale values passed from the SDK?)

Possibly GM_GetLastDrawnScale ?

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    Actually just added support for this using GM_LoadMapLayoutFile and passing in a GM_DrawFlags_DrawMapLayoutLayers draw flag. You can also load a workspace that defines the map layout. You can get the latest SDK build at http://www.globalmapper.com/GlobalMapperSDK_latest_beta.zip to get this change.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • DanaBDanaB Global Mapper User Posts: 13
    edited February 2012
    Hi Mike

    I've implemented GM_LoadMapLayoutFile, loading a working .gm_layout file at startup.
    Changed my GM_DrawLayer to GM_DrawLayerList to accomodate the GM_DrawFlags_DrawMapLayoutLayers flag but still no scalebar.
    The layers load and display correctly and all these "new" functions return GM_Error_None.

    Any suggestions? I work with the GlobalMapperInterface.dll ver 1.38.0.0

    P.S the C++ demo source does not contain GM_LoadMapLayoutFile functionality. Only the Release exe does.

    Dana

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    Dana,

    Can you provide the .gm_layout file that you are using? Another user is having similar problems adding this new functionality, but so far it works perfectly for me in all tests.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • DanaBDanaB Global Mapper User Posts: 13
    edited February 2012
    Mike,

    Thanks for the support on sorting out the GM_LoadMapLayoutFile functionality using C#. The latest GlobalMapperSDK_latest_beta.zip did the trick.

    Just another question on this scalebar topic: how do you change the scalebar units (default mi to km ?)

    The Distance Measure Units parameter is not present in the .gm_layout file.

    Regards

    Dana
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    Dana,

    Use GM_SetMiscOption with an option of GM_MiscOpt_LinearMeasureUnits and one of the following for the value:

    typedef uint8 GM_LinearUnits_t8; enum
    {
    GM_LINEAR_METRIC,
    GM_LINEAR_NAUTICAL,
    GM_LINEAR_STATUTE,
    GM_LINEAR_CHAINS,
    GM_LINEAR_YARDS,

    GM_LINEAR_NUM_TYPES
    };

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
Sign In or Register to comment.