Update graticule.js - fixed style / missing line

My comment on line 375 was too long, so I broke it up into multiple lines. Also I accidentally left a line out of the commit (line 384) when transcribing my changes into the web based editor.
This commit is contained in:
Ryan Curry
2015-07-02 12:35:38 -07:00
parent 56e871f8b5
commit 9a44895d41
+3 -1
View File
@@ -372,7 +372,8 @@ ol.Graticule.prototype.handlePostCompose_ = function(e) {
this.updateProjectionInfo_(projection); this.updateProjectionInfo_(projection);
} }
//Fix the extent if wrapped (note: this is the same extent as vectorContext.extent_) //Fix the extent if wrapped.
//(note: this is the same extent as vectorContext.extent_)
var offsetX = 0; var offsetX = 0;
if (projection.canWrapX()) { if (projection.canWrapX()) {
var projectionExtent = projection.getExtent(); var projectionExtent = projection.getExtent();
@@ -380,6 +381,7 @@ ol.Graticule.prototype.handlePostCompose_ = function(e) {
var x = frameState.focus[0]; var x = frameState.focus[0];
if (x < projectionExtent[0] || x > projectionExtent[2]) { if (x < projectionExtent[0] || x > projectionExtent[2]) {
var worldsAway = Math.ceil((projectionExtent[0] - x) / worldWidth); var worldsAway = Math.ceil((projectionExtent[0] - x) / worldWidth);
offsetX = worldWidth * worldsAway;
extent = [ extent = [
extent[0] + offsetX, extent[1], extent[0] + offsetX, extent[1],
extent[2] + offsetX, extent[3] extent[2] + offsetX, extent[3]