{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "[](https://demo.leafmap.org/lab/index.html?path=maplibre/add_gif.ipynb)\n", "[](https://colab.research.google.com/github/opengeos/leafmap/blob/master/docs/maplibre/add_gif.ipynb)\n", "[](https://mybinder.org/v2/gh/opengeos/leafmap/HEAD)\n", "\n", "**Add GIF animations to the map**\n", "\n", "This example shows how to add GIF animations to the map.\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(center=[-100, 40], zoom=3, style=\"positron\")\n", "image = \"https://i.imgur.com/KeiAsTv.gif\"\n", "m.add_image(image=image, width=250, height=250, position=\"bottom-right\")\n", "text = \"I love sloth!🦥\"\n", "m.add_text(text, fontsize=35, padding=\"20px\")\n", "image2 = \"https://i.imgur.com/kZC2tpr.gif\"\n", "m.add_image(image=image2, bg_color=\"transparent\", position=\"bottom-left\")\n", "m" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] } ], "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 }