Introduce ol.render.Feature
This commit is contained in:
@@ -527,8 +527,8 @@ ol.render.canvas.Immediate.prototype.drawGeometryCollectionGeometry =
|
||||
* Render a Point geometry into the canvas. Rendering is immediate and uses
|
||||
* the current style.
|
||||
*
|
||||
* @param {ol.geom.Point} pointGeometry Point geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.geom.Point|ol.render.Feature} pointGeometry Point geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawPointGeometry =
|
||||
@@ -548,8 +548,9 @@ ol.render.canvas.Immediate.prototype.drawPointGeometry =
|
||||
* Render a MultiPoint geometry into the canvas. Rendering is immediate and
|
||||
* uses the current style.
|
||||
*
|
||||
* @param {ol.geom.MultiPoint} multiPointGeometry MultiPoint geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.geom.MultiPoint|ol.render.Feature} multiPointGeometry MultiPoint
|
||||
* geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawMultiPointGeometry =
|
||||
@@ -569,8 +570,9 @@ ol.render.canvas.Immediate.prototype.drawMultiPointGeometry =
|
||||
* Render a LineString into the canvas. Rendering is immediate and uses
|
||||
* the current style.
|
||||
*
|
||||
* @param {ol.geom.LineString} lineStringGeometry Line string geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.geom.LineString|ol.render.Feature} lineStringGeometry Line
|
||||
* string geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawLineStringGeometry =
|
||||
@@ -598,9 +600,9 @@ ol.render.canvas.Immediate.prototype.drawLineStringGeometry =
|
||||
* Render a MultiLineString geometry into the canvas. Rendering is immediate
|
||||
* and uses the current style.
|
||||
*
|
||||
* @param {ol.geom.MultiLineString} multiLineStringGeometry
|
||||
* @param {ol.geom.MultiLineString|ol.render.Feature} multiLineStringGeometry
|
||||
* MultiLineString geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry =
|
||||
@@ -635,8 +637,9 @@ ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry =
|
||||
* Render a Polygon geometry into the canvas. Rendering is immediate and uses
|
||||
* the current style.
|
||||
*
|
||||
* @param {ol.geom.Polygon} polygonGeometry Polygon geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.geom.Polygon|ol.render.Feature} polygonGeometry Polygon
|
||||
* geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @api
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawPolygonGeometry =
|
||||
@@ -1002,8 +1005,8 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) {
|
||||
* @const
|
||||
* @private
|
||||
* @type {Object.<ol.geom.GeometryType,
|
||||
* function(this: ol.render.canvas.Immediate, ol.geom.Geometry,
|
||||
* Object)>}
|
||||
* function(this: ol.render.canvas.Immediate,
|
||||
* (ol.geom.Geometry|ol.render.Feature), Object)>}
|
||||
*/
|
||||
ol.render.canvas.Immediate.GEOMETRY_RENDERERS_ = {
|
||||
'Point': ol.render.canvas.Immediate.prototype.drawPointGeometry,
|
||||
|
||||
@@ -202,8 +202,8 @@ ol.render.canvas.Replay.prototype.appendFlatCoordinates =
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @param {ol.geom.Geometry} geometry Geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
ol.render.canvas.Replay.prototype.beginGeometry = function(geometry, feature) {
|
||||
this.beginGeometryInstruction1_ =
|
||||
@@ -224,7 +224,8 @@ ol.render.canvas.Replay.prototype.beginGeometry = function(geometry, feature) {
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {Array.<*>} instructions Instructions array.
|
||||
* @param {function(ol.Feature): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined}
|
||||
* featureCallback Feature callback.
|
||||
* @param {ol.Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
* @return {T|undefined} Callback result.
|
||||
@@ -256,7 +257,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
||||
var feature, fill, stroke, text, x, y;
|
||||
switch (type) {
|
||||
case ol.render.canvas.Instruction.BEGIN_GEOMETRY:
|
||||
feature = /** @type {ol.Feature} */ (instruction[1]);
|
||||
feature = /** @type {ol.Feature|ol.render.Feature} */ (instruction[1]);
|
||||
var featureUid = goog.getUid(feature).toString();
|
||||
if (skippedFeaturesHash[featureUid] !== undefined ||
|
||||
!feature.getGeometry()) {
|
||||
@@ -409,7 +410,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
||||
break;
|
||||
case ol.render.canvas.Instruction.END_GEOMETRY:
|
||||
if (featureCallback !== undefined) {
|
||||
feature = /** @type {ol.Feature} */ (instruction[1]);
|
||||
feature = /** @type {ol.Feature|ol.render.Feature} */ (instruction[1]);
|
||||
var result = featureCallback(feature);
|
||||
if (result) {
|
||||
return result;
|
||||
@@ -517,7 +518,8 @@ ol.render.canvas.Replay.prototype.replay = function(
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function(ol.Feature): T=} opt_featureCallback Feature callback.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T=} opt_featureCallback
|
||||
* Feature callback.
|
||||
* @param {ol.Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
* @return {T|undefined} Callback result.
|
||||
@@ -564,8 +566,8 @@ ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ =
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.Geometry} geometry Geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
ol.render.canvas.Replay.prototype.endGeometry = function(geometry, feature) {
|
||||
goog.asserts.assert(this.beginGeometryInstruction1_,
|
||||
@@ -1889,7 +1891,8 @@ ol.render.canvas.ReplayGroup.prototype.finish = function() {
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function(ol.Feature): T} callback Feature callback.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T} callback Feature
|
||||
* callback.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -1917,7 +1920,7 @@ ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtCoordinate = function(
|
||||
return this.replayHitDetection_(context, transform, rotation,
|
||||
skippedFeaturesHash,
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
@@ -2027,7 +2030,8 @@ ol.render.canvas.ReplayGroup.prototype.replay = function(
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function(ol.Feature): T} featureCallback Feature callback.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T} featureCallback
|
||||
* Feature callback.
|
||||
* @param {ol.Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
* @return {T|undefined} Callback result.
|
||||
|
||||
Reference in New Issue
Block a user