Solved

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

Posted on 2004-08-03
3
386 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now