DCSOlympus/www/js/MissionData.js
2022-11-20 12:05:38 +01:00

26 lines
576 B
JavaScript

class MissionData
{
constructor()
{
this.bullseye = undefined;
this._bullseyeMarker = undefined;
}
update(data)
{
this.bullseye = data.missionData.bullseye;
this._drawBullseye();
}
_drawBullseye()
{
if (this._bullseyeMarker === undefined)
{
this._bullseyeMarker = L.marker([this.bullseye.lat, this.bullseye.lng]).addTo(map.getMap());
}
else
{
this._bullseyeMarker .setLatLng(new L.LatLng(this.bullseye.lat, this.bullseye.lng));
}
}
}