In [1]:
from lets_plot import *
from lets_plot.settings_utils import *
In [2]:
LetsPlot.setup_html(isolated_frame=True, offline=False)
In [3]:
# vector tiles by default without any setup
ggplot() + geom_livemap()
Out[3]:
In [4]:
# dark theme - changed without url
LetsPlot.set(maptiles_lets_plot(theme='dark'))
ggplot() + geom_livemap()
Out[4]:
In [5]:
# light theme - changed witout url
LetsPlot.set(maptiles_lets_plot(theme='light'))
ggplot() + geom_livemap()
Out[5]:
In [6]:
# raster tiles to global settings
LetsPlot.set(maptiles_zxy(url='https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'))
ggplot() + geom_livemap()
Out[6]:
In [7]:
# This won't work - vector tiles server URL is not in settings anymore
#LetsPlot.set(maptiles_lets_plot(theme='light'))
In [8]:
# 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'))
Out[8]:
In [9]:
# Set vector tiles config with theme globally
LetsPlot.set(maptiles_lets_plot(url='wss://tiles.datalore.jetbrains.com', theme='dark'))
ggplot() + geom_livemap()
Out[9]:
In [10]:
# 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')
Out[10]:
In [11]:
ggplot() + geom_livemap(tiles='http://tile.stamen.com/terrain/{z}/{x}/{y}.png')
Out[11]: