Long Processes Questions

QldblueQldblue Global Mapper UserPosts: 17
edited March 2012 in SDK
Hi,

I note when I call GM_LoadLayer and it is a large file or there are a number of layers a default GM progress dialog is automatically displayed.

A call to GM_LoadOnlineLayer is nearly always a long process and the the program must wait until the process completes (or times out! - does it ever time out?). In contrast to GM_loadLayer this call does not seem to automatically display a GM default 'working' dialog or provide the user with a cancel button. I realise there is a GM_SetProgressCallback function avalailable. On reading the description for this call it suggests that there are GM default process dialogs for most routines. Is there a flag to set to enable a default progress dialog for downloads?

I notice the same issue with zooming and moving very large files, sometimes this can take a long time (and no it's not the computer processor speed), and most likely due to downloading online data. Is this the case. If so is there a default GM process dialog available or should it be handled programatically?

Finally, though not strictly a long process issue I note that import of Autocad DWG files are not supported in the SDK but it is in GM. Any chance this will change in the future? Are there any alternatives available?



Mark

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2012
    Mark,

    Is it actually the GM_LoadOnlineLayer call that is taking a while or the draw based on the online layer? Typically the GM_LoadOnlineLayer call itself is fast as the data isn't downloaded then, it is downloaded from the appropriate zoom level as needed for display and export, so it is those operations that will actually be slow.

    There isn't currently progress available for that part, but we are planning on making an improvement to download the tiles in the background and provide support for reporting progress and cancelling those operations in a future release of the SDK.

    DWG support is only possible via a library from OpenDesign.com. We cannot sub-license that via the SDK, but if you can prove to us that you have a license for that library from them we can provide a build of the SDK that enabled DWG and DGN support using their libraries.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • QldblueQldblue Global Mapper User Posts: 17
    edited March 2012
    Thanks for the advice.

    I stepped through the code and confirmed your advice wrt the slow process.

    Now I need your help with interpreting the following error, that came about invesigating user feedback options. The error is:

    Error drawing layers.
    The operation completed successfully.
    GlobalMapperInterface.cpp - 22626
    Version: v1.37
    Build Time: Jan 17 2012 20:55:40

    Since I was looking to assist users with visual feedback I included flags

    GM_DrawFlags_EraseBackground + GM_DrawFlags_SeparateVectorLayers + GM_DrawFlags_ShowRenderProgress+GM_DrawFlags_IncrementalRender

    I only have one layer a googlemaps raster image from my harddrive (comes from google maps and I created a jpgw file to automatically load the jpg)
    typical format of jpgw
    0.000021457672119
    0.0000000
    0.0000000
    -0.000019038891085
    153.017614486694356
    -27.463296873477503

    Steps to create error:
    1 load jpg file with default geographic projection, wgs84 etc.
    2 Zoom in (or move the file etc)>>>Error

    The only difference is that at (1) the GM_DrawlayerList is aWorldBounds = null and for (2) the draw there are actual values, i.e. the bounds are other than full extent of data.

    Now if I load another layer, this time online world street maps I get two errors on the screen redraw, the original error and now also:

    Error drawing layers.
    The operation completed successfully.
    GlobalMapperInterface.cpp - 22571
    Version: v1.37
    Build Time: Jan 17 2012 20:55:40

    However, although it says its an error, the layers look fine.

    Can you advise if this is actually an error?



    Mark

    p.s. If i drop off GM_DrawFlags_ShowRenderProgress I still get feedback on the slow process (downloaded tiles are incremantally drawn) but I dont get the dialog box showing the error at the conclusion of the draw!
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2012
    Mark,

    The errors that you listed come from a BitBlt failing to the HDC that you passed in (the - 22626 error) and the other in creating a new compatible DC with the HDC that you passed in (the -22571 error). Is it possible that the HDC that you are passing in is somehow invalid, like maybe it is in a background thread and is going away or something?

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • QldblueQldblue Global Mapper User Posts: 17
    edited March 2012
    Cool Mike

    I simply deleted a call to the redraw function in my zoom-in, zoom-out etc code and then invalidated the window control to redraw, no errors!!

    Mark
Sign In or Register to comment.