Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tutorials #7014

Merged
merged 3 commits into from
Mar 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix JS error on non-mobile devices (issue #4239)
  • Loading branch information
vncntcltt committed Mar 6, 2020
commit dd00105ab8dbb89b32349a94dd5b530b68115a11
11 changes: 9 additions & 2 deletions docs/examples/extending/tilt.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ title: Tilt handler

_tilt: function(ev) {
// Treat Gamma angle as horizontal pan (1 degree = 1 pixel) and Beta angle as vertical pan
this._map.panBy( L.point( ev.gamma, ev.beta ) );
document.getElementById('info').innerHTML = ev.gamma + ',' + ev.beta;
var info;
var offset = L.point(ev.gamma, ev.beta)
if (offset) {
this._map.panBy(offset);
info = ev.gamma + ',' + ev.beta;
} else {
info = 'Device orientation not detected'
}
document.getElementById('info').innerHTML = info
}
});

Expand Down