Rendering Shapes is SLOW

2 posts, 0 answers
  1. Alan
    Alan avatar
    3 posts
    Member since:
    Sep 2011

    Posted 27 Oct 2011 Link to this post

    Hey, I've implemented a DynamicLayer and it uses an indexed Spatial DB as its source. It's fast to grab shapes from the DB, its reasonably fast to convert them into Telerik map elements with a SqlGeospatialDataReader, however when it comes to the UI drawing them, its terribly slow...

    I'm zoomed in really far, I don't let it render until zoom level 16. I have to believe the number of shapes I have to render on screen at a time is not too much more than your shape file examples. My shapes are most likely quite a bit more complex, but the performance is just so absolutely terrible. I have to believe I'm not doing it right. Your rendering of tiles is quite a bit faster than other comparable WPF map products, IMO, but rendering vectors, even small amounts of them, is just about the worst of any product out there. Please help. I need something that can do both reasonable well.

  2. Andrey
    Andrey avatar
    1681 posts

    Posted 01 Nov 2011 Link to this post

    Hello Alan,

    Mostly, the performance of dynamic layer depends on its ZoomGridList you will use in your application. The optimal value for the Latitudes and Longitudes count depends on the viewport size of the map control and the min zoom level of the zoom grid. I think that the dynamic layer will have best performance when the square size for request will be approximately equal to the viewport size.
    The count could be calculated in the following way:
    1. The viewport size is 1024x1024 for example.
    2. The map size is 512x512 when the zoom level is 1, 1024x1024 for 2 and 2048x2048 for 3 etc. The map size is calculated as 2 ^ (zoom level  8).
    3. When the zoom level is 3, then the count could be calculated as 2048 / 1024 = 2. I.e. count is calculated as map size/ viewport size.

    I would recommend using the way of ZoomGridList calculation above for achieving good performance for high zoom levels.

    The dynamic layer adds/removes items dynamically. It works with squares which are calculated according to its ZoomGridList. When a square appears within the visible area of map then the dynamic layer adds its items onto the view. When a square gets out from visible area then the dynamic layer removes its items. During the panning a few squares can change its visibility. When squares contain a lot of shapes then this process takes a long time.

    It looks like you are using DynamicLayer in a wrong way, or your map shapes aren't so simple as you think. Also I'm absolutely not sure that the performance of rendering vectors is just about the worst of any product out there. Could you please tell us what products have you used for comparison of this factor?

    Also it is very complicated and it is hard to reproduce the problem without your solution. Could you, please, provide us with your solution and data for detailed analysis?

    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top