From f4f4c4e81fe9c14e21623305350d15e8b6acea2d Mon Sep 17 00:00:00 2001 From: Floppyrj45 Date: Thu, 19 Feb 2026 15:41:35 +0100 Subject: [PATCH] Fix toggleLayer null checkbox, add /api/real_shots route --- app.py.final | 15 +++++++++++++++ index.html.final | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app.py.final b/app.py.final index 5e90784..059906b 100644 --- a/app.py.final +++ b/app.py.final @@ -1671,5 +1671,20 @@ def get_coverage(): except Exception as e: return jsonify({'error': str(e)}), 500 + +@app.route('/api/real_shots') +def get_real_shots(): + """Get real shot positions.""" + try: + shots_file = os.path.join(os.path.dirname(__file__), 'static', 'real_shots.json') + if not os.path.exists(shots_file): + shots_file = os.path.join(os.path.dirname(__file__), '..', 'real_shots.json') + if os.path.exists(shots_file): + with open(shots_file) as f: + return jsonify(json.load(f)) + return jsonify({'features': [], 'type': 'FeatureCollection'}) + except Exception as e: + return jsonify({'error': str(e)}), 500 + if __name__ == '__main__': app.run(host='0.0.0.0', port=3001, debug=False) diff --git a/index.html.final b/index.html.final index ae233ff..2b7cb05 100644 --- a/index.html.final +++ b/index.html.final @@ -1671,7 +1671,9 @@ async function loadGeosupLayers() { } function toggleLayer(layerName) { - const checkbox = document.getElementById('layer' + layerName.charAt(0).toUpperCase() + layerName.slice(1)); + var idMap = {sources:'layerSources', receivers:'layerReceivers', deployments:'layerDeployments', aslaid:'layerAslaid', realshots:'layerRealShots', files:'layerFiles'}; + var checkbox = document.getElementById(idMap[layerName] || ('layer' + layerName.charAt(0).toUpperCase() + layerName.slice(1))); + if (!checkbox) return; layerVisibility[layerName] = checkbox.checked; if (layerName === 'files') {