Skip to content

Instantly share code, notes, and snippets.

@Stapelzeiger
Last active December 24, 2015 10:58
Show Gist options
  • Save Stapelzeiger/4951c526c7031b1ba4f3 to your computer and use it in GitHub Desktop.
Save Stapelzeiger/4951c526c7031b1ba4f3 to your computer and use it in GitHub Desktop.
Leaflet.js maps in python
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "",
"signature": "sha256:2b228b5e7ca49b3197380f442250a9916fee702c72c11052f9449aa0784c33ed"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import folium"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"map = folium.Map(location=[45.5236, -122.6750], zoom_start=10, max_zoom=15, tiles='Stamen Terrain')"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#map tiles can be foud on http://leaflet-extras.github.io/leaflet-providers/preview/index.html\n",
"tileset = r'http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png'\n",
"attr = '&copy; <a href=\"http://www.opencyclemap.org\">OpenCycleMap</a>, &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n",
"map = folium.Map(location=[46.517783, 6.564362], zoom_start=13,\n",
" tiles=tileset, attr=attr)\n",
"map.circle_marker(location=[46.517783, 6.564362], radius=100,\n",
" popup='My Popup Info', line_color='#3186cc',\n",
" fill_color='#3186cc', fill_opacity=0.2)"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"map"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment