Fix toggleLayer null checkbox, add /api/real_shots route

This commit is contained in:
Floppyrj45
2026-02-19 15:41:35 +01:00
parent bbd6a22b57
commit f4f4c4e81f
2 changed files with 18 additions and 1 deletions

View File

@@ -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)