forked from cutting-room-floor/easey-DEAD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
time.js
30 lines (23 loc) · 950 Bytes
/
time.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var map;
window.onload = function() {
var mm = com.modestmaps;
var dmap = document.getElementById('map');
wax.tilejson('http://a.tiles.mapbox.com/v3/mapbox.mapbox-streets.jsonp',
function(tj) {
map = new com.modestmaps.Map(dmap, new wax.mm.connector(tj), null, []);
map.setCenterZoom(new com.modestmaps.Location(50, 50), 4);
var right = document.getElementById('right');
var positions = [
map.locationCoordinate({ lat: 0, lon: 0 }).zoomTo(4),
map.locationCoordinate({ lat: 20, lon: -50 }).zoomTo(4),
map.locationCoordinate({ lat: 50, lon: 50 }).zoomTo(4)];
easey.map(map);
function update() {
var pos = right.scrollTop / 500;
easey.from(positions[Math.floor(pos)])
.to(positions[Math.ceil(pos)])
.t(pos - Math.floor(pos));
}
right.addEventListener('scroll', update, false);
});
};