Ask a questionAsk a question
 

AnswerLots of MapTileLayers

  • Thursday, November 05, 2009 3:21 PMDoubleDare Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    We have created several directories which are rectangle parts of a city that holds MapCruncher generated png files.
    At this moment it has 63 directories. For each directory we create a MapTileLayer Object (in the Silverlight VE component) and point it to that directory. They work..
    tehy also work when loading 5-10 ...but when loading more (creating more MapTileLayer Objects) at the client side memory usage is HUGE. Not workable anymore and the CPU usage keeps staying at above 90%.
    We load all MapTileLayers at once so the user can zoom to the part he wants. As I understand using MapTileLayers (and crunched png) is the way to use. It should only load the neccessary png files at a certain level. That what's this techniqie is all about, right?

    What can be wrong? Or is it just a memory leak at the Silverlight VE component?

Answers

  • Monday, November 09, 2009 6:28 PMDuncan Lawler Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Even when displaying a sparse non-overlapping set of tiles, each map tile layer will have some performance overhead in terms of both memory and render performance.  I wouldn't recommend adding more than about 10 layers or perf would degrade to unacceptable levels.
    A workaround would be to write a simple web service that would read tiles from the various directories as needed, but look like a single tile layer to the client.  That would work as long as you don't need to switch the individual directories on or off independently.

All Replies

  • Thursday, November 05, 2009 10:35 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    On Microsoft connect there was a report that there is a memory leak with tile layers in the CTP version of the Silverlight control. Hopefully this is corrected in the next version.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
  • Monday, November 09, 2009 6:28 PMDuncan Lawler Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Even when displaying a sparse non-overlapping set of tiles, each map tile layer will have some performance overhead in terms of both memory and render performance.  I wouldn't recommend adding more than about 10 layers or perf would degrade to unacceptable levels.
    A workaround would be to write a simple web service that would read tiles from the various directories as needed, but look like a single tile layer to the client.  That would work as long as you don't need to switch the individual directories on or off independently.