Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docstrings #1098

Merged
merged 8 commits into from
May 8, 2024
Prev Previous commit
Next Next commit
Fix in docstrings for the geom_livemap() function.
  • Loading branch information
ASmirnov-HORIS committed May 7, 2024
commit 81ef4b17100440089abbcde8f53809cbce5f0b3a
19 changes: 7 additions & 12 deletions python-package/lets_plot/plot/geom_livemap_.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,11 @@ def geom_livemap(*,
'epsg4326' for Equirectangular projection. `projection` only works
with vector map tiles (i.e. Lets-Plot map tiles).
tiles : str
Tile provider.
Tile provider:

To use vector tiles, pass the result of the `maptiles_lets_plot()` function.

To use raster tiles, pass the result of the `maptiles_zxy()` function.
As an alternative to this function, you can explicitly pass a string -
URL to a standard raster ZXY tile provider with {z}, {x} and {y} wildcards
(e.g. 'http:https://my.tile.com/{z}/{x}/{y}.png').

The easiest way is to select tiles from a predefined list of constants
provided by the `tilesets` module.
- pass a predefined constant from the `tilesets` module (Lets-Plot's vector tiles, e.g. LETS_PLOT_COLOR, or outer raster tiles, e.g. OPEN_TOPO_MAP);
- pass a URL for a standard raster ZXY tile provider with {z}, {x} and {y} wildcards (e.g. 'http:https://my.tile.com/{z}/{x}/{y}.png') if the required tileset isn't in the module;
- pass the result of a call to a `maptiles_zxy()` function if further customisation is required (e.g. attribution or zoom).

More information about tiles can be found here:
https://lets-plot.org/python/pages/basemap_tiles.html
Expand Down Expand Up @@ -106,17 +100,18 @@ def geom_livemap(*,

.. jupyter-execute::
:linenos:
:emphasize-lines: 9
:emphasize-lines: 10

from lets_plot import *
from lets_plot import tilesets
LetsPlot.setup_html()
data = {
'city': ['New York City', 'Prague'],
'lon': [-73.7997, 14.418540],
'lat': [40.6408, 50.073658],
}
ggplot(data, aes(x='lon', y='lat')) + \\
geom_livemap(projection='epsg4326', tiles=maptiles_lets_plot(theme='dark')) + \\
geom_livemap(projection='epsg4326', tiles=tilesets.LETS_PLOT_DARK) + \\
geom_path(color='white', geodesic=True) + \\
geom_point(color='white', tooltips=layer_tooltips().line('@city')) + \\
ggtitle("The shortest path between New York and Prague")
Expand Down