Skip to content

Commit

Permalink
Rotation correction
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresma1 committed Nov 27, 2024
1 parent 809d191 commit 003f42b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function updateMap() {
let polyLineColor = "#000000";
try {
simPlaneMarker.slideTo([latitude, longitude], {duration: 1500}); // Update marker position
simPlaneMarker.setRotationAngle(heading); // Update marker rotation angle
simPlaneMarker.setRotationAngle(heading-45); // Update marker rotation angle
if (centerAircraft == true) {
map.panTo([latitude, longitude]);
}
Expand Down Expand Up @@ -323,11 +323,11 @@ let updateVatsimNetworkData = data => {
if (vatsimMarkers[callsign]) {
// Update position and heading if marker already exists
vatsimMarkers[callsign].setLatLng([latitude, longitude]);
vatsimMarkers[callsign].setRotationAngle(heading);
vatsimMarkers[callsign].setRotationAngle(heading-45);
} else {
// Create and add new marker if it doesn't exist
const newMarker = L.marker([latitude, longitude], { icon: vatsimMarkerIcon }).addTo(map);
newMarker.setRotationAngle(heading);
newMarker.setRotationAngle(heading-45);
if (flight_plan) {
newMarker.bindPopup(
`<h5>${callsign}</h5>
Expand Down

0 comments on commit 003f42b

Please sign in to comment.