from lets_plot import *
from lets_plot.settings_utils import *
LetsPlot.setup_html(isolated_frame=True, offline=False)
# vector tiles by default without any setup
ggplot() + geom_livemap()
# dark theme - changed without url
LetsPlot.set(maptiles_lets_plot(theme='dark'))
ggplot() + geom_livemap()
# light theme - changed witout url
LetsPlot.set(maptiles_lets_plot(theme='light'))
ggplot() + geom_livemap()
# raster tiles to global settings
LetsPlot.set(maptiles_zxy(url='https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'))
ggplot() + geom_livemap()
# This won't work - vector tiles server URL is not in settings anymore
#LetsPlot.set(maptiles_lets_plot(theme='light'))
# pass vector tiles config directly to the livemap while raster tiles are in settings
ggplot() + geom_livemap(tiles=maptiles_lets_plot(url='wss://tiles.datalore.jetbrains.com', theme='light'))
# Set vector tiles config with theme globally
LetsPlot.set(maptiles_lets_plot(url='wss://tiles.datalore.jetbrains.com', theme='dark'))
ggplot() + geom_livemap()
# raster tiles config directly to the livemap while vector tiles are in global settings
ggplot() + geom_livemap(tiles='https://a.tile.openstreetmap.org/{z}/{x}/{y}.png')
ggplot() + geom_livemap(tiles='http://tile.stamen.com/terrain/{z}/{x}/{y}.png')