Add 'tracking' property to ol.DeviceOrientation
This commit is contained in:
@@ -2,6 +2,7 @@ goog.require('ol.DeviceOrientation');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.dom.Input');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
@@ -21,6 +22,8 @@ var map = new ol.Map({
|
||||
});
|
||||
|
||||
var deviceOrientation = new ol.DeviceOrientation();
|
||||
var track = new ol.dom.Input(document.getElementById('track'));
|
||||
track.bindTo('checked', deviceOrientation, 'tracking');
|
||||
|
||||
deviceOrientation.on('changed', function() {
|
||||
document.getElementById('alpha').innerHTML = deviceOrientation.getAlpha();
|
||||
|
||||
Reference in New Issue
Block a user