{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import folium\n", "\n", "\n", "m = folium.Map(location=[41, -70], zoom_start=5, tiles=None)\n", "\n", "\n", "folium.raster_layers.TileLayer(\n", " tiles=\"http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}\",\n", " attr=\"google\",\n", " name=\"google maps\",\n", " max_zoom=20,\n", " subdomains=[\"mt0\", \"mt1\", \"mt2\", \"mt3\"],\n", " overlay=False,\n", " control=True,\n", ").add_to(m)\n", "\n", "folium.raster_layers.TileLayer(\n", " tiles=\"http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}\",\n", " attr=\"google\",\n", " name=\"google street view\",\n", " max_zoom=20,\n", " subdomains=[\"mt0\", \"mt1\", \"mt2\", \"mt3\"],\n", " overlay=False,\n", " control=True,\n", ").add_to(m)\n", "\n", "\n", "folium.raster_layers.WmsTileLayer(\n", " url=\"http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi\",\n", " name=\"test\",\n", " fmt=\"image/png\",\n", " layers=\"nexrad-n0r-900913\",\n", " attr=u\"Weather data © 2012 IEM Nexrad\",\n", " transparent=True,\n", " overlay=True,\n", " control=True,\n", ").add_to(m)\n", "\n", "folium.LayerControl().add_to(m)\n", "\n", "m" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.9.0" } }, "nbformat": 4, "nbformat_minor": 1 }