Fix toggleLayer null checkbox, add /api/real_shots route
This commit is contained in:
15
app.py.final
15
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)
|
||||
|
||||
Reference in New Issue
Block a user