Hi Charles,

"Charles Abreu" <[EMAIL PROTECTED]> wrote on 07/21/2006 07:23:53 AM:

> I'm calling document.getElementById("useId"), where "useId" is the id 
defined 
> in the use element, not the id in symbol element. Any idea?

   I think I understand the problem.  Unlike say a 'rect'
element the 'use' element establishes a new user coordinate
system based on it's x,y,width/height attributes.  Since
getBBox is always returned in the local user coordinate
system it may appear that you are getting the bounds of
the symbol element.

   What you appear to want is the bounds of the use element
in it's parent's coordinate system.  In which case you
will want/need to get the transform from the use to it's parent
and apply that transform to the bounds returned by
'getBBox' (which is really preferred over getting the bounds
from the graphics node).

> On 7/19/06, Andreas Neumann <[EMAIL PROTECTED]> wrote:
> Hi Charles,
> 
> how did you get the reference to the graphics node?
> 
> with evt. target?
> 
> if yes, you have to be aware that with use elements you get a reference
> to the original element (in your case it seems to be a symbol tag). You 
> can use evt.currentTarget instead to get a reference to the <use/>
> element, but you have to set the event handler attribute directly on the
> use element. It doesn't work if you put it on the parent group.
> 
> Andreas
> 
> Charles Abreu wrote:
> 
> > I've been successfully calling bridgeContex.getGraphicsNode(element)
> > to get the graphics node of an element and next obtaining its screen
> > coordinates, as somebody told me how to do it (thanks!). But when I've 

> > tried the same with <use> elements, I always got the coordiantes of
> > the referenced <symbol> tag, even if I override them in the <use> tag.
> > How can I get the coordinates from the cloned <use> element instead? 
> >
> > Thanks in advance,
> > Charles
> 
> 
> 
> --
> ----------------------------------------------
> Andreas Neumann
> Institute of Cartography
> ETH Zurich
> Wolfgang-Paulistrasse 15
> CH-8093  Zurich, Switzerland 
> 
> Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
> e-mail: [EMAIL PROTECTED]
> www: http://www.carto.net/neumann/ 
> SVG.Open: http://www.svgopen.org/
> Carto.net: http://www.carto.net/
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to