Skip to content

Commit

Permalink
Improve the basemap notebook (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Jul 4, 2024
1 parent a4c46a1 commit 88d74e2
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/maplibre/basemaps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,33 @@
"# os.environ[\"MAPTILER_KEY\"] = \"YOUR_API_KEY\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"By default, if the `style` parameter is not provided, the default `dark-matter` style from CartoDB will be used. Other styles can be found [here](https://github.com/CartoDB/basemap-styles/tree/master/mapboxgl), including `positron`, `voyager`, `dark-matter-nolabels`, `positron-nolabels`, and `voyager-nolabels`.\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(style=\"dark-matter\")\n",
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you have a MapTiler API key, you can use any basemap available in the MapTiler Basemap style gallery by specifying the `style` parameter. For example, `style='satellite'` will use the `satellite` basemap from MapTiler.\n",
"\n",
"![](https://i.imgur.com/dp2HxR2.png)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -58,6 +85,13 @@
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also use any raster basemaps from [xyzservices](https://github.com/geopandas/xyzservices). For example, `style='OpenTopoMap'` will use the OpenTopoMap basemap."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -69,6 +103,22 @@
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you don't know the name of the basemap, you can use the `add_basemap()` function to get a list of basemaps and select the one you like."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m.add_basemap()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 88d74e2

Please sign in to comment.