Global Mapper v25.0

Drawing layers on CView's (OnDraw) Drawing area.

mg.srikanth Global Mapper User
edited July 2012 in SDK
Hi everybody,

I am trying to use global mapper SDK in VC++ MFC project. My requirement is to draw the geographic layers on the Drawing area of my view area which is derived from CView base class. I was able to draw line, circle, rectangle etc. using CPen in ::OnDraw function of my class but, I am not able to draw the Geographic (vector) layers on it. Is there any procedure to follow to draw the map data on the drawing area? how do i proceed using global mapper sdk? I have downloaded the sample source code i.e. GMDLL_Tester in VC++ which is able to draw geographic layers on a picture control. But i could not make use of it for my requirement. Can anybody help me out the procedure to draw the geographic data on my drawing area of MFC project?

I will waiting for a positive reply....


  • global_mapper
    global_mapper Administrator
    edited July 2012
    You would just call GM_DrawLayerList with the DC (or a background DC that you later BitBlt to that DC) for the OnDraw function. I would in fact suggest using the GM_MapWindow C++ class from the C++ sample application in its entirety and just pass in the window handle for your CView-derived class and the client rectangle as the bounds, then use your OnDraw DC just like the CDialog-wrapper class in the C++ sample application does from its OnPaint. Basically exactly the same thing, just from CView OnDraw rather than CDialog::OnPaint, but no conceptual difference. The picture control in the C++ sample application is just to allow easy definition of the bounds of the draw window, the picture control isn't needed at all.


    Global Mapper Guru