-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathzoom.html
56 lines (56 loc) · 1.54 KB
/
zoom.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
layout: default
---
<h3>Zoom to specific pueblo and then back to the original.</h3>
<div id = 'pueblos-map'>
<script type = 'text/javascript'>
// change the argument to match your id
var node = document.getElementById("pueblos-map");
var after_drawing = function after_drawing(atlas){
atlas.zoom_to_pueblo("Barranquitas",
// zoom happens in some time, function gets called at the end of zooming.
function(){
atlas.zoom_to_pueblo("Mayagüez",
// zoom happens in some time, function gets called at the end of zooming.
function(){
atlas.zoom_to_original();
})
});
};
var config = {
node: node,
tiles: 'pueblos',
size: "large",
zoom: true,
labels: true,
on_ready: after_drawing
};
new AtlasPR(config);
</script>
<div id = "code">
{% highlight js linenos %}
// change the argument to match your id
var node = document.getElementById("pueblos-map");
var after_drawing = function after_drawing(atlas){
atlas.zoom_to_pueblo("Barranquitas",
// zoom happens in some time, function gets called at the end of zooming.
function(){
atlas.zoom_to_pueblo("Mayagüez",
// zoom happens in some time, function gets called at the end of zooming.
function(){
atlas.zoom_to_original();
})
});
};
var config = {
node: node,
tiles: 'pueblos',
size: "large",
zoom: true,
labels: true,
on_ready: after_drawing
};
new AtlasPR(config);
{% endhighlight %}
</div>
</div>