Redefine ol.Coordinate to be Array.<number>

This commit is contained in:
Tom Payne
2013-04-04 19:39:18 +02:00
parent 6fc86b81c7
commit 02196c94b5
74 changed files with 613 additions and 687 deletions

View File

@@ -271,9 +271,10 @@ ol.renderer.Layer.prototype.createGetTileIfLoadedFunction =
*/
ol.renderer.Layer.prototype.snapCenterToPixel =
function(center, resolution, size) {
return new ol.Coordinate(
resolution * (Math.round(center.x / resolution) + (size.width % 2) / 2),
resolution * (Math.round(center.y / resolution) + (size.height % 2) / 2));
return [
resolution * (Math.round(center[0] / resolution) + (size.width % 2) / 2),
resolution * (Math.round(center[1] / resolution) + (size.height % 2) / 2)
];
};