Correctly draw polygons with transparent border

This commit is contained in:
GaborFarkas
2016-10-10 17:19:25 +02:00
parent 3af5c2805e
commit e124b34b24
2 changed files with 8 additions and 8 deletions

View File

@@ -495,6 +495,7 @@ ol.render.webgl.LineStringReplay.prototype.drawReplay = function(gl, context, sk
gl.enable(gl.DEPTH_TEST);
gl.depthMask(true);
gl.depthFunc(gl.NOTEQUAL);
gl.clear(gl.DEPTH_BUFFER_BIT);
}
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
@@ -515,7 +516,6 @@ ol.render.webgl.LineStringReplay.prototype.drawReplay = function(gl, context, sk
}
}
if (!hitDetection) {
gl.clear(gl.DEPTH_BUFFER_BIT);
gl.disable(gl.DEPTH_TEST);
//Restore GL parameters.
gl.depthMask(tmpDepthMask);

View File

@@ -252,6 +252,13 @@ ol.render.webgl.Replay.prototype.replay = function(context,
featureCallback, oneByOne, opt_hitExtent) {
var gl = context.getGL();
if (this.lineStringReplay) {
this.lineStringReplay.replay(context,
center, resolution, rotation, size, pixelRatio,
opacity, skippedFeaturesHash,
featureCallback, oneByOne, opt_hitExtent);
}
// bind the vertices buffer
ol.DEBUG && console.assert(this.verticesBuffer,
'verticesBuffer must not be null');
@@ -299,13 +306,6 @@ ol.render.webgl.Replay.prototype.replay = function(context,
// disable the vertex attrib arrays
this.shutDownProgram_(gl, locations);
if (this.lineStringReplay) {
this.lineStringReplay.replay(context,
center, resolution, rotation, size, pixelRatio,
opacity, skippedFeaturesHash,
featureCallback, oneByOne, opt_hitExtent);
}
return result;
};