Merge lat/lon in JS popup
This commit is contained in:
commit
5447a9a5fc
1
images/position.svg
Normal file
1
images/position.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0c-4.198 0-8 3.403-8 7.602 0 4.198 3.469 9.21 8 16.398 4.531-7.188 8-12.2 8-16.398 0-4.199-3.801-7.602-8-7.602zm0 11c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3z"/></svg>
|
After Width: | Height: | Size: 279 B |
@ -135,4 +135,30 @@ export default class uLang {
|
|||||||
return ((d > 0) ? (`${d} ${this.unit('unitDay')} `) : '') +
|
return ((d > 0) ? (`${d} ${this.unit('unitDay')} `) : '') +
|
||||||
((`00${h}`).slice(-2)) + ':' + ((`00${m}`).slice(-2)) + ':' + ((`00${s}`).slice(-2)) + '';
|
((`00${h}`).slice(-2)) + ':' + ((`00${m}`).slice(-2)) + ':' + ((`00${s}`).slice(-2)) + '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {uPosition} pos
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
getLocaleCoordinates(pos) {
|
||||||
|
return `${uLang.coordStr(pos.longitude, true)} ${uLang.coordStr(pos.latitude, false)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {number} pos
|
||||||
|
* @param {boolean} isLon
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
static coordStr(pos, isLon) {
|
||||||
|
const ipos = Math.floor(pos);
|
||||||
|
const dec = ((pos - ipos) * 60).toFixed(1);
|
||||||
|
let dir;
|
||||||
|
|
||||||
|
if (isLon) {
|
||||||
|
dir = pos < 0 ? 'W' : 'E';
|
||||||
|
} else {
|
||||||
|
dir = pos < 0 ? 'S' : 'N';
|
||||||
|
}
|
||||||
|
return `${ipos}° ${dec}'${dir}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,6 +188,7 @@ export default class MapViewModel extends ViewModel {
|
|||||||
${(pos.speed !== null) ? `<img class="icon" alt="${$._('speed')}" title="${$._('speed')}" src="images/speed_dark.svg">${$.getLocaleSpeed(pos.speed, true)}<br>` : ''}
|
${(pos.speed !== null) ? `<img class="icon" alt="${$._('speed')}" title="${$._('speed')}" src="images/speed_dark.svg">${$.getLocaleSpeed(pos.speed, true)}<br>` : ''}
|
||||||
${(pos.altitude !== null) ? `<img class="icon" alt="${$._('altitude')}" title="${$._('altitude')}" src="images/altitude_dark.svg">${$.getLocaleAltitude(pos.altitude, true)}<br>` : ''}
|
${(pos.altitude !== null) ? `<img class="icon" alt="${$._('altitude')}" title="${$._('altitude')}" src="images/altitude_dark.svg">${$.getLocaleAltitude(pos.altitude, true)}<br>` : ''}
|
||||||
${(pos.accuracy !== null) ? `<img class="icon" alt="${$._('accuracy')}" title="${$._('accuracy')}" src="images/accuracy_dark.svg">${$.getLocaleAccuracy(pos.accuracy, true)}${provider}<br>` : ''}
|
${(pos.accuracy !== null) ? `<img class="icon" alt="${$._('accuracy')}" title="${$._('accuracy')}" src="images/accuracy_dark.svg">${$.getLocaleAccuracy(pos.accuracy, true)}${provider}<br>` : ''}
|
||||||
|
<img class="icon" alt="${$._('position')}" title="${$._('position')}" src="images/position.svg">${$.getLocaleCoordinates(pos)}<br>
|
||||||
</div>${stats}</div>
|
</div>${stats}</div>
|
||||||
<div id="pfooter"><div>${$._('pointof', id + 1, count)}</div><div>${editLink}</div></div>`;
|
<div id="pfooter"><div>${$._('pointof', id + 1, count)}</div><div>${editLink}</div></div>`;
|
||||||
const node = document.createElement('div');
|
const node = document.createElement('div');
|
||||||
@ -259,4 +260,5 @@ export default class MapViewModel extends ViewModel {
|
|||||||
this.api.updateSize();
|
this.api.updateSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ $lang["close"] = "close";
|
|||||||
$lang["time"] = "Time";
|
$lang["time"] = "Time";
|
||||||
$lang["speed"] = "Speed";
|
$lang["speed"] = "Speed";
|
||||||
$lang["accuracy"] = "Accuracy";
|
$lang["accuracy"] = "Accuracy";
|
||||||
|
$lang["position"] = "Position";
|
||||||
$lang["altitude"] = "Altitude";
|
$lang["altitude"] = "Altitude";
|
||||||
$lang["ttime"] = "Total time";
|
$lang["ttime"] = "Total time";
|
||||||
$lang["aspeed"] = "Average speed";
|
$lang["aspeed"] = "Average speed";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user