Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Delete from XML 10 47
how to embed the downloaded xml to this workbook and then delete downloaded file from path. 2 60
PHP and Soap 3 58
ASP.NET reading ATOM 2 67
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 …
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

791 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