xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Neumann <neum...@karto.baug.ethz.ch>
Subject Re: Accessing event coordinates when zoomed
Date Wed, 14 Jun 2006 06:54:51 GMT

>We only need to support Adobe Viewer, so I've tried to use some JS similar
>to that in the mapApp.js as suggested.
if you use my "mapApp" object it should just work.

If you launch the tooltip example 
(http://www.carto.net/papers/svg/gui/tooltips/) and zoom in with the 
Adobe viewer, the tooltips still properly follow the mouse. They don't 
compensate for the scale (means that the tooltips scale) but they follow 
the mouse properly.

>I call it like this...
>function getMyCoords(evt){
>      // Pass in the event from the screen
>	var thePoint = calcCoord(evt);
>	// get the zoomed/panned values from the point      
>	x = thePoint.getX();
>      y = thePoint.getY();

calcCoord() is a method of the mapApp object, not a standalone function. 
Maybe if you rewrote the function it should work as well. But the mapApp 
object also takes into account the use of viewBoxes (I recommend to use 
viewBoxes anyway). What calcCoord returns is an SVGPoint.


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: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message