index.html
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<link rel="stylesheet" href="//asset.geosprocket.com/leaflet/cluster/MarkerCluster.Default.css" />
<style type="text/css">
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
}
</style>
<script src="//cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//asset.geosprocket.com/leaflet/cluster/leaflet.markercluster.js"></script>
<body>
<div id="map"></div>
<script>
var baseLayer = L.tileLayer('//a.tiles.mapbox.com/v3/landplanner.map-b31zy3ud/{z}/{x}/{y}.png', {
maxZoom: 18
});
var markers = L.markerClusterGroup();
$.getJSON("//geosprocket.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT * FROM qhp_individual_medical_landscape_102913a WHERE state LIKE 'IN'", function(data) {
var geojson = L.geoJson(data, {
onEachFeature: function (feature, layer) {
layer.bindPopup("<h2>" + feature.properties.plan_marketing_name + "</h2><hr><p>Monthly Individual Premium: $" + feature.properties.premium_adult_individual_age_27 + "</p>");
}
});
markers.addLayer(geojson);
var map = L.map('map', {maxZoom: 9}).fitBounds(markers.getBounds());
baseLayer.addTo(map);
markers.addTo(map);
});
</script>
</body>
</html>