Shorter module paths for default exports
This commit is contained in:
@@ -30,7 +30,7 @@ import {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {module:ol/render/VectorContext~VectorContext}
|
||||
* @extends {module:ol/render/VectorContext}
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Maximum extent.
|
||||
* @param {number} resolution Resolution.
|
||||
@@ -398,7 +398,7 @@ CanvasReplay.prototype.drawCustom = function(geometry, feature, renderer) {
|
||||
let flatCoordinates, replayEnd, replayEnds, replayEndss;
|
||||
let offset;
|
||||
if (type == GeometryType.MULTI_POLYGON) {
|
||||
geometry = /** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (geometry);
|
||||
geometry = /** @type {module:ol/geom/MultiPolygon} */ (geometry);
|
||||
flatCoordinates = geometry.getOrientedFlatCoordinates();
|
||||
replayEndss = [];
|
||||
const endss = geometry.getEndss();
|
||||
@@ -413,10 +413,10 @@ CanvasReplay.prototype.drawCustom = function(geometry, feature, renderer) {
|
||||
} else if (type == GeometryType.POLYGON || type == GeometryType.MULTI_LINE_STRING) {
|
||||
replayEnds = [];
|
||||
flatCoordinates = (type == GeometryType.POLYGON) ?
|
||||
/** @type {module:ol/geom/Polygon~Polygon} */ (geometry).getOrientedFlatCoordinates() :
|
||||
/** @type {module:ol/geom/Polygon} */ (geometry).getOrientedFlatCoordinates() :
|
||||
geometry.getFlatCoordinates();
|
||||
offset = this.drawCustomCoordinates_(flatCoordinates, 0,
|
||||
/** @type {module:ol/geom/Polygon~Polygon|module:ol/geom/MultiLineString~MultiLineString} */ (geometry).getEnds(),
|
||||
/** @type {module:ol/geom/Polygon|module:ol/geom/MultiLineString} */ (geometry).getEnds(),
|
||||
stride, replayEnds);
|
||||
this.instructions.push([CanvasInstruction.CUSTOM,
|
||||
replayBegin, replayEnds, geometry, renderer, inflateCoordinatesArray]);
|
||||
@@ -439,8 +439,8 @@ CanvasReplay.prototype.drawCustom = function(geometry, feature, renderer) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @param {module:ol/geom/Geometry~Geometry|module:ol/render/Feature~RenderFeature} geometry Geometry.
|
||||
* @param {module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature} feature Feature.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
*/
|
||||
CanvasReplay.prototype.beginGeometry = function(geometry, feature) {
|
||||
this.beginGeometryInstruction1_ = [CanvasInstruction.BEGIN_GEOMETRY, feature, 0];
|
||||
@@ -487,7 +487,7 @@ CanvasReplay.prototype.setStrokeStyle_ = function(context, instruction) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~DeclutterGroup} declutterGroup Declutter group.
|
||||
* @param {module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature} feature Feature.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
*/
|
||||
CanvasReplay.prototype.renderDeclutter_ = function(declutterGroup, feature) {
|
||||
if (declutterGroup && declutterGroup.length > 5) {
|
||||
@@ -529,7 +529,7 @@ CanvasReplay.prototype.renderDeclutter_ = function(declutterGroup, feature) {
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {Array.<*>} instructions Instructions array.
|
||||
* @param {function((module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature)): T|undefined}
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined}
|
||||
* featureCallback Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
@@ -575,14 +575,14 @@ CanvasReplay.prototype.replay_ = function(
|
||||
// When the batch size gets too big, performance decreases. 200 is a good
|
||||
// balance between batch size and number of fill/stroke instructions.
|
||||
const batchSize = this.instructions != instructions || this.overlaps ? 0 : 200;
|
||||
let /** @type {module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature} */ feature;
|
||||
let /** @type {module:ol/Feature|module:ol/render/Feature} */ feature;
|
||||
let x, y;
|
||||
while (i < ii) {
|
||||
const instruction = instructions[i];
|
||||
const type = /** @type {module:ol/render/canvas/Instruction~Instruction} */ (instruction[0]);
|
||||
const type = /** @type {module:ol/render/canvas/Instruction} */ (instruction[0]);
|
||||
switch (type) {
|
||||
case CanvasInstruction.BEGIN_GEOMETRY:
|
||||
feature = /** @type {module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature} */ (instruction[1]);
|
||||
feature = /** @type {module:ol/Feature|module:ol/render/Feature} */ (instruction[1]);
|
||||
if ((skipFeatures &&
|
||||
skippedFeaturesHash[getUid(feature).toString()]) ||
|
||||
!feature.getGeometry()) {
|
||||
@@ -629,7 +629,7 @@ CanvasReplay.prototype.replay_ = function(
|
||||
case CanvasInstruction.CUSTOM:
|
||||
d = /** @type {number} */ (instruction[1]);
|
||||
dd = instruction[2];
|
||||
const geometry = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (instruction[3]);
|
||||
const geometry = /** @type {module:ol/geom/SimpleGeometry} */ (instruction[3]);
|
||||
const renderer = instruction[4];
|
||||
const fn = instruction.length == 6 ? instruction[5] : undefined;
|
||||
state.geometry = geometry;
|
||||
@@ -710,7 +710,7 @@ CanvasReplay.prototype.replay_ = function(
|
||||
const pathLength = lineStringLength(pixelCoordinates, begin, end, 2);
|
||||
const textLength = measure(text);
|
||||
if (overflow || textLength <= pathLength) {
|
||||
const textAlign = /** @type {module:ol.render.canvas.TextReplay~CanvasTextReplay} */ (this).textStates[textKey].textAlign;
|
||||
const textAlign = /** @type {module:ol~render} */ (this).textStates[textKey].textAlign;
|
||||
const startM = (pathLength - textLength) * TEXT_ALIGN[textAlign];
|
||||
const parts = drawTextOnPath(
|
||||
pixelCoordinates, begin, end, 2, text, measure, startM, maxAngle);
|
||||
@@ -720,7 +720,7 @@ CanvasReplay.prototype.replay_ = function(
|
||||
for (c = 0, cc = parts.length; c < cc; ++c) {
|
||||
part = parts[c]; // x, y, anchorX, rotation, chunk
|
||||
chars = /** @type {string} */ (part[4]);
|
||||
label = /** @type {module:ol.render.canvas.TextReplay~CanvasTextReplay} */ (this).getImage(chars, textKey, '', strokeKey);
|
||||
label = /** @type {module:ol~render} */ (this).getImage(chars, textKey, '', strokeKey);
|
||||
anchorX = /** @type {number} */ (part[2]) + strokeWidth;
|
||||
anchorY = baseline * label.height + (0.5 - baseline) * 2 * strokeWidth - offsetY;
|
||||
this.replayImage_(context,
|
||||
@@ -734,7 +734,7 @@ CanvasReplay.prototype.replay_ = function(
|
||||
for (c = 0, cc = parts.length; c < cc; ++c) {
|
||||
part = parts[c]; // x, y, anchorX, rotation, chunk
|
||||
chars = /** @type {string} */ (part[4]);
|
||||
label = /** @type {module:ol.render.canvas.TextReplay~CanvasTextReplay} */ (this).getImage(chars, textKey, fillKey, '');
|
||||
label = /** @type {module:ol~render} */ (this).getImage(chars, textKey, fillKey, '');
|
||||
anchorX = /** @type {number} */ (part[2]);
|
||||
anchorY = baseline * label.height - offsetY;
|
||||
this.replayImage_(context,
|
||||
@@ -751,7 +751,7 @@ CanvasReplay.prototype.replay_ = function(
|
||||
break;
|
||||
case CanvasInstruction.END_GEOMETRY:
|
||||
if (featureCallback !== undefined) {
|
||||
feature = /** @type {module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature} */ (instruction[1]);
|
||||
feature = /** @type {module:ol/Feature|module:ol/render/Feature} */ (instruction[1]);
|
||||
const result = featureCallback(feature);
|
||||
if (result) {
|
||||
return result;
|
||||
@@ -861,7 +861,7 @@ CanvasReplay.prototype.replay = function(
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature)): T=} opt_featureCallback
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T=} opt_featureCallback
|
||||
* Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
@@ -892,7 +892,7 @@ CanvasReplay.prototype.reverseHitDetectionInstructions = function() {
|
||||
let begin = -1;
|
||||
for (i = 0; i < n; ++i) {
|
||||
instruction = hitDetectionInstructions[i];
|
||||
type = /** @type {module:ol/render/canvas/Instruction~Instruction} */ (instruction[0]);
|
||||
type = /** @type {module:ol/render/canvas/Instruction} */ (instruction[0]);
|
||||
if (type == CanvasInstruction.END_GEOMETRY) {
|
||||
begin = i;
|
||||
} else if (type == CanvasInstruction.BEGIN_GEOMETRY) {
|
||||
@@ -958,7 +958,7 @@ CanvasReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {module:ol/geom/Geometry~Geometry|module:ol/render/Feature~RenderFeature} geometry Geometry.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @return {Array.<*>} Fill instruction.
|
||||
*/
|
||||
CanvasReplay.prototype.createFill = function(state, geometry) {
|
||||
@@ -996,8 +996,8 @@ CanvasReplay.prototype.createStroke = function(state) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {function(this:module:ol/render/canvas/Replay~CanvasReplay, module:ol/render/canvas~FillStrokeState, (module:ol/geom/Geometry~Geometry|module:ol/render/Feature~RenderFeature)):Array.<*>} createFill Create fill.
|
||||
* @param {module:ol/geom/Geometry~Geometry|module:ol/render/Feature~RenderFeature} geometry Geometry.
|
||||
* @param {function(this:module:ol/render/canvas/Replay, module:ol/render/canvas~FillStrokeState, (module:ol/geom/Geometry|module:ol/render/Feature)):Array.<*>} createFill Create fill.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
*/
|
||||
CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) {
|
||||
const fillStyle = state.fillStyle;
|
||||
@@ -1012,7 +1012,7 @@ CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {function(this:module:ol/render/canvas/Replay~CanvasReplay, module:ol/render/canvas~FillStrokeState)} applyStroke Apply stroke.
|
||||
* @param {function(this:module:ol/render/canvas/Replay, module:ol/render/canvas~FillStrokeState)} applyStroke Apply stroke.
|
||||
*/
|
||||
CanvasReplay.prototype.updateStrokeStyle = function(state, applyStroke) {
|
||||
const strokeStyle = state.strokeStyle;
|
||||
@@ -1044,8 +1044,8 @@ CanvasReplay.prototype.updateStrokeStyle = function(state, applyStroke) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry~Geometry|module:ol/render/Feature~RenderFeature} geometry Geometry.
|
||||
* @param {module:ol/Feature~Feature|module:ol/render/Feature~RenderFeature} feature Feature.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
*/
|
||||
CanvasReplay.prototype.endGeometry = function(geometry, feature) {
|
||||
this.beginGeometryInstruction1_[2] = this.instructions.length;
|
||||
|
||||
Reference in New Issue
Block a user