From 3e9990bb01cd1183e55924276cccdfcc1e2d8678 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Mon, 24 Jun 2024 10:06:20 -0400 Subject: [PATCH 1/3] Fix add_geojson paint bug --- leafmap/maplibregl.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/leafmap/maplibregl.py b/leafmap/maplibregl.py index a6014db6d8..74ea579c7a 100644 --- a/leafmap/maplibregl.py +++ b/leafmap/maplibregl.py @@ -500,24 +500,24 @@ def add_geojson( if geom_type in ["Point", "MultiPoint"]: if layer_type is None: layer_type = "circle" - paint = { - "circle-radius": 5, - "circle-color": "#3388ff", - "circle-stroke-color": "#ffffff", - "circle-stroke-width": 1, - } + paint = { + "circle-radius": 5, + "circle-color": "#3388ff", + "circle-stroke-color": "#ffffff", + "circle-stroke-width": 1, + } elif geom_type in ["LineString", "MultiLineString"]: if layer_type is None: layer_type = "line" - paint = {"line-color": "#3388ff", "line-width": 2} + paint = {"line-color": "#3388ff", "line-width": 2} elif geom_type in ["Polygon", "MultiPolygon"]: if layer_type is None: layer_type = "fill" - paint = { - "fill-color": "#3388ff", - "fill-opacity": 0.8, - "fill-outline-color": "#ffffff", - } + paint = { + "fill-color": "#3388ff", + "fill-opacity": 0.8, + "fill-outline-color": "#ffffff", + } if paint is not None: kwargs["paint"] = paint From 8bac12455d293c4b1c7f03d490757c0b699d65de Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Mon, 24 Jun 2024 11:01:14 -0400 Subject: [PATCH 2/3] Fix geodataset error --- docs/notebooks/13_geopandas.ipynb | 14 +++++++++++++- docs/workshops/FOSS4G_2021.ipynb | 2 +- docs/workshops/YouthMappers_2021.ipynb | 2 +- examples/notebooks/13_geopandas.ipynb | 6 +++++- examples/workshops/FOSS4G_2021.ipynb | 2 +- examples/workshops/YouthMappers_2021.ipynb | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/notebooks/13_geopandas.ipynb b/docs/notebooks/13_geopandas.ipynb index be64ab94b1..84676692ca 100644 --- a/docs/notebooks/13_geopandas.ipynb +++ b/docs/notebooks/13_geopandas.ipynb @@ -138,7 +138,7 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = gpd.datasets.get_path(\"nybb\")\n", + "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] @@ -196,6 +196,18 @@ "display_name": "Python 3", "language": "python", "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.8" } }, "nbformat": 4, diff --git a/docs/workshops/FOSS4G_2021.ipynb b/docs/workshops/FOSS4G_2021.ipynb index a839b61f2d..c2fe6b3eac 100644 --- a/docs/workshops/FOSS4G_2021.ipynb +++ b/docs/workshops/FOSS4G_2021.ipynb @@ -1785,7 +1785,7 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = gpd.datasets.get_path(\"nybb\")\n", + "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/docs/workshops/YouthMappers_2021.ipynb b/docs/workshops/YouthMappers_2021.ipynb index b3be51f3e2..52aac8558b 100644 --- a/docs/workshops/YouthMappers_2021.ipynb +++ b/docs/workshops/YouthMappers_2021.ipynb @@ -1698,7 +1698,7 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = gpd.datasets.get_path(\"nybb\")\n", + "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/examples/notebooks/13_geopandas.ipynb b/examples/notebooks/13_geopandas.ipynb index be64ab94b1..afbea7ce69 100644 --- a/examples/notebooks/13_geopandas.ipynb +++ b/examples/notebooks/13_geopandas.ipynb @@ -138,7 +138,7 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = gpd.datasets.get_path(\"nybb\")\n", + "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] @@ -196,6 +196,10 @@ "display_name": "Python 3", "language": "python", "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.1.-1" } }, "nbformat": 4, diff --git a/examples/workshops/FOSS4G_2021.ipynb b/examples/workshops/FOSS4G_2021.ipynb index a839b61f2d..c2fe6b3eac 100644 --- a/examples/workshops/FOSS4G_2021.ipynb +++ b/examples/workshops/FOSS4G_2021.ipynb @@ -1785,7 +1785,7 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = gpd.datasets.get_path(\"nybb\")\n", + "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/examples/workshops/YouthMappers_2021.ipynb b/examples/workshops/YouthMappers_2021.ipynb index b3be51f3e2..52aac8558b 100644 --- a/examples/workshops/YouthMappers_2021.ipynb +++ b/examples/workshops/YouthMappers_2021.ipynb @@ -1698,7 +1698,7 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = gpd.datasets.get_path(\"nybb\")\n", + "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] From 5de63de2980a7d7b19bae92948ccc127199ff362 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:02:13 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/notebooks/13_geopandas.ipynb | 4 +++- docs/workshops/FOSS4G_2021.ipynb | 4 +++- docs/workshops/YouthMappers_2021.ipynb | 4 +++- examples/notebooks/13_geopandas.ipynb | 4 +++- examples/workshops/FOSS4G_2021.ipynb | 4 +++- examples/workshops/YouthMappers_2021.ipynb | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/notebooks/13_geopandas.ipynb b/docs/notebooks/13_geopandas.ipynb index 84676692ca..f40f919886 100644 --- a/docs/notebooks/13_geopandas.ipynb +++ b/docs/notebooks/13_geopandas.ipynb @@ -138,7 +138,9 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + "path_to_data = (\n", + " \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + ")\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/docs/workshops/FOSS4G_2021.ipynb b/docs/workshops/FOSS4G_2021.ipynb index c2fe6b3eac..c89fc955fa 100644 --- a/docs/workshops/FOSS4G_2021.ipynb +++ b/docs/workshops/FOSS4G_2021.ipynb @@ -1785,7 +1785,9 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + "path_to_data = (\n", + " \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + ")\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/docs/workshops/YouthMappers_2021.ipynb b/docs/workshops/YouthMappers_2021.ipynb index 52aac8558b..a2fabe5256 100644 --- a/docs/workshops/YouthMappers_2021.ipynb +++ b/docs/workshops/YouthMappers_2021.ipynb @@ -1698,7 +1698,9 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + "path_to_data = (\n", + " \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + ")\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/examples/notebooks/13_geopandas.ipynb b/examples/notebooks/13_geopandas.ipynb index afbea7ce69..39a5a090c7 100644 --- a/examples/notebooks/13_geopandas.ipynb +++ b/examples/notebooks/13_geopandas.ipynb @@ -138,7 +138,9 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + "path_to_data = (\n", + " \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + ")\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/examples/workshops/FOSS4G_2021.ipynb b/examples/workshops/FOSS4G_2021.ipynb index c2fe6b3eac..c89fc955fa 100644 --- a/examples/workshops/FOSS4G_2021.ipynb +++ b/examples/workshops/FOSS4G_2021.ipynb @@ -1785,7 +1785,9 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + "path_to_data = (\n", + " \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + ")\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ] diff --git a/examples/workshops/YouthMappers_2021.ipynb b/examples/workshops/YouthMappers_2021.ipynb index 52aac8558b..a2fabe5256 100644 --- a/examples/workshops/YouthMappers_2021.ipynb +++ b/examples/workshops/YouthMappers_2021.ipynb @@ -1698,7 +1698,9 @@ "metadata": {}, "outputs": [], "source": [ - "path_to_data = \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + "path_to_data = (\n", + " \"https://github.com/opengeos/datasets/releases/download/vector/nybb.geojson\"\n", + ")\n", "gdf = gpd.read_file(path_to_data)\n", "gdf" ]