Can DrawLayerList speed be improved

dcoggindcoggin Global Mapper UserPosts: 259Trusted User
edited January 2012 in SDK

Since you sped up GM_FindNearestFeatures, now most of the time while digitizing is spent in GM_DrawLayerList. It's taking about a tenth of a second per call to redraw the single digitizing line with a couple of segments. Maybe this just isn't going to be a fast way to draw a digitizing line. I use to draw it myself, but switched to this method (putting it on its own vector layer) to overcome some problems which I don't recall now. Is there any easy speedup of DrawLayerList or do I need to switch and draw it myself if I want it to be fast? As it is now the line usually lags the cursor by an inch or so if moving the cursor at a medium speed.

Thanks for your help.



  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2012

    There will be several BitBlts in GM_DrawLayerList which aren't really needed for your case. What I would do is keep the current line being drawn just in your own list of points in the current projection system, then as you move that just BitBlt the background map that you saved to an offscreen bitmap to the screen, then use GM_ConvertCoordGroundToPixel to get the pixel coordinates of your line and draw that yourself to the same DC. When your user actually finished creating the feature then add it to a layer. This should be much faster as it is the same approach used inside Global Mapper.

    Let me know if I can be of further assistance.


    Global Mapper Guru
  • dcoggindcoggin Global Mapper User Posts: 259Trusted User
    edited January 2012

    Thanks for the response. That's kind of what I was thinking. I was doing that before and I switched to my current method for a reason I can't remember now. I'll have to switch it back. Thanks for your help.

Sign In or Register to comment.