Introduce new overlaps option for Vector and VectorTile sources
Instead of deciding whether to batch fills and strokes by looking at the opacity of the style, we now rely on user input.
This commit is contained in:
@@ -113,7 +113,7 @@ ol.source.ImageVector.prototype.canvasFunctionInternal_ = function(extent, resol
|
||||
|
||||
var replayGroup = new ol.render.canvas.ReplayGroup(
|
||||
ol.renderer.vector.getTolerance(resolution, pixelRatio), extent,
|
||||
resolution, this.renderBuffer_);
|
||||
resolution, this.source_.getOverlaps(), this.renderBuffer_);
|
||||
|
||||
this.source_.loadFeatures(extent, resolution, projection);
|
||||
|
||||
|
||||
@@ -94,6 +94,12 @@ ol.source.Vector = function(opt_options) {
|
||||
*/
|
||||
this.format_ = options.format;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.overlaps_ = options.overlaps == undefined ? true : options.overlaps;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string|ol.FeatureUrlFunction|undefined}
|
||||
@@ -695,6 +701,14 @@ ol.source.Vector.prototype.getFormat = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} The source can have overlapping geometries.
|
||||
*/
|
||||
ol.source.Vector.prototype.getOverlaps = function() {
|
||||
return this.overlaps_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the url associated with this source.
|
||||
*
|
||||
|
||||
@@ -52,6 +52,12 @@ ol.source.VectorTile = function(options) {
|
||||
*/
|
||||
this.format_ = options.format ? options.format : null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.overlaps_ = options.overlaps || true;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {function(new: ol.VectorTile, ol.TileCoord, ol.Tile.State, string,
|
||||
@@ -63,6 +69,14 @@ ol.source.VectorTile = function(options) {
|
||||
ol.inherits(ol.source.VectorTile, ol.source.UrlTile);
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} The source can have overlapping geometries.
|
||||
*/
|
||||
ol.source.VectorTile.prototype.getOverlaps = function() {
|
||||
return this.overlaps_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user