Skip to content

Commit

Permalink
Add to_streamlit and more examples (#777)
Browse files Browse the repository at this point in the history
* Add to_streamlit and more examples

* Add Map.rotate_to method

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add variable label placement notebook

* Add restrict bounds notebook

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add PMTiles notebook

* Add navigation notebook

* Update get_api_key function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update get_api_key function

* Add multiple geometries example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add more notebook examples

* Add open_geojson method

* Add more functions and examples

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add line gradient notebook

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
giswqs and pre-commit-ci[bot] committed Jun 21, 2024
1 parent e7cc5a0 commit 3ff7f7a
Show file tree
Hide file tree
Showing 37 changed files with 2,895 additions and 51 deletions.
6 changes: 3 additions & 3 deletions docs/maplibre/3d_buildings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Display buildings in 3D**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Display buildings in 3D](https://maplibre.org/maplibre-gl-js/docs/examples/3d-buildings).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Display buildings in 3D](https://maplibre.org/maplibre-gl-js/docs/examples/3d-buildings/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/basic-v2/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down Expand Up @@ -136,7 +136,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/maplibre/3d_indoor_mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Extrude polygons for 3D indoor mapping**\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",
"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."
]
Expand Down
2 changes: 1 addition & 1 deletion docs/maplibre/3d_terrain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**3D Terrain**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [3D Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [3D Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down
6 changes: 3 additions & 3 deletions docs/maplibre/_template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**MapLibre Example**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [maplibre_xxx](https://maplibre.org/maplibre-gl-js/docs/examples/maplibre_xxx).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [maplibre_xxx](https://maplibre.org/maplibre-gl-js/docs/examples/maplibre_xxx/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down Expand Up @@ -87,7 +87,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/add_image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Add an icon to the map**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/add_image_generated.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Add a generated icon to the map**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a generated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-generated).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a generated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-generated/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -57,7 +57,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/add_marker.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Add a default marker**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a default marker](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-marker).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a default marker](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-marker/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -68,7 +68,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/add_video.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Add a video**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a video](https://maplibre.org/maplibre-gl-js/docs/examples/video-on-a-map).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a video](https://maplibre.org/maplibre-gl-js/docs/examples/video-on-a-map/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")"
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/maplibre/deckgl_layer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Add deck.gl layers**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Create deck.gl layer using REST API](https://maplibre.org/maplibre-gl-js/docs/examples/add-deckgl-layer-using-rest-api).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Create deck.gl layer using REST API](https://maplibre.org/maplibre-gl-js/docs/examples/add-deckgl-layer-using-rest-api/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/fit_bounds.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Fit a map to a bounding box**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fitbounds).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fitbounds/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/fly_to.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Fly to a location**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/fly_to_options.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Slowly fly to a location**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Slowly fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto-options).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Slowly fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto-options/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/fullscreen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**View a fullscreen map**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [View a fullscreen map](https://maplibre.org/maplibre-gl-js/docs/examples/fullscreen).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [View a fullscreen map](https://maplibre.org/maplibre-gl-js/docs/examples/fullscreen/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/maplibre/geojson_line.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"**Add a GeoJSON line**\n",
"\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a GeoJSON line](https://maplibre.org/maplibre-gl-js/docs/examples/geojson-line).\n",
"This source code of this example is adapted from the MapLibre GL JS example - [Add a GeoJSON line](https://maplibre.org/maplibre-gl-js/docs/examples/geojson-line/).\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
Expand Down Expand Up @@ -56,7 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"MAPTILER_KEY = os.environ.get(\"MAPTILER_KEY\")\n",
"MAPTILER_KEY = leafmap.get_api_key(\"MAPTILER_KEY\")\n",
"style = f\"https://api.maptiler.com/maps/streets/style.json?key={MAPTILER_KEY}\""
]
},
Expand Down
Loading

0 comments on commit 3ff7f7a

Please sign in to comment.