datenspuren food: fix arrow on dissappeared heading
This commit is contained in:
parent
276d4c23fa
commit
9c002a2d40
|
@ -19,7 +19,7 @@ POI.prototype.getDistance = function() {
|
|||
}
|
||||
|
||||
POI.prototype.makeArrowEl = function() {
|
||||
var el = $('<div class="geo-arrow"><p class="arrow"><span>➢</span></p><p class="dist"></p></div>')
|
||||
var el = $('<div class="geo-arrow"><p class="arrow"><span></span></p><p class="dist"></p></div>')
|
||||
|
||||
var update = function() {
|
||||
var bearing = -180.0 * Math.atan2(
|
||||
|
@ -27,8 +27,9 @@ POI.prototype.makeArrowEl = function() {
|
|||
this.lon - currentPosition.lon
|
||||
) / Math.PI
|
||||
el.find('.arrow span').css('transform', 'rotate(' + (bearing - (currentPosition.heading || 0)) + 'deg)')
|
||||
if (typeof currentPosition.heading === 'number')
|
||||
el.find('.arrow span').text("➡")
|
||||
el.find('.arrow span').text(typeof currentPosition.heading === 'number' ?
|
||||
"➡" : "➢"
|
||||
)
|
||||
|
||||
el.find('.dist').text(formatDistance(this.getDistance()))
|
||||
}.bind(this)
|
||||
|
|
Loading…
Reference in New Issue