Skip to content

Commit

Permalink
Change positron style basemap for maplibre (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Oct 26, 2024
1 parent de007d8 commit d8b0ecd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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

0 comments on commit d8b0ecd

Please sign in to comment.