Skip to content

Instantly share code, notes, and snippets.

@wrobstory
Last active December 17, 2015 03:48
Show Gist options
  • Save wrobstory/5545719 to your computer and use it in GitHub Desktop.
Save wrobstory/5545719 to your computer and use it in GitHub Desktop.
Folium OpenStreetMap Base
# -*- coding: utf-8 -*-
'''Test of Folium basic OSM map'''
import folium
#Standard OSM
map = folium.Map(location=[45.5236, -122.6750])
map.create_map()
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.ie.css" />
<![endif]-->
<style>
#map {
position:absolute;
top:0;
bottom:0;
right:0;
left:0;
}
</style>
</head>
<body>
<div id="map" style="width: 960px; height: 500px"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<script>
var map = L.map('map').setView([45.5236, -122.675], 10);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
}).addTo(map);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment