Comlex commit
This commit is contained in:
19
src/index.js
19
src/index.js
@@ -20,7 +20,6 @@ map.on('style.load', () => {
|
||||
map.setFog({}); // Set the default atmosphere style
|
||||
document.onclick = hideMenu;
|
||||
});
|
||||
map.addControl(new RulerControl(), 'top-right');
|
||||
|
||||
let minimap = new MiniMap({
|
||||
center: [31.393023, 49.011527],
|
||||
@@ -63,6 +62,7 @@ map.addControl(new StylesControl({
|
||||
],
|
||||
onChange: (style) => console.log(style),
|
||||
}), 'top-right');
|
||||
map.addControl(new RulerControl(), 'bottom-right');
|
||||
|
||||
function hideMenu() {
|
||||
console.log('hideMenu');
|
||||
@@ -108,14 +108,17 @@ const attitudeElement = document.querySelector("#attitude");
|
||||
const attitude = new FlightIndicators(
|
||||
attitudeElement,
|
||||
FlightIndicators.TYPE_ATTITUDE,
|
||||
{ roll: 50, pitch: -20, size: 200, hideBox: true }
|
||||
{ roll: 50, pitch: -20, size: 200, hideBox: true, }
|
||||
);
|
||||
|
||||
attitude.updateRoll(0);
|
||||
attitude.updatePitch(0);
|
||||
|
||||
const headingElement = document.querySelector("#heading")
|
||||
const heading = new FlightIndicators(
|
||||
headingElement,
|
||||
FlightIndicators.TYPE_HEADING,
|
||||
{ heading: 0, hideBox: true }
|
||||
{ heading: 0, hideBox: true, }
|
||||
);
|
||||
|
||||
|
||||
@@ -145,11 +148,11 @@ client.on('message', function (topic, message) {
|
||||
|
||||
if (topic == 'a1/ATTITUDE') {
|
||||
//console.log('ATTITUDE')
|
||||
attitude.setRoll(obj.roll * 100);
|
||||
attitude.setPitch(obj.pitch * 100);
|
||||
attitude.updateRoll(obj.roll * 100);
|
||||
attitude.updatePitch(obj.pitch * 100);
|
||||
} else if (topic == 'a1/VFR_HUD') {
|
||||
//console.log('VFR_HUD');
|
||||
heading.setHeading(obj.heading);
|
||||
heading.updateHeading(obj.heading);
|
||||
//altimeter.setAltitude(obj.alt / 3.2808399);
|
||||
//console.log(obj)
|
||||
marker.setRotation(obj.heading);
|
||||
@@ -235,9 +238,7 @@ client.on('message', function (topic, message) {
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.log(topic);
|
||||
console.log(relaxedString)
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
//client.end()
|
||||
|
||||
Reference in New Issue
Block a user