I need to build a map system for a GIS with some elements' size independent
by the zoom level applied.

I've found a lot of questions about this issue but nobody looks like to have
an idea on what to do, so I hope the Batik's designers could give an idea on
what to do, or take this topic as an idea for improving a new functionality
to this really useful library (this would give Batik even more value,
because this kind of applications erally need these features).

Such zoom-invariant elements are for example the stroke size of the streets,
the size of text, some drawings size (like the car accident), ecc.. I
understand it's a large problem.

The approach about stroke sizes could be to modify the DOM element's
property with:


            element.setAttributeNS("stroke-size", ..whatever..);


This works, but this approach modifies the DOM elements properties and is
not really elegant.
So another solution could be to bind DOM with GVT using the rendered objects
of the GVT by the BridgeContext and modifying the affinetransform of them,
like:


            GraphicsNode graphicsNode =
bridgeContext.getGraphicsNode(element);
            AffineTransform at = graphicsNode.getTransform();


..and then applying it the inverse CTM of the root node. But this even
doesn't work, because the transformation gives back an element which doesn't
fit on the previous Bounding Box.
I was thinking to try to apply also the previous bounding box to the
element, but how?

Another approach could be to modify the stroke rendering size with the
StrokeShapePainter, like:


            StrokeShapePainter ssp = new StrokeShapePainter();
            ssp.setShape(elementShape);
            ssp.setStroke(new Stroke(..whatever..));


..but how to determine the elementStroke Shape object? I can't understand
which Java interfaces and object to call. Maybe the
org.apache.batik.gvt.ShapeNode class, but how?

And what about text size? How could I change it dinamically depending on
zoom size if I neither can get a zoom factor?

There are no examples for these issues and following the abstract
dependencies of the library is really hard. It would be nice to have some
"generic example code" to insert inside mine, like the great examples that
are actually on the site.

Please help, I'm not an experienced Java programmer and my work actually
depends on this.
Waiting for an answer of yours I congratulate for the work you've done for
supporting the SVG format on Java with such a big open project.




Thank you.




-- 
View this message in context: 
http://www.nabble.com/Dynamic-Elements-on-zoom-tp23584458p23584458.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to