[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: A few general questions about SVG


svg javascript zoom
Roger L. Costello wrote:
> I have a few general questions about SVG:
>  
> 1. Suppose that I render an SVG document in a browser (using the Adobe SVG
> plugin).  My experiments show that I can right-mouse-click on the image and
> select Zoom in.  However, my experiments also show that I can only Zoom in 3
> or 4 times, at which time the Zoom in menu pick gets grayed-out.  Does SVG
> limit the level of Zooming in, or is that a limitation of the Adobe
> renderer?

SVG as a vector graphics system has no resolution limits.  In addition 
to the practical issues that others have already answered, bear in mind 
that you can display a bitmapped image in svg, and that image would be 
subject to the same problems as all bitmapped images.

> 2. Continuing with the last question ... Suppose that I have a map of a
> country.  How much detail can be put into the map?  Can I put details down
> to the level of a building, on a street, in a city, in a state in the
> country?  Can I then Zoom in from the country level down to see the
> building?
>  

You have three approaches that i know about for zooming in with svg -

1) Plain magnification.
2) Progressively disclose more detail for each stage of the zoom using 
javascript.
3) Progressively disclose more detail for each stage of the zoom by 
changing a css stylesheet.  I don't know which, if any, implementations 
let you manipulate the css using javascript, though.

You could also accomplish progressive disclosure by loading new pages 
for each step - the pages might only differ by the magnification and the 
stylesheet.

> 3. Can I associate textual information with parts of the SVG graphic?  For
> example, if I have a graphic of a country, I might like to associate some
> textual information for each city.  Is it possible to hide the textual
> information until the user, for example, right-mouse-clicks on the city?
>  

Scripting is your friend.

> 5. Suppose that I want to create an SVG image of a country.  I cannot
> imagine handcrafting an XML SVG document.  How do you suggest that I create
> the SVG document?

A couple of years ago, when Microsoft was adding xml support to sql 
server, they published an article on their web site that took publicly 
available street map data for Manhattan, stored it in the database, then 
extracted it as an svg street map with the help of some xslt 
transformations.  It seemed to work very nicely.  If you are lucky, 
maybe the page is still squirreled away on their site somewhere that 
Google knows about.

You do want to remember that different svg implementations use 
non-compatible ways to specify the use of javascript and css (different 
MIME types).  This is a real nuisance if you want to get something 
working across several implementations, and have it use javascript, css, 
or both.  Mozilla is the most annoying in this respect (I consider the 
top three implementations for experimenting with to be the Adobe plugin, 
Batik, and Mozilla).  Mozilla also has not yet implemented the "use" 
element, which I think is a real weakness since it is one of the most 
features you can use whenever you have repetitive groups you want to 
place at different places on the diagram.  I filed a bug against this, 
so maybe at some point it will be implemented.

Overall, I have been happiest with Batik, but the Adobe plugin is 
certainly convenient if you are willing to use IE.

Cheers,

Tom P

-- 
Thomas B. Passin
Explorer's Guide to the Semantic Web (Manning Books)
http://www.manning.com/catalog/view.php?book=passin

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.