auto-sync: 2026-05-13 19:20:01
This commit is contained in:
29
tasks/enduro-trails/scripts/patch_style_load.py
Normal file
29
tasks/enduro-trails/scripts/patch_style_load.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
|
||||
path = "/home/slin/enduro-trails/prototype/static/app.js"
|
||||
with open(path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
old = """ map.setStyle(styleUrl);
|
||||
// Restore position after style loads
|
||||
map.once('style.load', () => {
|
||||
map.jumpTo({ center, zoom, bearing, pitch });
|
||||
});"""
|
||||
|
||||
new = """ map.setStyle(styleUrl);
|
||||
// Restore position after style loads
|
||||
map.once('style.load', () => {
|
||||
map.jumpTo({ center, zoom, bearing, pitch });
|
||||
setTimeout(() => rebuildMapOverlays(), 100);
|
||||
});"""
|
||||
|
||||
if old not in content:
|
||||
print("ERROR: marker not found")
|
||||
sys.exit(1)
|
||||
|
||||
content = content.replace(old, new)
|
||||
|
||||
with open(path, 'w') as f:
|
||||
f.write(content)
|
||||
|
||||
print("OK - switchMapStyle patched")
|
||||
Reference in New Issue
Block a user