The iRender draw functions are passed a data object

This commit is contained in:
Éric Lemoine
2013-12-02 12:43:58 +01:00
parent 2c40daea22
commit e358321b92
6 changed files with 51 additions and 37 deletions
+9 -8
View File
@@ -215,7 +215,7 @@ ol.render.canvas.Immediate.prototype.drawFeature = function(feature, style) {
var renderGeometry =
ol.render.canvas.Immediate.GEOMETRY_RENDERES_[geometry.getType()];
goog.asserts.assert(goog.isDef(renderGeometry));
renderGeometry.call(this, geometry);
renderGeometry.call(this, geometry, null);
};
@@ -223,7 +223,7 @@ ol.render.canvas.Immediate.prototype.drawFeature = function(feature, style) {
* @inheritDoc
*/
ol.render.canvas.Immediate.prototype.drawPointGeometry =
function(pointGeometry) {
function(pointGeometry, data) {
this.drawImages_(pointGeometry);
this.drawText_(pointGeometry);
};
@@ -233,7 +233,7 @@ ol.render.canvas.Immediate.prototype.drawPointGeometry =
* @inheritDoc
*/
ol.render.canvas.Immediate.prototype.drawMultiPointGeometry =
function(multiPointGeometry) {
function(multiPointGeometry, data) {
this.drawImages_(multiPointGeometry);
this.drawText_(multiPointGeometry);
};
@@ -243,7 +243,7 @@ ol.render.canvas.Immediate.prototype.drawMultiPointGeometry =
* @inheritDoc
*/
ol.render.canvas.Immediate.prototype.drawLineStringGeometry =
function(lineStringGeometry) {
function(lineStringGeometry, data) {
if (!ol.extent.intersects(this.extent_, lineStringGeometry.getExtent()) ||
!goog.isDef(this.state_.strokeStyle)) {
return;
@@ -262,7 +262,7 @@ ol.render.canvas.Immediate.prototype.drawLineStringGeometry =
* @inheritDoc
*/
ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry =
function(multiLineStringGeometry) {
function(multiLineStringGeometry, data) {
var geometryExtent = multiLineStringGeometry.getExtent();
if (!ol.extent.intersects(this.extent_, geometryExtent) ||
!goog.isDef(this.state_.strokeStyle)) {
@@ -287,7 +287,7 @@ ol.render.canvas.Immediate.prototype.drawMultiLineStringGeometry =
* @inheritDoc
*/
ol.render.canvas.Immediate.prototype.drawPolygonGeometry =
function(polygonGeometry) {
function(polygonGeometry, data) {
if (!ol.extent.intersects(this.extent_, polygonGeometry.getExtent())) {
return;
}
@@ -316,7 +316,7 @@ ol.render.canvas.Immediate.prototype.drawPolygonGeometry =
* @inheritDoc
*/
ol.render.canvas.Immediate.prototype.drawMultiPolygonGeometry =
function(multiPolygonGeometry) {
function(multiPolygonGeometry, data) {
if (!ol.extent.intersects(this.extent_, multiPolygonGeometry.getExtent())) {
return;
}
@@ -467,7 +467,8 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) {
* @const
* @private
* @type {Object.<ol.geom.Type,
* function(this: ol.render.canvas.Immediate, ol.geom.Geometry)>}
* function(this: ol.render.canvas.Immediate, ol.geom.Geometry,
* Object)>}
*/
ol.render.canvas.Immediate.GEOMETRY_RENDERES_ = {
'Point': ol.render.canvas.Immediate.prototype.drawPointGeometry,
+6 -6
View File
@@ -372,7 +372,7 @@ ol.render.canvas.ImageReplay.prototype.drawCoordinates_ =
* @inheritDoc
*/
ol.render.canvas.ImageReplay.prototype.drawPointGeometry =
function(pointGeometry) {
function(pointGeometry, data) {
if (goog.isNull(this.image_)) {
return;
}
@@ -399,7 +399,7 @@ ol.render.canvas.ImageReplay.prototype.drawPointGeometry =
* @inheritDoc
*/
ol.render.canvas.ImageReplay.prototype.drawMultiPointGeometry =
function(multiPointGeometry) {
function(multiPointGeometry, data) {
if (goog.isNull(this.image_)) {
return;
}
@@ -561,7 +561,7 @@ ol.render.canvas.LineStringReplay.prototype.setStrokeStyle_ = function() {
* @inheritDoc
*/
ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry =
function(lineStringGeometry) {
function(lineStringGeometry, data) {
var state = this.state_;
goog.asserts.assert(!goog.isNull(state));
var strokeStyle = state.strokeStyle;
@@ -584,7 +584,7 @@ ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry =
* @inheritDoc
*/
ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry =
function(multiLineStringGeometry) {
function(multiLineStringGeometry, data) {
var state = this.state_;
goog.asserts.assert(!goog.isNull(state));
var strokeStyle = state.strokeStyle;
@@ -731,7 +731,7 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ =
* @inheritDoc
*/
ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry =
function(polygonGeometry) {
function(polygonGeometry, data) {
var state = this.state_;
goog.asserts.assert(!goog.isNull(state));
var fillStyle = state.fillStyle;
@@ -757,7 +757,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry =
* @inheritDoc
*/
ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry =
function(multiPolygonGeometry) {
function(multiPolygonGeometry, data) {
var state = this.state_;
goog.asserts.assert(!goog.isNull(state));
var fillStyle = state.fillStyle;