- Messages
- 26
- Country

Hey All
I’ve created a custom in game panel which is loading ok.
I’m having trouble however accessing simvars via the in game panel. I’m getting
error in the coherent debugger.
This is the code I’m using to load the HTML
And this is the .js
Can anyone see where I am going wrong?
It feels like I am not referencing Simvar correctly but been scratching my head all day.
I’ve created a custom in game panel which is loading ok.
I’m having trouble however accessing simvars via the in game panel. I’m getting
Code:
ReferenceError: Can’t find variable: simvar
This is the code I’m using to load the HTML
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="/SCSS/common.css" />
<link rel="stylesheet" href="G36Panel.css" />
<script type="text/javascript" src="/JS/coherent.js"></script>
<script type="text/javascript" src="/JS/common.js"></script>
<script type="text/javascript" src="/JS/dataStorage.js"></script>
<script type="text/javascript" src="/JS/simvar.js"></script>
<script type="text/javascript" src="/JS/buttons.js"></script>
<script type="text/javascript" src="/JS/Services/ToolBarPanels.js"></script>
<script type="text/javascript" src="/Pages/VCockpit/Instruments/Shared/Utils/DataReadManager.js"></script>
<script type="text/javascript" src="/Pages/VCockpit/Instruments/Shared/BaseInstrument.js"></script>
<link rel="import" href="/templates/ingameUi/ingameUi.html" />
<link rel="import" href="/templates/ingameUiHeader/ingameUiHeader.html" />
<link rel="import" href="/templates/checkbox/checkbox.html" />
<link rel="import" href="/templates/NewPushButton/NewPushButton.html" />
<link rel="import" href="/templates/ToggleButton/ToggleButton.html" />
<script type="text/javascript" src="G36Panel.js"></script>
</head>
<body class="border-box">
<g36-hanger-module>
<ingame-ui
id="G36Panel"
panel-id="G36_Hanger_Module"
title="G36 Hanger Module"
class="ingameUiFrame"
content-fit="true"
min-width="768"
min-height="500"
>
<h1>Hello</h1>
<div id="test"></div>
</ingame-ui>
</g36-hanger-module>
</body>
</html>
And this is the .js
JavaScript:
class G36Panel extends TemplateElement {
constructor() {
super();
}
}
window.customElements.define("g36-hanger-module", G36Panel);
window.onload = function() {
console.log('loaded');
var atcId = SimVar.GetSimVarValue("ATC ID", "degree latitude");
var hobbs = GetStoredData('G36XIP_HOBBS_G-STEVE')
document.getElementById("test").innerHTML = hobbs;
console.log(hobbs);
}
checkAutoload();
Can anyone see where I am going wrong?
It feels like I am not referencing Simvar correctly but been scratching my head all day.