diff --git a/src/ol/geom/simplegeometry.js b/src/ol/geom/simplegeometry.js index f8821f1192..ecd5626144 100644 --- a/src/ol/geom/simplegeometry.js +++ b/src/ol/geom/simplegeometry.js @@ -41,12 +41,6 @@ ol.geom.SimpleGeometry = function() { */ this.flatCoordinates = null; - /** - * @private - * @type {Array.|Array.>|Array.>>} - */ - this.renderCoordinates_ = null; - }; ol.inherits(ol.geom.SimpleGeometry, ol.geom.Geometry); @@ -147,18 +141,6 @@ ol.geom.SimpleGeometry.prototype.getLayout = function() { }; -/** - * @return {Array.|Array.>|Array.>>} - * Render coordinates. - */ -ol.geom.SimpleGeometry.prototype.getRenderCoordinates = function() { - if (!this.renderCoordinates_) { - this.renderCoordinates_ = []; - } - return this.renderCoordinates_; -}; - - /** * @inheritDoc */ diff --git a/src/ol/render/canvas/replay.js b/src/ol/render/canvas/replay.js index 309ce70586..406a77585d 100644 --- a/src/ol/render/canvas/replay.js +++ b/src/ol/render/canvas/replay.js @@ -88,6 +88,12 @@ ol.render.canvas.Replay = function(tolerance, maxExtent, resolution, overlaps) { */ this.coordinates = []; + /** + * @private + * @type {ol.Coordinate|Array.|Array.>} + */ + this.coordinateCache_ = {}; + /** * @private * @type {!ol.Transform} @@ -393,7 +399,10 @@ ol.render.canvas.Replay.prototype.replay_ = function( var coords; if (instruction.length == 6) { var fn = instruction[5]; - coords = fn(pixelCoordinates, d, dd, 2, geometry.getRenderCoordinates()); + if (!(d in this.coordinateCache_)) { + this.coordinateCache_[d] = []; + } + coords = fn(pixelCoordinates, d, dd, 2, this.coordinateCache_[d]); } else { coords = pixelCoordinates.slice(d, dd); } diff --git a/src/ol/render/feature.js b/src/ol/render/feature.js index 8bbec70671..702dbeb2c2 100644 --- a/src/ol/render/feature.js +++ b/src/ol/render/feature.js @@ -43,12 +43,6 @@ ol.render.Feature = function(type, flatCoordinates, ends, properties, id) { */ this.flatCoordinates_ = flatCoordinates; - /** - * @private - * @type {Array.|Array.>|Array.>>} - */ - this.renderCoordinates_ = null; - /** * @private * @type {Array.|Array.>} @@ -117,18 +111,6 @@ ol.render.Feature.prototype.getOrientedFlatCoordinates = function() { }; -/** - * @return {Array.|Array.>|Array.>>} - * Render coordinates. - */ -ol.render.Feature.prototype.getRenderCoordinates = function() { - if (!this.renderCoordinates_) { - this.renderCoordinates_ = []; - } - return this.renderCoordinates_; -}; - - /** * @return {Array.} Flat coordinates. */