views:

683

answers:

3

I am trying to make a map application using DeepZoom. It already works by loading tile images from the server. The problem is, the loading speed is not good enough, there is always a small lag when new tiles are being downloaded.

My idea is to download the whole tiles package at once and then load them from local source. I know that this contradicts the idea of DeepZoom in a way, but I think it's really what I need.

Does anyone know how to make MultiScaleImage to load tiles from the local source? I have already tried to make my own MultiScaleTileSource and override the GetTileLayers method, but no luck there.

There has to be a way, right? Thanks in advance!

+1  A: 

I haven't played with DeepZoom in Silverlight, but to do this with HD View, I used two approaches:

  1. Just put the files on the file system and point the XML at them sing the "file://..." URI notation.
  2. I installed Apache and served up the content from http://localhost/...

Both worked fine and performance was much improved, as expected, compared to the over-the-wire scenario.

I'm not sure if (1) is possible with DeepZoom, but (2) should work just fine. You don't need to use Apace (or IE). Consider your own HTTP server written in Python or C# that maps the requested URL to a local file.

If you do write your own HTTP server, you may like to consider lazily downloading the files. This would mean that the user sees the lag only the first time they view an area of the image. Your server is then acting merely as a tile cache and usual cache eviction policies might be applicable (least recently used springs to mind).

Daniel Paull
Sadly, I can't really use either of these options because of the Silverlight sandbox limitations. It would work for WPF, but not Silverlight...Thanks for the suggestion anyway!
A: 

Sadly, I can't really use either of these options because of the Silverlight sandbox limitations. It would work for WPF, but not Silverlight... Thanks for the suggestion anyway!

A: 

WIth certian restrictions, this is totally possible. Indeed, I do this all the time - I generate a silver light deepzoom image on my local disk and then create a web page that the user can double-click and it works fine.

First, the restrictions: if you are using collections one often has to load some data file to know where to locate each msi in the collection - that requires a web request - and I can't figure out how to make that work locally. For whatever reason, the MSI control has no trouble loading files locally.

So, here was how I put together my web project. In the root folder I have the xap, etc., that contains my silver light control (which is dirt simple). This is basically equivalent to the ClientBin folder. Now, inside that folder I put a "meeting" folder, which contains the output from the composer tool ("meeting_files" and "meeting.xml"). THe meeting_files, of course, contains all the bits to the MSI.

Now the root HTML file is pretty simple - for the MSI's source argument I just give it "meeting/meeting.xml" - a relative path.

And that works for me. Let me know if you want more info (well, this is so long after you asked the question it might not matter any longer). Performacne when things are local is great - but for a decent sized image it can take forever to download all the files. Some of my really big deepzoom images are 10 GB!

Gordon