From 1e9753bcf5d46144e504a1f5dc58d49e25e21e55 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Fri, 25 Oct 2024 23:38:00 -0400 Subject: [PATCH] Change positron style basemap for maplibre --- docs/maplibre/openfreemap.ipynb | 2 +- leafmap/maplibregl.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/maplibre/openfreemap.ipynb b/docs/maplibre/openfreemap.ipynb index 2f52f8f42e..3ae2cb28c0 100644 --- a/docs/maplibre/openfreemap.ipynb +++ b/docs/maplibre/openfreemap.ipynb @@ -73,7 +73,7 @@ "metadata": {}, "outputs": [], "source": [ - "m = leafmap.Map(style=\"positron\")\n", + "m = leafmap.Map(style=\"positron2\")\n", "m" ] } diff --git a/leafmap/maplibregl.py b/leafmap/maplibregl.py index a79f5223ed..d8a44eb68e 100644 --- a/leafmap/maplibregl.py +++ b/leafmap/maplibregl.py @@ -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. @@ -78,7 +78,7 @@ def __init__( """ carto_basemaps = [ "dark-matter", - "carto-positron", + "positron", "voyager", "positron-nolabels", "dark-matter-nolabels", @@ -87,7 +87,7 @@ def __init__( openfreemap_basemaps = [ "liberty", "bright", - "positron", + "positron2", ] if isinstance(style, str): @@ -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()}"