Skip to content

Commit

Permalink
Merge pull request #1398 from ahocevar/graticule-dateline
Browse files Browse the repository at this point in the history
No need to go 10 times around the globe
  • Loading branch information
ahocevar committed Oct 17, 2014
2 parents c492588 + e09ab2f commit 6ccafe1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/graticule.html
Expand Up @@ -30,9 +30,9 @@
maxExtent: [-2200000,-712631,3072800,3840000],
worldExtent: [-180, 0, 180, 90]
}
// Allow date line wrapping for 10 worlds by using -1800 and 1800
// instead of -180 and 180.
OpenLayers.Projection.defaults["EPSG:4326"].worldExtent = [-1800, -90, 1800, 90];
// Enable date line wrapping by using -360 and 360 instead of -180
// and 180.
OpenLayers.Projection.defaults["EPSG:4326"].worldExtent = [-360, -90, 360, 90];
var graticuleCtl1, graticuleCtl2;
var map1, map2;
function init(){
Expand Down
2 changes: 1 addition & 1 deletion notes/2.14.md
Expand Up @@ -26,4 +26,4 @@ a `worldExtent` option. This is the extent of the world in geographic coordinate
* The control's layer (`gratLayer`) now prefers the Canvas renderer. This avoids coordinate range issues with the SVG renderer.
* Previously, meridians were only labelled at the bottom, and parallels at the right border of the map. To better support polar projections, meridians are now also labelled at the left border, and parallels at the top border, if they do not have an intersection point with the bottom or right border.
* To avoid maps with missing or short grid lines, make sure you do not use a graticule when working with a projection outside of its validity extent or recommended viewing area.
* To support date line wrapping, make sure you adjust the `worldExtent` setting for your projection in OpenLayers.Projection.defaults. To wrap the date line 10 times, set it to `[-1800, -90, 1800, 90]`.
* To support date line wrapping, make sure you adjust the min and max longitude in the `worldExtent` setting for your projection in OpenLayers.Projection.defaults. For EPSG:4326, set it to `[-360, -90, 360, 90]`. By using -360 and 360 instead of -180 and 180, the longitudinal grid lines will always connect at the date line.

0 comments on commit 6ccafe1

Please sign in to comment.