This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path#index.html#
103 lines (94 loc) · 3.08 KB
/
#index.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
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="cartodb.css"-->
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" -->
<link rel="stylesheet" type="text/css" href="my.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="https://raw.github.com/Vizzuality/cartodb-gmapsv3/gh-pages/cartodb-gmapsv3.js"></script>
<script type="text/javascript" src="https://raw.github.com/Vizzuality/cartodb-gmapsv3/gh-pages/wax.g.js"></script>
<script type="text/javascript">
var map, trails, beaches, oahu, center, loc, island;
center = new google.maps.LatLng(21.048400224902007, -157.37989649999997);
oahu = new google.maps.LatLng(21.438912,-158.000056);
function initialize() {
var myOptions = {
zoom: 12,
center: center,
mapTypeId: google.maps.MapTypeId.SATELLITE
};
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
trails = new google.maps.CartoDBLayer({
map_canvas: 'map_canvas',
map: map,
user_name:"outdoorshawaii",
table_name: 'trails',
query: "SELECT * FROM trails",
map_style: true,
infowindow: true,
auto_bound: true
});
/*
var beaches = new google.maps.CartoDBLayer({
map_canvas: 'map_canvas',
map: map,
user_name:"outdoorshawaii",
table_name: 'beaches',
query: "SELECT * FROM beaches",
map_style: true,
infowindow: true,
auto_bound: true
});
*/
$('form').submit(function(ev){
ev.stopPropagation(); ev.preventDefault();
var value = $(this).find('input').val();
cartodb1_gmapsv3.update(value);
});
}
function toggle(obj){
if (loc) loc.className='';
obj.className='selected';
loc=obj;
//get tab selected
var zoom = $("li").filter(".selected").text();
switch(zoom)
{
case "Oahu":
map.setZoom(01);
map.panTo(oahu);
break;
case "All Islands":
map.setZoom(7);
map.panTo(center);
break;
}
}
</script>
</head>
<body onload="initialize()"
<div id="wrapper">
<div id="h">
<h4>Outdoors Hawaii</h4>
<ul id="locs">
<li onclick="toggle(this)">All Islands</li>
<li onclick="toggle(this)">Oahu</li>
<li onclick="toggle(this)">Kauai</li>
<li onclick="toggle(this)">Big Island</li>
<li onclick="toggle(this)">Maui</li>
</ul>
</div>
<div id="sidebar">
<ul>
<script type="text/javascript">
for(i=0; i<10; i++)
document.write("<li>List Item " + i + "</li>");
</script>
</ul>
</div>
<div id="map_canvas"></div>
<div id="info"></div>
</div>
</body>
</html>