From fc9f323f835ff65b916e0c55978f9fb9ae50b0fe Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 17 Feb 2013 23:53:37 +0100 Subject: [PATCH] Store heading in radians, thanks @fredj --- src/ol/geolocation.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index e9271bebde..99a0535382 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -5,6 +5,7 @@ goog.provide('ol.Geolocation'); goog.provide('ol.GeolocationProperty'); goog.require('goog.functions'); +goog.require('goog.math'); goog.require('ol.Coordinate'); goog.require('ol.Object'); goog.require('ol.Projection'); @@ -102,8 +103,8 @@ ol.Geolocation.prototype.positionChange_ = function(position) { this.set(ol.GeolocationProperty.ALTITUDE_ACCURACY, goog.isNull(coords.altitudeAccuracy) ? undefined : coords.altitudeAccuracy); - this.set(ol.GeolocationProperty.HEADING, - goog.isNull(coords.heading) ? undefined : coords.heading); + this.set(ol.GeolocationProperty.HEADING, goog.isNull(coords.heading) ? + undefined : goog.math.toRadians(coords.heading)); this.position_ = new ol.Coordinate(coords.longitude, coords.latitude); this.set(ol.GeolocationProperty.POSITION, this.transformCoords_(this.position_));