Global Mapper 16
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Global Mapper User
    Join Date
    Jan 2009
    Posts
    17

    Default Draw Shapes and Removal of symbols

    Hi,

    I would like to know if there exists any API to draw shapes such as circle in the SDK.


    Also, i understand that, deleting a symbol means disabling it from being displayed on the map. Is there any way to remove that symbol totally? As in remove it from the memory.

    Thanks.

  2. #2
    Administrator
    Join Date
    Jun 2007
    Posts
    16,451

    Default

    While there is not any automated API to create new features with shapes like circles, all that you need to is build a list of vertices that form the shape that you want for a line or area, then add that feature to a layer. To create a circle that is a true ground distance, you can use the GM_CalcProjectedLocation function to create a series of points every so many degrees around the edge of a circle and create your feature with that.

    The only way to completely remove a feature from memory is to close the layer that the feature is in. Deleting a feature just marks it as deleted, but it is still in memory and can be undeleted later.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com

  3. #3
    Global Mapper User
    Join Date
    Jan 2009
    Posts
    17

    Default

    Hi, through your help, I have managed to draw shapes with transparency on my map using the SDK.

    However, I noticed something odd. When I draw a shape with a green color fill, it seems to affect the zoom-in/out of the map. The zooming in/out seems to lag. When other color is used, eg. red, the zoom in/out is ok.

    I am not very sure of what causes the above observations. Hope you can help. Thanks!

  4. #4
    Administrator
    Join Date
    Jun 2007
    Posts
    16,451

    Default

    When you use translucency the SDK switches to drawing the areas with GDI+ rather than normal Windows GDI, although I wouldn't really expect a noticeable slowdown unless you are drawing lots of areas.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com

  5. #5
    Global Mapper User
    Join Date
    Jan 2009
    Posts
    17

    Default

    Hi,
    I tried drawing one shape with no transparency. I used a COLORREF RGB(0,255,0)
    As i tried to zoom out to infinity, the system seems to lag when the polygon gets smaller and smaller.

  6. #6
    Administrator
    Join Date
    Jun 2007
    Posts
    16,451

    Default

    I would actually expect the render to get faster as you zoomed out as no clipping is done and less pixels are actually modified. Have you timed the draw to make sure it is the source of the lag?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com

  7. #7
    Global Mapper User
    Join Date
    Jan 2009
    Posts
    17

    Default

    Hi again.

    I timed the draw. (I have a underlying vector map as base.)

    Without any polygon, my map drew at 110 milliseconds.
    With 1 Red polygon, my map drew at 110 milliseconds.
    With 1 Green polygon, my map drew at 20528 milliseconds.

    Hope this provide some useful information to you. Thanks
    Last edited by melonzeus; 04-28-2009 at 06:02 AM.

  8. #8
    Global Mapper User
    Join Date
    Jan 2009
    Posts
    17

    Default

    I realised the above problem only exists when I have a vector map loaded
    This map contains about 13000 features.

    Hope this additional information is useful to you. Thanks again.

  9. #9
    Administrator
    Join Date
    Jun 2007
    Posts
    16,451

    Default

    So if you have a vector map loaded the draw time is always slow or just when you add your translucent green polygon?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com

  10. #10
    Global Mapper User
    Join Date
    Jan 2009
    Posts
    17

    Default

    Hi,

    Here are some of the observations I have.

    No lag (about 10 ms) experienced when a polygon with no transluceny is drawn on the screen without the vector map being loaded.

    Slower draw time (about 100 ms) when just a vector map of 13000 points are drawn and shown on the screen. (No polygon is added yet)

    Significant slower draw time when a vector of 13000 points are drawn on the screen with an additional green polygon (no transluceny) added .

 

 
Page 1 of 2 12 LastLast

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.1
Copyright 2008-2012 Globalmapperforum.com
All times are GMT. The time now is 06:08 PM.
vBulletin 4.0 skin by CompleteVB