{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import (\n", " Map,\n", " Marker,\n", " MarkerCluster,\n", " TileLayer,\n", " ImageOverlay,\n", " Polyline,\n", " Polygon,\n", " Rectangle,\n", " Circle,\n", " CircleMarker,\n", " Popup,\n", " GeoJSON,\n", " DrawControl,\n", " basemaps,\n", ")\n", "\n", "from ipywidgets import HTML" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Map" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "center = [34.6252978589571, -77.34580993652344]\n", "zoom = 10" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m = Map(center=center, zoom=zoom)\n", "m" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m.interact(zoom=(5, 10, 1))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m.clear_layers()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m.add_layer(basemaps.Esri.DeLorme)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(m.center)\n", "print(m.zoom)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Marker" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mark = Marker(location=m.center)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m += mark" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mark.interact(opacity=(0.0, 1.0, 0.01))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Popup" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "html_widget = HTML(\n", " value=\"\"\"\n", "