diff --git a/externs/olx.js b/externs/olx.js index 30bf226baa..d819468aba 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -4106,7 +4106,6 @@ olx.source.TileImageOptions.prototype.wrapX; * projection: ol.proj.ProjectionLike, * state: (ol.source.State|string|undefined), * format: (ol.format.Feature|undefined), - * rightHandedPolygons: (boolean|undefined), * tileClass: (function(new: ol.VectorTile, ol.TileCoord, * ol.TileState, string, ol.format.Feature, * ol.TileLoadFunctionType)|undefined), @@ -4153,16 +4152,6 @@ olx.source.VectorTileOptions.prototype.opaque; olx.source.VectorTileOptions.prototype.projection; -/** - * Assume that all polygons provided by this source follow the right-hand rule - * (counter-clockwise for exterior and clockwise for interior rings). If `true`, - * renderers will skip the check for the ring orientation. - * @type {boolean|undefined} - * @api - */ -olx.source.VectorTileOptions.prototype.rightHandedPolygons; - - /** * Source state. * @type {ol.source.State|string|undefined} diff --git a/src/ol/format/featureformat.js b/src/ol/format/featureformat.js index 25c10aa79d..67f8ed20da 100644 --- a/src/ol/format/featureformat.js +++ b/src/ol/format/featureformat.js @@ -24,6 +24,12 @@ ol.format.Feature = function() { * @type {ol.proj.Projection} */ this.defaultDataProjection = null; + + /** + * @protected + * @type {boolean} + */ + this.rightHandedPolygons = false; }; @@ -53,6 +59,14 @@ ol.format.Feature.prototype.getReadOptions = function(source, opt_options) { }; +/** + * @return {boolean} + */ +ol.format.Feature.prototype.getRightHandedPolygons = function() { + return this.rightHandedPolygons; +}; + + /** * Sets the `defaultDataProjection` on the options, if no `dataProjection` * is set. diff --git a/src/ol/format/mvtformat.js b/src/ol/format/mvtformat.js index 0b8a07acd2..e22535bf83 100644 --- a/src/ol/format/mvtformat.js +++ b/src/ol/format/mvtformat.js @@ -75,6 +75,8 @@ ol.format.MVT = function(opt_options) { */ this.layers_ = goog.isDef(options.layers) ? options.layers : null; + this.rightHandedPolygons = true; + }; goog.inherits(ol.format.MVT, ol.format.Feature); diff --git a/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js b/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js index ee45b7649d..a990815b5c 100644 --- a/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js +++ b/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js @@ -196,7 +196,8 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile, var tileResolution = pixelSpace ? source.getTilePixelRatio() : resolution; replayState.dirty = false; var replayGroup = new ol.render.canvas.ReplayGroup(0, extent, - tileResolution, layer.getRenderBuffer(), source.getRightHandedPolygons()); + tileResolution, layer.getRenderBuffer(), + tile.getFormat().getRightHandedPolygons()); var squaredTolerance = ol.renderer.vector.getSquaredTolerance( tileResolution, pixelRatio);