Redefine ol.Pixel to be Array.<number>

This commit is contained in:
Frederic Junod
2013-04-05 11:56:39 +02:00
parent 075f4aadc7
commit be081fd44e
13 changed files with 38 additions and 48 deletions

View File

@@ -421,7 +421,7 @@ ol.Map.prototype.getCoordinateFromPixel = function(pixel) {
if (goog.isNull(frameState)) {
return null;
} else {
var vec2 = [pixel.x, pixel.y];
var vec2 = pixel.slice();
return ol.vec.Mat4.multVec2(frameState.pixelToCoordinateMatrix, vec2, vec2);
}
};
@@ -470,8 +470,7 @@ ol.Map.prototype.getPixelFromCoordinate = function(coordinate) {
return null;
} else {
var vec2 = coordinate.slice(0, 2);
ol.vec.Mat4.multVec2(frameState.coordinateToPixelMatrix, vec2, vec2);
return new ol.Pixel(vec2[0], vec2[1]);
return ol.vec.Mat4.multVec2(frameState.coordinateToPixelMatrix, vec2, vec2);
}
};