Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created July 17, 2012 20:48
Show Gist options
  • Save springmeyer/3131975 to your computer and use it in GitHub Desktop.
Save springmeyer/3131975 to your computer and use it in GitHub Desktop.
leaflet simple example of portland point
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
</head>
<body>
<div id="map" style="width: 100%; height: 100%"></div>
<script>
var map = new L.Map('map');
var osm = new L.TileLayer('http://tile.osm.org/{z}/{x}/{y}.png');
map.setView(new L.LatLng(45.5, -122.65), 12).addLayer(osm);
var pdx = { "type": "FeatureCollection", "features": [ { "type": "Feature",
"properties": { "name": "PDX" },
"geometry" : { "type": "Point","coordinates": [ -122.65, 45.5 ]}}]
};
map.addLayer(new L.GeoJSON(pdx));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment