Rework examples to new API

This commit is contained in:
Tim Schaub
2015-04-05 18:51:55 +02:00
parent e1079ab9a3
commit 814fb078cf
7 changed files with 54 additions and 48 deletions

View File

@@ -2,7 +2,6 @@ goog.require('ol.DeviceOrientation');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.dom.Input');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
@@ -31,8 +30,10 @@ var map = new ol.Map({
});
var deviceOrientation = new ol.DeviceOrientation();
var track = new ol.dom.Input(document.getElementById('track'));
track.bindTo('checked', deviceOrientation, 'tracking');
$('#track').on('change', function() {
deviceOrientation.setTracking(this.checked);
});
deviceOrientation.on('change', function(event) {
$('#alpha').text(deviceOrientation.getAlpha() + ' [rad]');