{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://githubtocolab.com/gee-community/geemap/blob/master/docs/notebooks/128_add_widget.ipynb)\n", "[![image](https://mybinder.org/badge_logo.svg)](https://gishub.org/geemap-binder)\n", "\n", "Uncomment the following line to install [geemap](https://geemap.org) if needed." ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [], "source": [ "# !pip install -U geemap" ] }, { "cell_type": "code", "execution_count": null, "id": "2", "metadata": {}, "outputs": [], "source": [ "import geemap" ] }, { "cell_type": "markdown", "id": "3", "metadata": {}, "source": [ "Add text." ] }, { "cell_type": "code", "execution_count": null, "id": "4", "metadata": {}, "outputs": [], "source": [ "m = geemap.Map()\n", "text = \"Hello World\"\n", "m.add_text(text, position=\"bottomright\")\n", "m" ] }, { "cell_type": "markdown", "id": "5", "metadata": {}, "source": [ "Customize text style." ] }, { "cell_type": "code", "execution_count": null, "id": "6", "metadata": {}, "outputs": [], "source": [ "m = geemap.Map()\n", "text = \"Hello World\"\n", "\n", "params = {\n", " \"fontsize\": 30,\n", " \"fontcolor\": \"blue\",\n", " \"bold\": True,\n", " \"padding\": \"10px\",\n", " \"background\": True,\n", " \"bg_color\": \"white\",\n", " \"border_radius\": \"5px\",\n", " \"position\": \"bottomright\",\n", "}\n", "\n", "m.add_text(text, **params)\n", "m" ] }, { "cell_type": "markdown", "id": "7", "metadata": {}, "source": [ "Add image." ] }, { "cell_type": "code", "execution_count": null, "id": "8", "metadata": {}, "outputs": [], "source": [ "m = geemap.Map()\n", "image = \"https://i.imgur.com/LmTETPX.png\"\n", "m.add_image(image, position=\"bottomright\")\n", "m" ] }, { "cell_type": "markdown", "id": "9", "metadata": {}, "source": [ "Add HTML." ] }, { "cell_type": "code", "execution_count": null, "id": "10", "metadata": {}, "outputs": [], "source": [ "m = geemap.Map()\n", "html = \"\"\"\n", "