Ajouter le bouton d'export PDF, ses réglages et le cadre imprimable à la carte
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -1321,3 +1321,18 @@ def test_export_pdf_never_delegated(tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(mapserve, "GENERATION_URL", "http://injoignable.invalid")
|
||||
lat, lon = _center()
|
||||
assert mapserve.export_pdf_file(lat, lon, "A4", "paysage", 2000, None).body.startswith(b"%PDF")
|
||||
|
||||
|
||||
def test_map_ui_has_pdf_export():
|
||||
from lidar_pipeline.mapui import _MAP_CSS, _MAP_HTML, _MAP_JS
|
||||
for id_ in ("btnPrint", "printcard", "printPaper", "printOrient", "printScale",
|
||||
"printTitle", "printGo", "printMsg", "printClose", "printInfo"):
|
||||
assert f'id="{id_}"' in _MAP_HTML, id_
|
||||
for scale in ("1000", "2000", "5000", "10000"):
|
||||
assert f'value="{scale}"' in _MAP_HTML
|
||||
assert "api/export/frame?" in _MAP_JS and "api/export/pdf?" in _MAP_JS
|
||||
assert "createPane('printFrame')" in _MAP_JS
|
||||
assert "map.on('moveend', printRefreshFrame)" in _MAP_JS
|
||||
assert "#printcard" in _MAP_CSS
|
||||
# bouton toujours visible : indépendant de /api/status.available
|
||||
assert 'id="btnPrint"' in _MAP_HTML and 'id="btnPrint" hidden' not in _MAP_HTML
|
||||
|
||||
Reference in New Issue
Block a user