Ticket #3521 (closed feature: fixed)

Opened 20 months ago

Last modified 20 months ago

Dateline handling improvements for grid layers

Reported by: ahocevar Owned by: elemoine
Priority: minor Milestone: 2.12 Release
Component: Layer.Grid Version: 2.11
Keywords: Cc:
State: Commit

Description

Currently there are several issues with grid layers that cross the dateline. The attached patch fixes them. Thanks for any review.

Attachments

openlayers-3521.patch Download (6.6 KB) - added by ahocevar 20 months ago.

Change History

Changed 20 months ago by ahocevar

Changed 20 months ago by ahocevar

  • state set to Review
  • version changed from 2.11 RC3 to 2.11

This patch does 4 things:

  • Make clear in the APIdocs that the wrapDateLine option makes sense on the base layer only, and only when the base layer's extent is the world extent.
  • When calculating the grid layout, shift the left bound to the right until it is within the world extent,
  • When setting the bounds of a tile, wrap them around the dateline to avoid tile bounds that exceed the world bounds
  • The Tile's shouldDraw method checks now against up to 3 different extents, depending on if or how the extent crosses the dateline.

This means that layers that cross the dateline can no be used, and the according tiles will always be displayed when they are inside the viewport.

Changed 20 months ago by ahocevar

The patch also includes a manual test. Thanks for any review.

Changed 20 months ago by bartvde

  • state changed from Review to Commit

Hey Andreas, thanks for your work on this, I have a few questions/remarks:

  • setBounds: worldExtent can be moved inside of if statement
  • shouldDraw: should we not only push if maxExtent is changed, so when the if conditions are true?
  • it seems to me that currently the two if statements are exactly the same?
    maxExtent.left > maxExtent.right
    maxExtent.right < maxExtent.left
    
  • the manual test uses a local GeoServer

Other than this it looks great to me. Feel free to commit once these questions/remarks are addressed. Tests pass in Safari 5.1.

Changed 20 months ago by ahocevar

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.