Ticket #2872 (closed bug: duplicate)

Opened 3 years ago

Last modified 22 months ago

Correct Longitude Labels on Grid Layer across dateline

Reported by: cayenne Owned by:
Priority: minor Milestone: 2.11 Release
Component: Util Version: 2.11 RC1
Keywords: grid, longitude Cc:
State:

Description

When applying the OpenLayers.Control.Graticule to a map that wraps around the dateline (180 degrees east or west), if you drag the map past the dateline, you get incorrect labels like 200W, which should be 160E.

This is wrong, but both minor and easily fixed.

In the OpenLayers.Util.getFormattedLonLat module, insert the following line: coordinate = (coordinate+540)%360 - 180; // normalize for sphere

This code will take any value over 180 and wrap it around. This is still not quite right for latitude with a horribly incorrect value above 90, so we can wrap it in a

if(axis='lon'){coordinate = (coordinate+540)%360 - 180;}

Change History

Changed 22 months ago by ahocevar

  • status changed from new to closed
  • resolution set to fixed

duplicate of #3411

Changed 22 months ago by tschaub

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 22 months ago by tschaub

  • status changed from reopened to closed
  • version changed from 2.10 to 2.11 RC1
  • resolution set to duplicate
  • milestone changed from 2.12 Release to 2.11 Release
Note: See TracTickets for help on using tickets.