implement icon rotation

This commit is contained in:
Jakob Ketterl
2019-09-19 02:25:32 +02:00
parent 15c28b130d
commit ecbae5af2d
3 changed files with 19 additions and 11 deletions

View File

@ -14,6 +14,16 @@ AprsMarker.prototype.draw = function() {
div.style['background-position-y'] = -Math.floor(this.symbol.index / 16) * 24 + 'px';
}
if (this.course) {
if (this.course > 180) {
div.style.transform = 'scalex(-1) rotate(' + (270 - this.course) + 'deg)'
} else {
div.style.transform = 'rotate(' + (this.course - 90) + 'deg)';
}
} else {
div.style.transform = null;
}
if (this.symbol.table != '/' && this.symbol.table != '\\') {
overlay.style.display = 'block';
overlay.style['background-position-x'] = -(this.symbol.tableindex % 16) * 24 + 'px';
@ -33,8 +43,6 @@ AprsMarker.prototype.draw = function() {
AprsMarker.prototype.onAdd = function() {
var div = this.div = document.createElement('div');
div.className = 'marker';
div.style.position = 'absolute';
div.style.cursor = 'pointer';
div.style.width = '24px';