+ Reply to Thread
Results 1 to 5 of 5

Thread: Show graphics as they are added to graphics layer.

  1. #1
    Vincenzo Piscitelli
    Join Date
    Apr 2010
    Posts
    24
    Points
    0
    Answers Provided
    0


    0

    Default Show graphics as they are added to graphics layer.

    I need to add some polygons to a graphics layer. These polygons are the result of a user created query. Some queries can produce up to 1100 polygons. Is there a way to show graphics as they are added to the graphics layer? My experience thus far has been that regardless of the number of graphics I add, they are all rendered at once. Ideally, I would like to chunk the results and add 100 graphics at a time, then render them, then add another 100 and so on.

    This would lessen the perceived time to render all the graphics as it takes some time to render all 1100.

    Thanks in advance.

    Enzo

  2. #2
    Jennifer Nery

    Join Date
    May 2010
    Posts
    2,449
    Points
    289
    Answers Provided
    51


    1

    Default Re: Show graphics as they are added to graphics layer.

    I know that graphics rendering has improved in v3.0. You can probably try Pre-Release. Another option is to probably use ArcGISDynamicMapServiceLayer with LayerDefinition (for query parameters), this will draw the features at once.
    Jennifer Nery
    Software Developer
    ArcGIS API for SL/WPF/WP7

  3. #3
    Morten Nielsen

    Join Date
    Oct 2009
    Posts
    1,166
    Points
    44
    Answers Provided
    7


    1

    Default Re: Show graphics as they are added to graphics layer.

    Only thing you can do to achieve this is to use a DispatcherTimer to trigger an add for X features every Y seconds.
    /Morten Nielsen
    ArcGIS Runtime SDK for .NET
    silverlight team blog - twitter - personal blog

  4. #4
    Robert Burke
    Join Date
    Apr 2010
    Posts
    57
    Points
    14
    Answers Provided
    1


    1
    This post is marked as the answer

    Default Re: Show graphics as they are added to graphics layer.

    Hi,

    I am not sure it would work in your case, but could you pattern the query after the ClipFeatures Geoprocessing Sample?

    http://resourcesbeta.arcgis.com/en/h...m#ClipFeatures

    Depending on the line the user creates, more than 1000 polygons may be buffered and clipped. To help with the wait time there is a processing... message that appears in the dialog. And to help with the larger number of polygon features to be returned, instead of returning a feature set, a gp map image gets returned if the number of polygons exceeds 500. Which could shorten the wait time.


    Rob
    Cheers,

    Esri - Redlands, Instructor
    Android, Java, Python, JavaScript, Server
    Rob Burke

  5. #5
    Vincenzo Piscitelli
    Join Date
    Apr 2010
    Posts
    24
    Points
    0
    Answers Provided
    0


    0

    Default Re: Show graphics as they are added to graphics layer.

    The performance with an ArcGISDynamicMapServiceLayer with query parameters is indeed faster. I did a quick prototype to prove this, but unfortunately would have meant too many changes to the application.

    Tried a BackgroundWorker with Dispatcher.Invoke() to add 100 graphics at a time, but the wait time between chunks needed to be too long to let the graphics draw, so it took much, much longer than the original method.

    Sometimes the simplest solutions are best. We ended up displaying an progress bar while the graphics were drawing. Also, as the polygons were been fetched via a QueryTask, we do some other UI tasks (Open a data table with some results).

    This seems to have reduced the perceived time.

    Thanks to all for your help.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts