Rename _ol_render_canvas_PolygonReplay_ to CanvasPolygonReplay
This commit is contained in:
@@ -19,13 +19,13 @@ import CanvasReplay from '../canvas/Replay.js';
|
||||
* @param {?} declutterTree Declutter tree.
|
||||
* @struct
|
||||
*/
|
||||
const _ol_render_canvas_PolygonReplay_ = function(
|
||||
const CanvasPolygonReplay = function(
|
||||
tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree) {
|
||||
CanvasReplay.call(this,
|
||||
tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree);
|
||||
};
|
||||
|
||||
inherits(_ol_render_canvas_PolygonReplay_, CanvasReplay);
|
||||
inherits(CanvasPolygonReplay, CanvasReplay);
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ inherits(_ol_render_canvas_PolygonReplay_, CanvasReplay);
|
||||
* @private
|
||||
* @return {number} End.
|
||||
*/
|
||||
_ol_render_canvas_PolygonReplay_.prototype.drawFlatCoordinatess_ = function(flatCoordinates, offset, ends, stride) {
|
||||
CanvasPolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCoordinates, offset, ends, stride) {
|
||||
const state = this.state;
|
||||
const fill = state.fillStyle !== undefined;
|
||||
const stroke = state.strokeStyle != undefined;
|
||||
@@ -79,7 +79,7 @@ _ol_render_canvas_PolygonReplay_.prototype.drawFlatCoordinatess_ = function(flat
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_render_canvas_PolygonReplay_.prototype.drawCircle = function(circleGeometry, feature) {
|
||||
CanvasPolygonReplay.prototype.drawCircle = function(circleGeometry, feature) {
|
||||
const state = this.state;
|
||||
const fillStyle = state.fillStyle;
|
||||
const strokeStyle = state.strokeStyle;
|
||||
@@ -126,7 +126,7 @@ _ol_render_canvas_PolygonReplay_.prototype.drawCircle = function(circleGeometry,
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_render_canvas_PolygonReplay_.prototype.drawPolygon = function(polygonGeometry, feature) {
|
||||
CanvasPolygonReplay.prototype.drawPolygon = function(polygonGeometry, feature) {
|
||||
const state = this.state;
|
||||
this.setFillStrokeStyles_(polygonGeometry);
|
||||
this.beginGeometry(polygonGeometry, feature);
|
||||
@@ -153,7 +153,7 @@ _ol_render_canvas_PolygonReplay_.prototype.drawPolygon = function(polygonGeometr
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_render_canvas_PolygonReplay_.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {
|
||||
CanvasPolygonReplay.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {
|
||||
const state = this.state;
|
||||
const fillStyle = state.fillStyle;
|
||||
const strokeStyle = state.strokeStyle;
|
||||
@@ -190,7 +190,7 @@ _ol_render_canvas_PolygonReplay_.prototype.drawMultiPolygon = function(multiPoly
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_render_canvas_PolygonReplay_.prototype.finish = function() {
|
||||
CanvasPolygonReplay.prototype.finish = function() {
|
||||
this.reverseHitDetectionInstructions();
|
||||
this.state = null;
|
||||
// We want to preserve topology when drawing polygons. Polygons are
|
||||
@@ -212,7 +212,7 @@ _ol_render_canvas_PolygonReplay_.prototype.finish = function() {
|
||||
* @private
|
||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
||||
*/
|
||||
_ol_render_canvas_PolygonReplay_.prototype.setFillStrokeStyles_ = function(geometry) {
|
||||
CanvasPolygonReplay.prototype.setFillStrokeStyles_ = function(geometry) {
|
||||
const state = this.state;
|
||||
const fillStyle = state.fillStyle;
|
||||
if (fillStyle !== undefined) {
|
||||
@@ -222,4 +222,4 @@ _ol_render_canvas_PolygonReplay_.prototype.setFillStrokeStyles_ = function(geome
|
||||
this.updateStrokeStyle(state, this.applyStroke);
|
||||
}
|
||||
};
|
||||
export default _ol_render_canvas_PolygonReplay_;
|
||||
export default CanvasPolygonReplay;
|
||||
|
||||
@@ -12,7 +12,7 @@ import ReplayType from '../ReplayType.js';
|
||||
import CanvasReplay from '../canvas/Replay.js';
|
||||
import CanvasImageReplay from '../canvas/ImageReplay.js';
|
||||
import _ol_render_canvas_LineStringReplay_ from '../canvas/LineStringReplay.js';
|
||||
import _ol_render_canvas_PolygonReplay_ from '../canvas/PolygonReplay.js';
|
||||
import CanvasPolygonReplay from '../canvas/PolygonReplay.js';
|
||||
import CanvasTextReplay from '../canvas/TextReplay.js';
|
||||
import _ol_render_replay_ from '../replay.js';
|
||||
import _ol_transform_ from '../../transform.js';
|
||||
@@ -497,11 +497,11 @@ CanvasReplayGroup.prototype.replay = function(context,
|
||||
* number, number, boolean, Array.<ol.DeclutterGroup>)>}
|
||||
*/
|
||||
CanvasReplayGroup.BATCH_CONSTRUCTORS_ = {
|
||||
'Circle': _ol_render_canvas_PolygonReplay_,
|
||||
'Circle': CanvasPolygonReplay,
|
||||
'Default': CanvasReplay,
|
||||
'Image': CanvasImageReplay,
|
||||
'LineString': _ol_render_canvas_LineStringReplay_,
|
||||
'Polygon': _ol_render_canvas_PolygonReplay_,
|
||||
'Polygon': CanvasPolygonReplay,
|
||||
'Text': CanvasTextReplay
|
||||
};
|
||||
export default CanvasReplayGroup;
|
||||
|
||||
@@ -8,7 +8,7 @@ import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||
import Point from '../../../../../src/ol/geom/Point.js';
|
||||
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
||||
import _ol_render_canvas_LineStringReplay_ from '../../../../../src/ol/render/canvas/LineStringReplay.js';
|
||||
import _ol_render_canvas_PolygonReplay_ from '../../../../../src/ol/render/canvas/PolygonReplay.js';
|
||||
import CanvasPolygonReplay from '../../../../../src/ol/render/canvas/PolygonReplay.js';
|
||||
import CanvasReplay from '../../../../../src/ol/render/canvas/Replay.js';
|
||||
import CanvasReplayGroup from '../../../../../src/ol/render/canvas/ReplayGroup.js';
|
||||
import _ol_renderer_vector_ from '../../../../../src/ol/renderer/vector.js';
|
||||
@@ -468,7 +468,7 @@ describe('ol.render.canvas.PolygonReplay', function() {
|
||||
const tolerance = 1;
|
||||
const extent = [-180, -90, 180, 90];
|
||||
const resolution = 10;
|
||||
replay = new _ol_render_canvas_PolygonReplay_(tolerance, extent,
|
||||
replay = new CanvasPolygonReplay(tolerance, extent,
|
||||
resolution);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user