Skip to content

Instantly share code, notes, and snippets.

@crstn
Created August 20, 2015 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crstn/f59f53243291da59b481 to your computer and use it in GitHub Desktop.
Save crstn/f59f53243291da59b481 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Leaflet template</title>
<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>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://raw.githubusercontent.com/calvinmetcalf/leaflet-ajax/master/dist/leaflet.ajax.min.js"></script>
<style>
html, body, #map {
height: 100%;
}
</style>
<script>
// When the webpage is ready (loaded)
$(document).ready(function() {
var map = new L.Map('map',
{ center:[40.75, -73.95],
zoom: 12
});
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar'}).addTo(map);
var geojsonLayer = new L.GeoJSON.AJAX("http://carsten.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT distinct play.cartodb_id, play.the_geom, play.accessible FROM play, nyc_streets WHERE nyc_streets.aadt > 100000 and ST_DISTANCE (play.the_geom::geography, nyc_streets.the_geom::geography) < 50");
geojsonLayer.addTo(map);
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment