How change units of coordinates grid?

Roman_MolchanovRoman_Molchanov Global Mapper UserPosts: 1
edited June 2015 in Technical Support
Hello guys,


Our customer uses GlobalMapper SDK in several his projects. We draw the grid lines using this function: GM_DrawGridLinesEx. The coordinate labels in the grid are drawn in the format of Degrees-Minutes-Seconds. Our customer want to support three mode of drawing grid units: Degrees-Minutes-Seconds (e.g. 37 30 10.1234N), Degrees-Minutes (e.g. 37 30.3678N), Degrees (Degrees e.g. 37.5675532N). How can we achieve this using GlobalMapper SDK?


Thanks,
Roman.

Comments

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,264
    edited June 2015
    Hello Roman,

    You can use:
    // Sets an advanced/miscellaneous option to use during operation. Returns the previous value.
    GM_DLL_EXPORTED void* __stdcall GM_SetMiscOptionEx
        (
        GM_MiscOpt_t32  aOpt,       // IN: Option to set
        void*           aNewValue,  // IN: New value (i.e. 1 to enable or 0 to disable), or value of other setting, including possibly pointer
        void*           aReserved   // IN: Reserved for future use, must be NULL
        );
    

    For example:
    [COLOR=#000000]GM_PosDisplayFormat_t8 prevFormat = ([/COLOR][COLOR=#000000]GM_PosDisplayFormat_t8[/COLOR][COLOR=#000000])[/COLOR]GM_SetMiscOptionEx
                                                                       (GM_MiscOpt_PositionDisplayFormat, 
                                                                        GM_POS_LatLonDecimal, 
                                                                        NULL); 
    

    Here is the full list of format options (from the definition of GM_PosDisplayFormat_t8 in GlobalMapperTypes.h.)
    typedef uint8 GM_PosDisplayFormat_t8; enum{
        GM_POS_LatLonDecimal,       // display/save lat/lon as dd.ddddddd <hemi> [always positive, include hemisphere indicator]
        GM_POS_LatLonDMS,           // display/save lat/lon as dd mm ss.ss
        GM_POS_LatLonDM,            // display/save lat/lon as dd mm.mmm
        GM_POS_MGRS,                // display/save lat/lon as MGRS
        GM_POS_LatLonDecimalPlain,  // display/save lat/lon as +/-dd.ddddddd [no hemisphere indicator, West/South are negative]
    
    
        // Special values
        GM_POS_NUM_TYPES,
        GM_POS_Default = GM_POS_LatLonDMS
    };
    

    Note that the option you set will be used for all subsequent calls to GM_DrawGridLinesEx.

    Cheers,

    Bob
Sign In or Register to comment.