-
Notifications
You must be signed in to change notification settings - Fork 19
/
example.html
166 lines (154 loc) · 4.04 KB
/
example.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!doctype html>
<html>
<head>
<title>Mapbox Example Maps</title>
<style>
.mapwrapper {
margin: 20px auto;
width: 469px;
}
#viewport, #viewport2 {
width: 469px;
height: 400px;
cursor: move;
overflow: hidden;
}
.mapwrapper {
position: relative;
}
.map-control {
position: absolute;
top: 50px;
right: 10px;
background: url(images/map-control.png) no-repeat;
height: 63px;
width: 100px;
}
.map-control a {
height: 18px;
width: 18px;
display: block;
text-indent: -999em;
position: absolute;
outline: none;
}
.map-control a:hover {
background: #535353;
opacity: .4;
filter: alpha(opacity=40);
}
.map-control a.left {
left: 39px;
top: 22px;
}
.map-control a.right {
left: 79px;
top: 22px;
}
.map-control a.up {
left: 59px;
top: 2px;
}
.map-control a.down {
left: 59px;
top: 42px;
}
.map-control a.zoom {
left: 2px;
top: 8px;
height: 21px;
width: 21px;
}
.map-control a.back {
left: 2px;
top: 31px;
height: 21px;
width: 21px;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="jquery.mapbox.js"></script>
<script src="jquery.mousewheel.js"></script>
</head>
<body>
<div class="mapwrapper">
<h4>Mousewheel enabled</h4>
<div id="viewport">
<div style="background: url(images/layer1.png) no-repeat; width: 469px; height: 400px;">
<!--top level map content goes here-->
</div>
<div style="height: 1097px; width: 1286px;">
<img src="images/layer2.jpg" alt="" />
<div class="mapcontent">
<!--map content goes here-->
</div>
</div>
<div style="height: 1794px; width: 2104px;">
<img src="images/layer3.jpg" alt="" />
<div class="mapcontent">
<!--map content goes here-->
</div>
</div>
<div style="height: 2492px; width: 2922px;">
<img src="images/layer4.jpg" alt="" />
<div class="mapcontent">
<!--map content goes here-->
</div>
</div>
</div>
</div>
<div class="mapwrapper">
<h4>Simple control panel</h4>
<div id="viewport2">
<div style="background: url(images/layer1.png) no-repeat; width: 469px; height: 400px;">
<!--top level map content goes here-->
</div>
<div style="height: 1097px; width: 1286px;">
<img src="images/layer2.jpg" alt="" />
<div class="mapcontent">
<!--map content goes here-->
</div>
</div>
<div style="height: 1794px; width: 2104px;">
<img src="images/layer3.jpg" alt="" />
<div class="mapcontent">
<!--map content goes here-->
</div>
</div>
<div style="height: 2492px; width: 2922px;">
<img src="images/layer4.jpg" alt="" />
<div class="mapcontent">
<!--map content goes here-->
</div>
</div>
</div>
<div class="map-control">
<a href="#left" class="left">Left</a>
<a href="#right" class="right">Right</a>
<a href="#up" class="up">Up</a>
<a href="#down" class="down">Down</a>
<a href="#zoom" class="zoom">Zoom</a>
<a href="#zoom_out" class="back">Back</a>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("#viewport").mapbox({mousewheel: true});
$("#viewport2").mapbox({
layerSplit: 8 //smoother transition for mousewheel
});
$(".map-control a").click(function() { //control panel
var viewport = $("#viewport2");
// this.className is same as method to be called
if(this.className == "zoom" || this.className == "back") {
viewport.mapbox(this.className, 2);//step twice
}
else {
viewport.mapbox(this.className);
}
return false;
});
});
</script>
</body>
</html>