Merge pull request #256 from tschaub/transform-arrays

Updating ol.TransformFunction instances so they work with arrays instead of coordinates.
This commit is contained in:
Tim Schaub
2013-03-03 14:46:22 -08:00
8 changed files with 219 additions and 63 deletions
+4 -1
View File
@@ -8,6 +8,7 @@ goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.style');
goog.require('ol.Coordinate');
goog.require('ol.CoordinateFormatType');
goog.require('ol.MapEvent');
goog.require('ol.MapEventType');
@@ -177,7 +178,9 @@ ol.control.MousePosition.prototype.updateHTML_ = function(pixel) {
var map = this.getMap();
var coordinate = map.getCoordinateFromPixel(pixel);
if (!goog.isNull(coordinate)) {
coordinate = this.transform_(coordinate);
var vertex = [coordinate.x, coordinate.y];
vertex = this.transform_(vertex, vertex);
coordinate = new ol.Coordinate(vertex[0], vertex[1]);
if (goog.isDef(this.coordinateFormat_)) {
html = this.coordinateFormat_(coordinate);
} else {