torque/examples/leaflet.html
2013-08-29 15:22:50 +02:00

68 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html>
<link rel="stylesheet" href="../vendor/leaflet.css" />
<style>
#map, html, body {
width: 100%; height: 100%; padding: 0; margin: 0;
}
</style>
<body>
<div id="map"></div>
<script src="../vendor/leaflet.js"></script>
<script src="../vendor/underscore.js"></script>
<script src="../vendor/carto.js"></script>
<script src="../lib/torque/cartocss_reference.js"></script>
<script src="../lib/torque/profiler.js"></script>
<script src="../lib/torque/request.js"></script>
<script src="../lib/torque/leaflet/leaflet_tileloader_mixin.js"></script>
<script src="../lib/torque/leaflet/canvas_layer.js"></script>
<script src="../lib/torque/renderer/point.js"></script>
<script src="../lib/torque/renderer/rectangle.js"></script>
<script src="../lib/torque/provider.json.js"></script>
<script src="../lib/torque/provider.jsonarray.js"></script>
<script src="../lib/torque/leaflet/torque.js"></script>
<script>
var map = new L.Map('map', {
zoomControl: true,
//center: [0, 0],
center: [36.60670888641815, 38.627929687],
zoom: 6
});
L.tileLayer('http://b.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/999/256/{z}/{x}/{y}.png', {
attribution: 'Stamen'
}).addTo(map);
//type=DATASET
//var GBIF_URL = 'http://apidev.gbif.org/map/density/tile.tcjson?key=8575f23e-f762-11e1-a439-00145eb45e9a&x={x}&y={y}&z={z}&type=DATASET'
var GBIF_URL = 'http://apidev.gbif.org/map/density/tile/density/tile.tcjson?key=1&x={x}&y={y}&z={z}&type=TAXON'
var torqueLayer = new L.TiledTorqueLayer({
//url: 'http://development.localhost.lan:8080/api/v1/sql',
provider: 'url_template',
url: GBIF_URL,
resolution: 4,
cummulative: true,
start_date: 0,
end_date: 220,
step: 1,
table: 'importing_1369045322_helsinki_manydays_live',
column: 'ac',
countby: 'count(mm)',
pixel_size: 3
});
torqueLayer.addTo(map);
torqueLayer.setKey([11, 2]);
var t = 0;
setInterval(function() {
//torqueLayer.setKey(2 + (t++%11));
}, 1000);
</script>
</body>
</html>