Print / Export Control¶
This notebook demonstrates how to add a print/export control for saving the map view as PNG, JPEG, or PDF.
In [ ]:
Copied!
# %pip install anymap-ts
# %pip install anymap-ts
Basic Print Control¶
In [ ]:
Copied!
from anymap_ts import Map
m = Map(center=[-122.4, 37.8], zoom=10)
m.add_print_control(position="top-right")
m
from anymap_ts import Map
m = Map(center=[-122.4, 37.8], zoom=10)
m.add_print_control(position="top-right")
m
Print Control with Layers and Options¶
In [ ]:
Copied!
m2 = Map(
center=[-112.1, 36.1],
zoom=13,
pitch=60,
bearing=-17,
style="https://tiles.openfreemap.org/styles/liberty",
)
m2.add_3d_terrain(exaggeration=1.5)
m2.add_print_control(
position="top-right",
format="png",
filename="grand-canyon",
include_north_arrow=True,
include_scale_bar=True,
)
m2
m2 = Map(
center=[-112.1, 36.1],
zoom=13,
pitch=60,
bearing=-17,
style="https://tiles.openfreemap.org/styles/liberty",
)
m2.add_3d_terrain(exaggeration=1.5)
m2.add_print_control(
position="top-right",
format="png",
filename="grand-canyon",
include_north_arrow=True,
include_scale_bar=True,
)
m2
Remove Print Control¶
In [ ]:
Copied!
m.remove_print_control()
m.remove_print_control()