views:

175

answers:

1

Hello,

I am trying to create a Deep Zoom based multiscale image that essentially has 2 views. Initially it will display a large map of the world. When the user click the USA the image should then zoom into the USA. Clicking an external button should zoom the image back out. Thats it. I don't want panning or additional zooming.

What I don't understand is how to define a "hit area" around the USA that zooms it in. Can anyone provided links to resources that explain how to do this... I never seem to find exactly what I am after?

Thanks in advance.

+2  A: 

I can't remember the code exactly.

But if you generate a project with the source code in Deepzoom composer and then take a look at the source code.

Right down the bottom of the the Deepzoom code is a function for zooming into a LogicalPoint.

Convert the top left point of the image you are zooming into a logical point. Set this as your ViewportOrigin as this will put it in the top left.

http://blogs.msdn.com/jaimer/archive/2008/06/23/working-with-collections-in-deep-zoom.aspx This post here explains the ViewportOrigin quite well. Just remember that everything is related to the Width.

You will also need to set the the ViewportWidth.

When the ViewportWidth = 1 the whole image is displayed so it will be a fraction of the total width of the image. (USA width / WorldMap Width)

Hope this makes sense.

Tim