@@ -14,7 +14,6 @@ goog.require('ol.source.ImageVector');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.renderer.canvas.Layer}
|
||||
@@ -55,8 +54,7 @@ goog.inherits(ol.renderer.canvas.ImageLayer, ol.renderer.canvas.Layer);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate =
|
||||
function(coordinate, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
var layer = this.getLayer();
|
||||
var source = layer.getSource();
|
||||
var resolution = frameState.viewState.resolution;
|
||||
@@ -77,8 +75,7 @@ ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachLayerAtPixel =
|
||||
function(pixel, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.ImageLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {
|
||||
if (!this.getImage()) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -144,8 +141,7 @@ ol.renderer.canvas.ImageLayer.prototype.getImageTransform = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.ImageLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var viewState = frameState.viewState;
|
||||
|
||||
@@ -13,7 +13,6 @@ goog.require('ol.renderer.Layer');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.renderer.Layer}
|
||||
@@ -38,8 +37,7 @@ goog.inherits(ol.renderer.canvas.Layer, ol.renderer.Layer);
|
||||
* @param {ol.layer.LayerState} layerState Layer state.
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.composeFrame =
|
||||
function(frameState, layerState, context) {
|
||||
ol.renderer.canvas.Layer.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
|
||||
this.dispatchPreComposeEvent(context, frameState);
|
||||
|
||||
@@ -122,8 +120,7 @@ ol.renderer.canvas.Layer.prototype.composeFrame =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ =
|
||||
function(type, context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ = function(type, context, frameState, opt_transform) {
|
||||
var layer = this.getLayer();
|
||||
if (layer.hasListener(type)) {
|
||||
var transform = opt_transform !== undefined ?
|
||||
@@ -145,8 +142,7 @@ ol.renderer.canvas.Layer.prototype.dispatchComposeEvent_ =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent =
|
||||
function(context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(ol.render.EventType.POSTCOMPOSE, context,
|
||||
frameState, opt_transform);
|
||||
};
|
||||
@@ -158,8 +154,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPostComposeEvent =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent =
|
||||
function(context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE, context,
|
||||
frameState, opt_transform);
|
||||
};
|
||||
@@ -171,8 +166,7 @@ ol.renderer.canvas.Layer.prototype.dispatchPreComposeEvent =
|
||||
* @param {goog.vec.Mat4.Number=} opt_transform Transform.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.dispatchRenderEvent =
|
||||
function(context, frameState, opt_transform) {
|
||||
ol.renderer.canvas.Layer.prototype.dispatchRenderEvent = function(context, frameState, opt_transform) {
|
||||
this.dispatchComposeEvent_(ol.render.EventType.RENDER, context,
|
||||
frameState, opt_transform);
|
||||
};
|
||||
@@ -196,8 +190,7 @@ ol.renderer.canvas.Layer.prototype.getImageTransform = goog.abstractMethod;
|
||||
* @protected
|
||||
* @return {!goog.vec.Mat4.Number} Transform.
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.getTransform =
|
||||
function(frameState, offsetX) {
|
||||
ol.renderer.canvas.Layer.prototype.getTransform = function(frameState, offsetX) {
|
||||
var viewState = frameState.viewState;
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
return ol.vec.Mat4.makeTransform2D(this.transform_,
|
||||
@@ -223,11 +216,10 @@ ol.renderer.canvas.Layer.prototype.prepareFrame = goog.abstractMethod;
|
||||
* @param {ol.Pixel} pixelOnMap Pixel.
|
||||
* @param {goog.vec.Mat4.Number} imageTransformInv The transformation matrix
|
||||
* to convert from a map pixel to a canvas pixel.
|
||||
* @return {ol.Pixel}
|
||||
* @return {ol.Pixel} The pixel.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.getPixelOnCanvas =
|
||||
function(pixelOnMap, imageTransformInv) {
|
||||
ol.renderer.canvas.Layer.prototype.getPixelOnCanvas = function(pixelOnMap, imageTransformInv) {
|
||||
var pixelOnCanvas = [0, 0];
|
||||
ol.vec.Mat4.multVec2(imageTransformInv, pixelOnMap, pixelOnCanvas);
|
||||
return pixelOnCanvas;
|
||||
|
||||
@@ -29,7 +29,6 @@ goog.require('ol.source.State');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.renderer.Map}
|
||||
@@ -97,8 +96,7 @@ ol.renderer.canvas.Map.prototype.createLayerRenderer = function(layer) {
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ =
|
||||
function(type, frameState) {
|
||||
ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ = function(type, frameState) {
|
||||
var map = this.getMap();
|
||||
var context = this.context_;
|
||||
if (map.hasListener(type)) {
|
||||
|
||||
@@ -17,7 +17,6 @@ goog.require('ol.size');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.renderer.canvas.Layer}
|
||||
@@ -122,8 +121,7 @@ ol.renderer.canvas.TileLayer.prototype.getImageTransform = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.TileLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.TileLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
|
||||
//
|
||||
// Warning! You're entering a dangerous zone!
|
||||
@@ -458,8 +456,7 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.TileLayer.prototype.forEachLayerAtPixel =
|
||||
function(pixel, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.TileLayer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {
|
||||
if (!this.context_) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ goog.require('ol.renderer.vector');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.renderer.canvas.Layer}
|
||||
@@ -72,8 +71,7 @@ goog.inherits(ol.renderer.canvas.VectorLayer, ol.renderer.canvas.Layer);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
function(frameState, layerState, context) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
|
||||
var extent = frameState.extent;
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
@@ -153,8 +151,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate =
|
||||
function(coordinate, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
if (!this.replayGroup_) {
|
||||
return undefined;
|
||||
} else {
|
||||
@@ -187,8 +184,7 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate =
|
||||
* @param {goog.events.Event} event Image style change event.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ =
|
||||
function(event) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ = function(event) {
|
||||
this.renderIfReadyAndVisible();
|
||||
};
|
||||
|
||||
@@ -196,8 +192,7 @@ ol.renderer.canvas.VectorLayer.prototype.handleStyleImageChange_ =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
|
||||
var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
||||
goog.asserts.assertInstanceof(vectorLayer, ol.layer.Vector,
|
||||
@@ -267,12 +262,11 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
ol.renderer.vector.getTolerance(resolution, pixelRatio), extent,
|
||||
resolution, vectorLayer.getRenderBuffer());
|
||||
vectorSource.loadFeatures(extent, resolution, projection);
|
||||
var renderFeature =
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @this {ol.renderer.canvas.VectorLayer}
|
||||
*/
|
||||
function(feature) {
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @this {ol.renderer.canvas.VectorLayer}
|
||||
*/
|
||||
var renderFeature = function(feature) {
|
||||
var styles;
|
||||
var styleFunction = feature.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
@@ -325,8 +319,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
* @param {ol.render.canvas.ReplayGroup} replayGroup Replay group.
|
||||
* @return {boolean} `true` if an image is loading.
|
||||
*/
|
||||
ol.renderer.canvas.VectorLayer.prototype.renderFeature =
|
||||
function(feature, resolution, pixelRatio, styles, replayGroup) {
|
||||
ol.renderer.canvas.VectorLayer.prototype.renderFeature = function(feature, resolution, pixelRatio, styles, replayGroup) {
|
||||
if (!styles) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ goog.require('ol.source.VectorTile');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.renderer.canvas.Layer}
|
||||
@@ -76,8 +75,7 @@ goog.inherits(ol.renderer.canvas.VectorTileLayer, ol.renderer.canvas.Layer);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.composeFrame =
|
||||
function(frameState, layerState, context) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.composeFrame = function(frameState, layerState, context) {
|
||||
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var skippedFeatureUids = layerState.managed ?
|
||||
@@ -292,8 +290,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile,
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate =
|
||||
function(coordinate, frameState, callback, thisArg) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) {
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var resolution = frameState.viewState.resolution;
|
||||
var rotation = frameState.viewState.rotation;
|
||||
@@ -356,8 +353,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate =
|
||||
* @param {goog.events.Event} event Image style change event.
|
||||
* @private
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ =
|
||||
function(event) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ = function(event) {
|
||||
this.renderIfReadyAndVisible();
|
||||
};
|
||||
|
||||
@@ -365,8 +361,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ =
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame =
|
||||
function(frameState, layerState) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame = function(frameState, layerState) {
|
||||
var layer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
||||
goog.asserts.assertInstanceof(layer, ol.layer.VectorTile,
|
||||
'layer is an instance of ol.layer.VectorTile');
|
||||
@@ -488,8 +483,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame =
|
||||
* @param {ol.render.canvas.ReplayGroup} replayGroup Replay group.
|
||||
* @return {boolean} `true` if an image is loading.
|
||||
*/
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.renderFeature =
|
||||
function(feature, squaredTolerance, styles, replayGroup) {
|
||||
ol.renderer.canvas.VectorTileLayer.prototype.renderFeature = function(feature, squaredTolerance, styles, replayGroup) {
|
||||
if (!styles) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user