Skip to content

Instantly share code, notes, and snippets.

@crstn crstn/index.html
Created Aug 20, 2015

Embed
What would you like to do?
<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
You can’t perform that action at this time.