Merge remote-tracking branch 'openlayers/master' into vector-api

This commit is contained in:
Tom Payne
2013-12-16 17:27:12 +01:00
15 changed files with 92 additions and 144 deletions
@@ -272,6 +272,7 @@ ol.renderer.canvas.Vector.prototype.renderPointFeatures_ =
}
for (j = 0, jj = components.length; j < jj; ++j) {
point = components[j];
goog.asserts.assertInstanceof(point, ol.geom.Point);
vec = [point.get(0), point.get(1), 0];
goog.vec.Mat4.multVec3(this.transform_, vec, vec);
context.drawImage(content, Math.round(vec[0] + xOffset),
@@ -404,6 +405,7 @@ ol.renderer.canvas.Vector.prototype.renderPolygonFeatures_ =
}
for (j = 0, jj = components.length; j < jj; ++j) {
poly = components[j];
goog.asserts.assertInstanceof(poly, ol.geom.Polygon);
rings = poly.getRings();
numRings = rings.length;
if (numRings > 0) {
@@ -535,9 +537,11 @@ ol.renderer.canvas.Vector.getLabelVectors = function(geometry) {
}
var type = geometry.getType();
if (type == ol.geom.GeometryType.POINT) {
goog.asserts.assertInstanceof(geometry, ol.geom.Point);
return [[geometry.get(0), geometry.get(1), 0]];
}
if (type == ol.geom.GeometryType.POLYGON) {
goog.asserts.assertInstanceof(geometry, ol.geom.Polygon);
var coordinates = geometry.getInteriorPoint();
return [[coordinates[0], coordinates[1], 0]];
}