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

Change positron style basemap for maplibre #937

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/maplibre/openfreemap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(style=\"positron\")\n",
"m = leafmap.Map(style=\"positron2\")\n",
"m"
]
}
Expand Down
10 changes: 4 additions & 6 deletions leafmap/maplibregl.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def __init__(
bearing (float, optional): The bearing of the map. Measured in degrees
counter-clockwise from north. Defaults to 0.
style (str, optional): The style of the map. It can be a string or a URL.
If it is a string, it must be one of the following: "dark-matter",
If it is a string, it must be one of the following: "dark-matter", "positron",
"carto-positron", "voyager", "positron-nolabels", "dark-matter-nolabels",
"voyager-nolabels", "demotiles", "liberty", "bright", or "positron".
"voyager-nolabels", "demotiles", "liberty", "bright", or "positron2".
If a MapTiler API key is set, you can also use any of the MapTiler styles,
such as aquarelle, backdrop, basic, bright, dataviz, landscape, ocean,
openstreetmap, outdoor, satellite, streets, toner, topo, winter, etc.
Expand All @@ -78,7 +78,7 @@ def __init__(
"""
carto_basemaps = [
"dark-matter",
"carto-positron",
"positron",
"voyager",
"positron-nolabels",
"dark-matter-nolabels",
Expand All @@ -87,7 +87,7 @@ def __init__(
openfreemap_basemaps = [
"liberty",
"bright",
"positron",
"positron2",
]
if isinstance(style, str):

Expand All @@ -107,8 +107,6 @@ def __init__(
)

elif style.lower() in carto_basemaps:
if style.lower() == "carto-positron":
style = "positron"
style = construct_carto_basemap_url(style.lower())
elif style.lower() in openfreemap_basemaps:
style = f"https://tiles.openfreemap.org/styles/{style.lower()}"
Expand Down
Loading