From 5b7094ff0b3c64ba327c7091596f65f71a6617c6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 19:06:24 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/maplibre/3d_indoor_mapping.ipynb | 176 +++++++++++++------------- docs/maplibre/3d_terrain.ipynb | 24 +--- 2 files changed, 92 insertions(+), 108 deletions(-) diff --git a/docs/maplibre/3d_indoor_mapping.ipynb b/docs/maplibre/3d_indoor_mapping.ipynb index c1b8afe0a..9917afb8e 100644 --- a/docs/maplibre/3d_indoor_mapping.ipynb +++ b/docs/maplibre/3d_indoor_mapping.ipynb @@ -1,90 +1,90 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[![image](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://demo.leafmap.org/lab/index.html?path=maplibre/3d_indoor_mapping.ipynb)\n", - "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/leafmap/blob/master/docs/maplibre/3d_indoor_mapping.ipynb)\n", - "[![image](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/opengeos/leafmap/HEAD)\n", - "\n", - "**Display buildings in 3D**\n", - "\n", - "This source code of this example is adapted from the MapLibre GL JS example - [Extrude polygons for 3D indoor mapping](https://maplibre.org/maplibre-gl-js/docs/examples/3d-extrusion-floorplan).\n", - "\n", - "Uncomment the following line to install [leafmap](https://leafmap.org) if needed." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# %pip install \"leafmap[maplibre]\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import leafmap.maplibregl as leafmap" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "m = leafmap.Map(\n", - " center=(41.86625, -87.61694), zoom=17, pitch=40, bearing=20, style=\"positron\"\n", - ")\n", - "m.add_basemap(\"OpenStreetMap.Mapnik\")\n", - "data = \"https://maplibre.org/maplibre-gl-js/docs/assets/indoor-3d-map.geojson\"\n", - "m.add_geojson(\n", - " data,\n", - " layer_type=\"fill-extrusion\",\n", - " name=\"floorplan\",\n", - " paint={\n", - " \"fill-extrusion-color\": [\"get\", \"color\"],\n", - " \"fill-extrusion-height\": [\"get\", \"height\"],\n", - " \"fill-extrusion-base\": [\"get\", \"base_height\"],\n", - " \"fill-extrusion-opacity\": 0.5,\n", - " },\n", - ")\n", - "m" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![](https://i.imgur.com/emBIlfG.gif)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.9" - } - }, - "nbformat": 4, - "nbformat_minor": 4 + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "[![image](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://demo.leafmap.org/lab/index.html?path=maplibre/3d_indoor_mapping.ipynb)\n", + "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/leafmap/blob/master/docs/maplibre/3d_indoor_mapping.ipynb)\n", + "[![image](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/opengeos/leafmap/HEAD)\n", + "\n", + "**Display buildings in 3D**\n", + "\n", + "This source code of this example is adapted from the MapLibre GL JS example - [Extrude polygons for 3D indoor mapping](https://maplibre.org/maplibre-gl-js/docs/examples/3d-extrusion-floorplan).\n", + "\n", + "Uncomment the following line to install [leafmap](https://leafmap.org) if needed." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# %pip install \"leafmap[maplibre]\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import leafmap.maplibregl as leafmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "m = leafmap.Map(\n", + " center=(41.86625, -87.61694), zoom=17, pitch=40, bearing=20, style=\"positron\"\n", + ")\n", + "m.add_basemap(\"OpenStreetMap.Mapnik\")\n", + "data = \"https://maplibre.org/maplibre-gl-js/docs/assets/indoor-3d-map.geojson\"\n", + "m.add_geojson(\n", + " data,\n", + " layer_type=\"fill-extrusion\",\n", + " name=\"floorplan\",\n", + " paint={\n", + " \"fill-extrusion-color\": [\"get\", \"color\"],\n", + " \"fill-extrusion-height\": [\"get\", \"height\"],\n", + " \"fill-extrusion-base\": [\"get\", \"base_height\"],\n", + " \"fill-extrusion-opacity\": 0.5,\n", + " },\n", + ")\n", + "m" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![](https://i.imgur.com/emBIlfG.gif)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 } diff --git a/docs/maplibre/3d_terrain.ipynb b/docs/maplibre/3d_terrain.ipynb index b793fadfc..4900bfd70 100644 --- a/docs/maplibre/3d_terrain.ipynb +++ b/docs/maplibre/3d_terrain.ipynb @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "vscode": { "languageId": "plaintext" @@ -43,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -84,25 +84,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "fa5bf5d7a081442493f59bb7bfd5553c", - "version_major": 2, - "version_minor": 1 - }, - "text/plain": [ - "Map(height='600px', map_options={'bearing': 0.0, 'center': (11.39085, 47.27574), 'pitch': 52.0, 'style': {'ver…" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "m = leafmap.Map(center=[47.27574, 11.39085], zoom=12, pitch=52, style=style)\n", "m"