OpenLayers OpenLayers

Ticket #821 (closed bug: fixed)

Opened 1 year ago

Last modified 1 year ago

SVG flip Y value

Reported by: euzuro Assigned to:
Priority: minor Milestone: 2.6 Release
Component: Renderer.SVG Version: 2.4
Keywords: Cc:
State: Complete

Description

From Domenico F. on dev:

 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])
You have a bad flip effect.
Why you don't flip only coordinates value of the center of gravity?

[1] http://www.w3.org/TR/SVG/text.html#TextElement

Attachments

patch-821-r5408-A0.diff (2.4 kB) - added by pgiraud on 12/14/07 10:09:30.
patch-821-r5408-B0.diff (3.7 kB) - added by pgiraud on 12/14/07 10:14:50.
same patch as Apoint.x with tests

Change History

07/09/07 16:04:03 changed by euzuro

Update from cr5:

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.

12/13/07 23:22:07 changed by crschmidt

Pierre, or others working on the label drawing in the vector layer: have you done this? can you turn it into a minimal patch for this ticket?

12/14/07 10:09:15 changed by pgiraud

I don't have any problems since I apply the same transformation to the text element.

Though, I tried to remove all transform calls and it seems to work with minor modifications. See attached patch.

12/14/07 10:09:30 changed by pgiraud

  • attachment patch-821-r5408-A0.diff added.

12/14/07 10:09:56 changed by pgiraud

  • state set to Review.

12/14/07 10:14:50 changed by pgiraud

  • attachment patch-821-r5408-B0.diff added.

same patch as Apoint.x with tests

12/15/07 11:24:56 changed by crschmidt

  • status changed from new to closed.
  • state changed from Review to Complete.
  • resolution set to fixed.

Thanks Pierre: committed in r5430.