{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.7.0+24.gf2bf6ab.dirty\n" ] } ], "source": [ "import os\n", "import folium\n", "\n", "print(folium.__version__)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lon = -(41 + 20/60. + 17/60/60.)\n", "lat = -(20 + 59/60. + 35/60/60.)\n", "\n", "min_lon, max_lon = -45, -35\n", "min_lat, max_lat = -25, -15\n", "\n", "m = folium.Map(\n", " max_bounds=True,\n", " location=[lat, lon],\n", " zoom_start=6,\n", " min_lat=min_lat,\n", " max_lat=max_lat,\n", " min_lon=min_lon,\n", " max_lon=max_lon\n", ")\n", "\n", "\n", "kw = {\n", " 'radius': 10,\n", " 'color': 'black',\n", " 'fill': True,\n", " 'weight': 1,\n", " 'fill_color': 'green',\n", " 'fill_opacity': 1\n", "}\n", "\n", "c0 = folium.CircleMarker(location=[max_lat, min_lon], tooltip='Upper Left Corner', **kw)\n", "c1 = folium.CircleMarker(location=[min_lat, min_lon], tooltip='Lower Left Corner', **kw)\n", "c2 = folium.CircleMarker(location=[min_lat, max_lon], tooltip='Lower Right Corner', **kw)\n", "c3 = folium.CircleMarker(location=[max_lat, max_lon], tooltip='Upper Right Corner', **kw)\n", "\n", "for c in [c0, c1, c2, c3]:\n", " m.add_child(c)\n", "\n", "m.save(os.path.join('results', 'MinMaxLimits.html'))\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.7.1" } }, "nbformat": 4, "nbformat_minor": 1 }