[OpenLayers-Dev] SVG flip Y value

Christopher Schmidt crschmidt at metacarta.com
Fri Jun 29 06:16:51 EDT 2007


On Fri, Jun 29, 2007 at 12:05:20PM +0200, Domenico Febbo wrote:
> Into SVG.js @ row 241 you have this method:
> "
>  createRoot: function() {
>         var id = this.container.id + "_root";
> 
>         var root = this.nodeFactory(id, "g");
> 
>         // flip the SVG display Y axis upside down so it
>         // matches the display Y axis of the map
>         root.setAttributeNS(null, "transform", "scale(1, -1)");
> 
>         return root;
>     },
> "
> I don't understand what means the flip transformation for every Y value.
> This trasformation flips every Y value of an SVG object and you don't
> have bat effect on a circle or a point because that are "simmetric" on
> Y axis, but for a "text" element (see spech here [1])

These days, we probably don't have to. In the past, we actually used
geographic coordinates -- meaning that when we draw a line from -180,-90
to 180,90 we were going up and to the right, between those two
coordinates. Now, we could do the flipping outside of this space, since
we're calculating pixel locations anyway, but the code has not yet been
changd.

Can you add a transform on text elements as well? Would that solve the
problem temporarily

Erik, can you open a ticket to track this? Probably for the 2.6 release,
we should try and reevaluate whether this makes sense, unless the text
element flipping isn't possible, in which case doing it sooner makes
sense.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list