{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.3.0.dev\n" ] } ], "source": [ "import os\n", "import folium\n", "\n", "print(folium.__version__)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### RectangleMarker" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m = folium.Map(location=[35.67, 139.78], zoom_start=13)\n", "\n", "folium.features.RectangleMarker(\n", " bounds=[[35.681, 139.766], [35.691, 139.776]],\n", " color='blue',\n", " fill_color='red',\n", " popup='Tokyo, Japan').add_to(m)\n", "\n", "m.save(os.path.join('results', 'RectangleMarker_and_PolygonMarker_0.html'))\n", "\n", "m" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Polygon" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m = folium.Map(location=[35.67, 139.78], zoom_start=13)\n", "\n", "locations = [[35.6762, 139.7795],\n", " [35.6718, 139.7831],\n", " [35.6767, 139.7868],\n", " [35.6795, 139.7824],\n", " [35.6787, 139.7791]]\n", "\n", "folium.features.PolygonMarker(\n", " locations,\n", " color='blue',\n", " weight=10,\n", " fill_color='red',\n", " fill_opacity=0.5,\n", " popup='Tokyo, Japan').add_to(m)\n", "\n", "m.save(os.path.join('results', 'RectangleMarker_and_PolygonMarker_1.html'))\n", "\n", "m" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "locations = [\n", " [\n", " [7.577794326946673, 8.998503901433935],\n", " [7.577851434795945, 8.998572430673164],\n", " [7.577988491475764, 8.998652380403087],\n", " [7.578105560723088, 8.998426807051544],\n", " [7.577891409660878, 8.998289750371725],\n", " [7.577794326946673, 8.998503901433935],\n", " ],\n", " [\n", " [7.578139824893071, 8.999291979141560],\n", " [7.578359687549607, 8.999414759083890],\n", " [7.578456769364435, 8.999266281014116],\n", " [7.578471046101925, 8.999197181604700],\n", " [7.578247331649095, 8.999094883721964],\n", " [7.578139824893071, 8.99929197914156]],\n", " [\n", " [7.577851730672876, 8.997811268775080],\n", " [7.578012579816743, 8.997460464828633],\n", " [7.577798113991832, 8.997311104523930],\n", " [7.577667902951418, 8.997663440915119],\n", " [7.577851730672876, 8.997811268775080]\n", " ],\n", " [\n", " [7.578562417221803, 8.999551816663029],\n", " [7.578688052511666, 8.999654609172921],\n", " [7.578813688700849, 8.999443313458185],\n", " [7.578670920426703, 8.999369073523950],\n", " [7.578562417221803, 8.999551816663029]\n", " ],\n", " [\n", " [7.577865711533433, 8.998252059784761],\n", " [7.577989601239152, 8.998002756022402],\n", " [7.577648754586391, 8.997784460884190],\n", " [7.577545911714481, 8.998069316645683],\n", " [7.577865711533433, 8.998252059784761]\n", " ]\n", "]\n", "\n", "m = folium.Map(location=[7.577798113991832, 8.997311104523930], zoom_start=16)\n", "\n", "folium.features.PolygonMarker(locations).add_to(m)\n", "\n", "m.save(os.path.join('results', 'RectangleMarker_and_PolygonMarker_2.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.5.2" } }, "nbformat": 4, "nbformat_minor": 0 }