{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import (\n", " Map,\n", " Marker,\n", " TileLayer,\n", " ImageOverlay,\n", " Polyline,\n", " Polygon,\n", " Rectangle,\n", " Circle,\n", " CircleMarker,\n", " GeoJSON,\n", " DrawControl,\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Custom TMS Server" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "center = [39.9610845, -75.1540457]\n", "zoom = 14" ] }, { "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": [ "# Or any other appropriate url\n", "carto_url = (\n", " \"https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png\"\n", ")\n", "m.clear_layers()\n", "m.add(TileLayer(url=carto_url))" ] } ], "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.10.5" } }, "nbformat": 4, "nbformat_minor": 4 }