Solved

SVG Map - Resizing circles onzoom and providing a hovering legend.

Posted on 2004-08-03
3
392 Views
Last Modified: 2012-06-21
Here is a demo of the svg my program is producing: http://www.dcs.ex.ac.uk/ug/cs02/djm/demoMap.svgz

I would like the spots to become smaller when a user zooms in (aswell as bigger again when someone zooms out). Clearly the circles will therefore need to be in a group.

I would also like to provide a hovering legend in the top left of the screen whoes size and position is not affected by the user scaling or panning/scrolling. Idealy this window would be moveable by the user.

Thanks for your help,
Dan.
0
Comment
Question by:Dandalf
3 Comments
 
LVL 1

Author Comment

by:Dandalf
ID: 11714078
First bit solved and looks like this:

         var svgdoc,svgroot;
       function doZoom(evt){
             var spots = svgroot.getElementById('spots')
             var nodes = spots.childNodes;
             for(var i=0; i<nodes.length; i++){
                   if(nodes.item(i).nodeType == 1){
                         nodes.item(i).setAttribute('r', 3/svgroot.currentScale);
                   }
             }
      }

Still looking to get a floating legend working however.

Dan.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12637543
PAQed with points refunded (240)

modulo
Community Support Moderator
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question