Fix typos
This commit is contained in:
@@ -452,7 +452,7 @@ ol.render.webgl.ImageReplay.prototype.setUpProgram = function(gl, context, size,
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.ImageReplay.prototype.shutDownProgram_ = function(gl, locations) {
|
ol.render.webgl.ImageReplay.prototype.shutDownProgram = function(gl, locations) {
|
||||||
gl.disableVertexAttribArray(locations.a_position);
|
gl.disableVertexAttribArray(locations.a_position);
|
||||||
gl.disableVertexAttribArray(locations.a_offsets);
|
gl.disableVertexAttribArray(locations.a_offsets);
|
||||||
gl.disableVertexAttribArray(locations.a_texCoord);
|
gl.disableVertexAttribArray(locations.a_texCoord);
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
|
|||||||
if (closed) {
|
if (closed) {
|
||||||
//A closed line! Complete the circle.
|
//A closed line! Complete the circle.
|
||||||
p0 = [flatCoordinates[end - stride * 2],
|
p0 = [flatCoordinates[end - stride * 2],
|
||||||
flatCoordinates[end - stride * 2 + 1]];
|
flatCoordinates[end - stride * 2 + 1]];
|
||||||
|
|
||||||
startCoords = p2;
|
startCoords = p2;
|
||||||
} else {
|
} else {
|
||||||
@@ -476,7 +476,7 @@ ol.render.webgl.LineStringReplay.prototype.setUpProgram = function(gl, context,
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.LineStringReplay.prototype.shutDownProgram_ = function(gl, locations) {
|
ol.render.webgl.LineStringReplay.prototype.shutDownProgram = function(gl, locations) {
|
||||||
gl.disableVertexAttribArray(locations.a_lastPos);
|
gl.disableVertexAttribArray(locations.a_lastPos);
|
||||||
gl.disableVertexAttribArray(locations.a_position);
|
gl.disableVertexAttribArray(locations.a_position);
|
||||||
gl.disableVertexAttribArray(locations.a_nextPos);
|
gl.disableVertexAttribArray(locations.a_nextPos);
|
||||||
|
|||||||
@@ -136,13 +136,13 @@ ol.render.webgl.PolygonReplay.prototype.processFlatCoordinates_ = function(
|
|||||||
p1 = this.createPoint_(flatCoordinates[i], flatCoordinates[i + 1], n++);
|
p1 = this.createPoint_(flatCoordinates[i], flatCoordinates[i + 1], n++);
|
||||||
segments.push(this.insertItem_(p0, p1, list));
|
segments.push(this.insertItem_(p0, p1, list));
|
||||||
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
||||||
Math.max(p0.y, p1.y)]);
|
Math.max(p0.y, p1.y)]);
|
||||||
maxX = flatCoordinates[i] > maxX ? flatCoordinates[i] : maxX;
|
maxX = flatCoordinates[i] > maxX ? flatCoordinates[i] : maxX;
|
||||||
p0 = p1;
|
p0 = p1;
|
||||||
}
|
}
|
||||||
segments.push(this.insertItem_(p1, start, list));
|
segments.push(this.insertItem_(p1, start, list));
|
||||||
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
||||||
Math.max(p0.y, p1.y)]);
|
Math.max(p0.y, p1.y)]);
|
||||||
} else {
|
} else {
|
||||||
var end = flatCoordinates.length - stride;
|
var end = flatCoordinates.length - stride;
|
||||||
start = this.createPoint_(flatCoordinates[end], flatCoordinates[end + 1], n++);
|
start = this.createPoint_(flatCoordinates[end], flatCoordinates[end + 1], n++);
|
||||||
@@ -152,13 +152,13 @@ ol.render.webgl.PolygonReplay.prototype.processFlatCoordinates_ = function(
|
|||||||
p1 = this.createPoint_(flatCoordinates[i], flatCoordinates[i + 1], n++);
|
p1 = this.createPoint_(flatCoordinates[i], flatCoordinates[i + 1], n++);
|
||||||
segments.push(this.insertItem_(p0, p1, list));
|
segments.push(this.insertItem_(p0, p1, list));
|
||||||
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
||||||
Math.max(p0.y, p1.y)]);
|
Math.max(p0.y, p1.y)]);
|
||||||
maxX = flatCoordinates[i] > maxX ? flatCoordinates[i] : maxX;
|
maxX = flatCoordinates[i] > maxX ? flatCoordinates[i] : maxX;
|
||||||
p0 = p1;
|
p0 = p1;
|
||||||
}
|
}
|
||||||
segments.push(this.insertItem_(p1, start, list));
|
segments.push(this.insertItem_(p1, start, list));
|
||||||
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
extents.push([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y), Math.max(p0.x, p1.x),
|
||||||
Math.max(p0.y, p1.y)]);
|
Math.max(p0.y, p1.y)]);
|
||||||
}
|
}
|
||||||
rtree.load(extents, segments);
|
rtree.load(extents, segments);
|
||||||
|
|
||||||
@@ -360,7 +360,7 @@ ol.render.webgl.PolygonReplay.prototype.clipEars_ = function(list, rtree, simple
|
|||||||
//The diagonal is completely inside the polygon
|
//The diagonal is completely inside the polygon
|
||||||
if (simple || p0.reflex === false || p2.reflex === false ||
|
if (simple || p0.reflex === false || p2.reflex === false ||
|
||||||
ol.geom.flat.orient.linearRingIsClockwise([s0.p0.x, s0.p0.y, p0.x,
|
ol.geom.flat.orient.linearRingIsClockwise([s0.p0.x, s0.p0.y, p0.x,
|
||||||
p0.y, p1.x, p1.y, p2.x, p2.y, s3.p1.x, s3.p1.y], 0, 10, 2) === !ccw) {
|
p0.y, p1.x, p1.y, p2.x, p2.y, s3.p1.x, s3.p1.y], 0, 10, 2) === !ccw) {
|
||||||
//The diagonal is persumably valid, we have an ear
|
//The diagonal is persumably valid, we have an ear
|
||||||
this.indices[numIndices++] = p0.i;
|
this.indices[numIndices++] = p0.i;
|
||||||
this.indices[numIndices++] = p1.i;
|
this.indices[numIndices++] = p1.i;
|
||||||
@@ -431,9 +431,9 @@ ol.render.webgl.PolygonReplay.prototype.resolveLocalSelfIntersections_ = functio
|
|||||||
s0.p1 = p;
|
s0.p1 = p;
|
||||||
s1.p0 = p;
|
s1.p0 = p;
|
||||||
rtree.update([Math.min(s0.p0.x, s0.p1.x), Math.min(s0.p0.y, s0.p1.y),
|
rtree.update([Math.min(s0.p0.x, s0.p1.x), Math.min(s0.p0.y, s0.p1.y),
|
||||||
Math.max(s0.p0.x, s0.p1.x), Math.max(s0.p0.y, s0.p1.y)], s0);
|
Math.max(s0.p0.x, s0.p1.x), Math.max(s0.p0.y, s0.p1.y)], s0);
|
||||||
rtree.update([Math.min(s1.p0.x, s1.p1.x), Math.min(s1.p0.y, s1.p1.y),
|
rtree.update([Math.min(s1.p0.x, s1.p1.x), Math.min(s1.p0.y, s1.p1.y),
|
||||||
Math.max(s1.p0.x, s1.p1.x), Math.max(s1.p0.y, s1.p1.y)], s1);
|
Math.max(s1.p0.x, s1.p1.x), Math.max(s1.p0.y, s1.p1.y)], s1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.indices[numIndices++] = seg.p0.i;
|
this.indices[numIndices++] = seg.p0.i;
|
||||||
@@ -513,7 +513,7 @@ ol.render.webgl.PolygonReplay.prototype.splitPolygon_ = function(list, rtree) {
|
|||||||
this.insertItem_(p, s0.p1, newPolygon, newRtree);
|
this.insertItem_(p, s0.p1, newPolygon, newRtree);
|
||||||
s0.p1 = p;
|
s0.p1 = p;
|
||||||
rtree.update([Math.min(s0.p0.x, p.x), Math.min(s0.p0.y, p.y),
|
rtree.update([Math.min(s0.p0.x, p.x), Math.min(s0.p0.y, p.y),
|
||||||
Math.max(s0.p0.x, p.x), Math.max(s0.p0.y, p.y)], s0);
|
Math.max(s0.p0.x, p.x), Math.max(s0.p0.y, p.y)], s0);
|
||||||
var currItem = list.nextItem();
|
var currItem = list.nextItem();
|
||||||
while (currItem !== s1) {
|
while (currItem !== s1) {
|
||||||
this.insertItem_(currItem.p0, currItem.p1, newPolygon, newRtree);
|
this.insertItem_(currItem.p0, currItem.p1, newPolygon, newRtree);
|
||||||
@@ -524,7 +524,7 @@ ol.render.webgl.PolygonReplay.prototype.splitPolygon_ = function(list, rtree) {
|
|||||||
this.insertItem_(s1.p0, p, newPolygon, newRtree);
|
this.insertItem_(s1.p0, p, newPolygon, newRtree);
|
||||||
s1.p0 = p;
|
s1.p0 = p;
|
||||||
rtree.update([Math.min(s1.p1.x, p.x), Math.min(s1.p1.y, p.y),
|
rtree.update([Math.min(s1.p1.x, p.x), Math.min(s1.p1.y, p.y),
|
||||||
Math.max(s1.p1.x, p.x), Math.max(s1.p1.y, p.y)], s1);
|
Math.max(s1.p1.x, p.x), Math.max(s1.p1.y, p.y)], s1);
|
||||||
this.classifyPoints_(list, rtree, false);
|
this.classifyPoints_(list, rtree, false);
|
||||||
this.triangulate_(list, rtree);
|
this.triangulate_(list, rtree);
|
||||||
this.classifyPoints_(newPolygon, newRtree, false);
|
this.classifyPoints_(newPolygon, newRtree, false);
|
||||||
@@ -574,7 +574,7 @@ ol.render.webgl.PolygonReplay.prototype.insertItem_ = function(p0, p1, list, opt
|
|||||||
list.insertItem(seg);
|
list.insertItem(seg);
|
||||||
if (opt_rtree) {
|
if (opt_rtree) {
|
||||||
opt_rtree.insert([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y),
|
opt_rtree.insert([Math.min(p0.x, p1.x), Math.min(p0.y, p1.y),
|
||||||
Math.max(p0.x, p1.x), Math.max(p0.y, p1.y)], seg);
|
Math.max(p0.x, p1.x), Math.max(p0.y, p1.y)], seg);
|
||||||
}
|
}
|
||||||
return seg;
|
return seg;
|
||||||
};
|
};
|
||||||
@@ -612,7 +612,7 @@ ol.render.webgl.PolygonReplay.prototype.getPointsInTriangle_ = function(p0, p1,
|
|||||||
var i, ii, j, p;
|
var i, ii, j, p;
|
||||||
var result = [];
|
var result = [];
|
||||||
var segmentsInExtent = rtree.getInExtent([Math.min(p0.x, p1.x, p2.x),
|
var segmentsInExtent = rtree.getInExtent([Math.min(p0.x, p1.x, p2.x),
|
||||||
Math.min(p0.y, p1.y, p2.y), Math.max(p0.x, p1.x, p2.x), Math.max(p0.y,
|
Math.min(p0.y, p1.y, p2.y), Math.max(p0.x, p1.x, p2.x), Math.max(p0.y,
|
||||||
p1.y, p2.y)]);
|
p1.y, p2.y)]);
|
||||||
for (i = 0, ii = segmentsInExtent.length; i < ii; ++i) {
|
for (i = 0, ii = segmentsInExtent.length; i < ii; ++i) {
|
||||||
for (j in segmentsInExtent[i]) {
|
for (j in segmentsInExtent[i]) {
|
||||||
@@ -621,7 +621,7 @@ ol.render.webgl.PolygonReplay.prototype.getPointsInTriangle_ = function(p0, p1,
|
|||||||
if ((p.x !== p0.x || p.y !== p0.y) && (p.x !== p1.x || p.y !== p1.y) &&
|
if ((p.x !== p0.x || p.y !== p0.y) && (p.x !== p1.x || p.y !== p1.y) &&
|
||||||
(p.x !== p2.x || p.y !== p2.y) && result.indexOf(p) === -1 &&
|
(p.x !== p2.x || p.y !== p2.y) && result.indexOf(p) === -1 &&
|
||||||
ol.geom.flat.contains.linearRingContainsXY([p0.x, p0.y, p1.x, p1.y,
|
ol.geom.flat.contains.linearRingContainsXY([p0.x, p0.y, p1.x, p1.y,
|
||||||
p2.x, p2.y], 0, 6, 2, p.x, p.y)) {
|
p2.x, p2.y], 0, 6, 2, p.x, p.y)) {
|
||||||
result.push(p);
|
result.push(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -642,7 +642,7 @@ ol.render.webgl.PolygonReplay.prototype.getIntersections_ = function(segment, rt
|
|||||||
var p0 = segment.p0;
|
var p0 = segment.p0;
|
||||||
var p1 = segment.p1;
|
var p1 = segment.p1;
|
||||||
var segmentsInExtent = rtree.getInExtent([Math.min(p0.x, p1.x),
|
var segmentsInExtent = rtree.getInExtent([Math.min(p0.x, p1.x),
|
||||||
Math.min(p0.y, p1.y), Math.max(p0.x, p1.x), Math.max(p0.y, p1.y)]);
|
Math.min(p0.y, p1.y), Math.max(p0.x, p1.x), Math.max(p0.y, p1.y)]);
|
||||||
var result = [];
|
var result = [];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = segmentsInExtent.length; i < ii; ++i) {
|
for (i = 0, ii = segmentsInExtent.length; i < ii; ++i) {
|
||||||
@@ -861,7 +861,7 @@ ol.render.webgl.PolygonReplay.prototype.setUpProgram = function(gl, context, siz
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.PolygonReplay.prototype.shutDownProgram_ = function(gl, locations) {
|
ol.render.webgl.PolygonReplay.prototype.shutDownProgram = function(gl, locations) {
|
||||||
gl.disableVertexAttribArray(locations.a_position);
|
gl.disableVertexAttribArray(locations.a_position);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -152,12 +152,12 @@ ol.render.webgl.Replay.prototype.setUpProgram = function(gl, context, size, pixe
|
|||||||
ol.render.webgl.linestringreplay.defaultshader.Locations|
|
ol.render.webgl.linestringreplay.defaultshader.Locations|
|
||||||
ol.render.webgl.polygonreplay.defaultshader.Locations} locations Locations.
|
ol.render.webgl.polygonreplay.defaultshader.Locations} locations Locations.
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.Replay.prototype.shutDownProgram_ = function(gl, locations) {};
|
ol.render.webgl.Replay.prototype.shutDownProgram = function(gl, locations) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @private
|
* @protected
|
||||||
* @param {WebGLRenderingContext} gl gl.
|
* @param {WebGLRenderingContext} gl gl.
|
||||||
* @param {ol.webgl.Context} context Context.
|
* @param {ol.webgl.Context} context Context.
|
||||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||||
@@ -329,7 +329,7 @@ ol.render.webgl.Replay.prototype.replay = function(context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// disable the vertex attrib arrays
|
// disable the vertex attrib arrays
|
||||||
this.shutDownProgram_(gl, locations);
|
this.shutDownProgram(gl, locations);
|
||||||
|
|
||||||
if (this.lineStringReplay) {
|
if (this.lineStringReplay) {
|
||||||
if (!tmpStencil) {
|
if (!tmpStencil) {
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ describe('ol.render.webgl.LineStringReplay', function() {
|
|||||||
var multilinestring;
|
var multilinestring;
|
||||||
|
|
||||||
multilinestring = new ol.geom.MultiLineString(
|
multilinestring = new ol.geom.MultiLineString(
|
||||||
[[[1000, 2000], [2000, 3000]],
|
[[[1000, 2000], [2000, 3000]],
|
||||||
[[1000, 3000], [2000, 4000], [3000, 3000]]]);
|
[[1000, 3000], [2000, 4000], [3000, 3000]]]);
|
||||||
replay.setFillStrokeStyle(null, strokeStyle1);
|
replay.setFillStrokeStyle(null, strokeStyle1);
|
||||||
replay.drawMultiLineString(multilinestring, null);
|
replay.drawMultiLineString(multilinestring, null);
|
||||||
expect(replay.vertices).to.have.length(140);
|
expect(replay.vertices).to.have.length(140);
|
||||||
@@ -111,7 +111,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
|
|||||||
replay.drawCoordinates_(flatCoordinates, 0,
|
replay.drawCoordinates_(flatCoordinates, 0,
|
||||||
flatCoordinates.length, 2);
|
flatCoordinates.length, 2);
|
||||||
expect(replay.indices).to.eql(
|
expect(replay.indices).to.eql(
|
||||||
[2, 0, 1, 4, 2, 1,
|
[2, 0, 1, 4, 2, 1,
|
||||||
2, 4, 3,
|
2, 4, 3,
|
||||||
5, 3, 4, 4, 6, 5]);
|
5, 3, 4, 4, 6, 5]);
|
||||||
});
|
});
|
||||||
@@ -131,7 +131,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
|
|||||||
replay.drawCoordinates_(flatCoordinates, 0,
|
replay.drawCoordinates_(flatCoordinates, 0,
|
||||||
flatCoordinates.length, 2);
|
flatCoordinates.length, 2);
|
||||||
expect(replay.indices).to.eql(
|
expect(replay.indices).to.eql(
|
||||||
[2, 0, 1, 4, 2, 1,
|
[2, 0, 1, 4, 2, 1,
|
||||||
2, 4, 3, 3, 5, 2,
|
2, 4, 3, 3, 5, 2,
|
||||||
6, 3, 4, 4, 7, 6]);
|
6, 3, 4, 4, 7, 6]);
|
||||||
});
|
});
|
||||||
@@ -150,7 +150,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
|
|||||||
replay.drawCoordinates_(flatCoordinates, 0,
|
replay.drawCoordinates_(flatCoordinates, 0,
|
||||||
flatCoordinates.length, 2);
|
flatCoordinates.length, 2);
|
||||||
expect(replay.indices).to.eql(
|
expect(replay.indices).to.eql(
|
||||||
[2, 0, 1, 1, 3, 2,
|
[2, 0, 1, 1, 3, 2,
|
||||||
4, 2, 3, 6, 4, 3,
|
4, 2, 3, 6, 4, 3,
|
||||||
4, 6, 5, 5, 7, 4,
|
4, 6, 5, 5, 7, 4,
|
||||||
8, 5, 6, 6, 9, 8,
|
8, 5, 6, 6, 9, 8,
|
||||||
@@ -173,7 +173,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
|
|||||||
replay.drawCoordinates_(flatCoordinates, 0,
|
replay.drawCoordinates_(flatCoordinates, 0,
|
||||||
flatCoordinates.length, 2);
|
flatCoordinates.length, 2);
|
||||||
expect(replay.indices).to.eql(
|
expect(replay.indices).to.eql(
|
||||||
[2, 0, 1, 4, 2, 0,
|
[2, 0, 1, 4, 2, 0,
|
||||||
2, 4, 3,
|
2, 4, 3,
|
||||||
5, 3, 4, 4, 6, 5]);
|
5, 3, 4, 4, 6, 5]);
|
||||||
});
|
});
|
||||||
@@ -194,7 +194,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
|
|||||||
replay.drawCoordinates_(flatCoordinates, 0,
|
replay.drawCoordinates_(flatCoordinates, 0,
|
||||||
flatCoordinates.length, 2);
|
flatCoordinates.length, 2);
|
||||||
expect(replay.indices).to.eql(
|
expect(replay.indices).to.eql(
|
||||||
[0, 2, 1, 3, 1, 2,
|
[0, 2, 1, 3, 1, 2,
|
||||||
5, 3, 2,
|
5, 3, 2,
|
||||||
3, 5, 4, 6, 4, 5,
|
3, 5, 4, 6, 4, 5,
|
||||||
8, 6, 5,
|
8, 6, 5,
|
||||||
|
|||||||
Reference in New Issue
Block a user