Skip to content

Instantly share code, notes, and snippets.

@geneorama
Last active August 29, 2015 14:06
Show Gist options
  • Save geneorama/d5e4b3c771a6cedbbb30 to your computer and use it in GitHub Desktop.
Save geneorama/d5e4b3c771a6cedbbb30 to your computer and use it in GitHub Desktop.
Leaflet_example_3
// Gene Leynes 2014-09-23 SOME EDITS
// Example taken (borrowed) from http://leafletjs.com/
// I'm using this example to test http://bl.ocks.org/
// (this should now be index.html)
<!DOCTYPE html>
<meta charset="utf-8">
<style>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<div id="map"></div>
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView([51.505, -0.09], 13);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// add a marker in the given location, attach some popup content to it and open the popup
L.marker([51.5, -0.09]).addTo(map)
.bindPopup('A pretty CSS3 popup. <br> Easily customizable.')
.openPopup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment