127 lines
4.1 KiB
HTML
127 lines
4.1 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
|
<title>Google Spreadsheet, Arbitrary Columns Example</title>
|
|
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAASI0kCI-azC8RgbOZzWc3VRRarOQe_TKf_51Omf6UUSOFm7EABRRhO0PO4nBAO9FCmVDuowVwROLo3w"
|
|
type="text/javascript"></script>
|
|
<script type="text/javascript" src="../lib/jquery-1.6.2.min.js"></script>
|
|
<script type="text/javascript" src="../lib/mxn/mxn.js?(google)"></script>
|
|
<script type="text/javascript" src="../lib/timeline-1.2.js"></script>
|
|
<script src="../src/timemap.js" type="text/javascript"></script>
|
|
<script src="../src/param.js" type="text/javascript"></script>
|
|
<script src="../src/loaders/json.js" type="text/javascript"></script>
|
|
<script src="../src/loaders/google_spreadsheet.js" type="text/javascript"></script>
|
|
<script type="text/javascript">
|
|
|
|
var tm;
|
|
$(function() {
|
|
|
|
tm = TimeMap.init({
|
|
mapId: "map", // Id of map div element (required)
|
|
timelineId: "timeline", // Id of timeline div element (required)
|
|
options: {
|
|
eventIconPath: "../images/"
|
|
},
|
|
datasets: [
|
|
{
|
|
title: "Events",
|
|
id: "events",
|
|
theme: "red",
|
|
type: "gss",
|
|
options: {
|
|
// note that your spreadsheet must be published for this to work
|
|
key: "tu0AB_xb1LtMTuQwIn_ExSQ",
|
|
// map spreadsheet column names to expected ids
|
|
paramMap: {
|
|
start: "date"
|
|
},
|
|
// load extra data from non-standard spreadsheet columns
|
|
extraColumns: [
|
|
"city",
|
|
"depthft",
|
|
"pitno."
|
|
],
|
|
// let's do something with that extra data!
|
|
infoTemplate: "<table style='quarrytable'>" +
|
|
"<tr><th colspan='2' class='title'>Quarry Details</th></tr>" +
|
|
"<tr><th>Owner</th><td>{{title}}</td></tr>" +
|
|
"<tr><th>Name</th><td>{{description}}</td></tr>" +
|
|
"<tr><th>Location</th><td>{{city}}</td></tr>" +
|
|
"<tr><th>Depth</th><td>{{depthft}}</td></tr>" +
|
|
"<tr><th>Pit Number</th><td>{{pitno.}}</td></tr>" +
|
|
"</table>"
|
|
}
|
|
}
|
|
],
|
|
bandIntervals: [
|
|
Timeline.DateTime.YEAR,
|
|
Timeline.DateTime.DECADE
|
|
]
|
|
});
|
|
});
|
|
</script>
|
|
<link href="examples.css" type="text/css" rel="stylesheet"/>
|
|
<style>
|
|
div#timelinecontainer{
|
|
width: 100%;
|
|
height: 40%;
|
|
}
|
|
|
|
div#timeline{
|
|
width: 100%;
|
|
height: 100%;
|
|
font-size: 12px;
|
|
background: #CCCCCC;
|
|
}
|
|
|
|
div#mapcontainer {
|
|
width: 100%;
|
|
height: 60%;
|
|
}
|
|
|
|
#timemap {
|
|
height: 650px;
|
|
}
|
|
div#map {
|
|
width: 100%;
|
|
height: 100%;
|
|
background: #EEEEEE;
|
|
}
|
|
|
|
table.quarrytable {
|
|
border:1px solid #000;
|
|
width:300px;
|
|
}
|
|
|
|
table.quarrytable tr td {
|
|
padding: 5px;
|
|
}
|
|
th {
|
|
font-weight: bold;
|
|
text-align: left;
|
|
}
|
|
th.title {
|
|
text-align: center;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="help">
|
|
<h1>Google Spreadsheet, Arbitrary Columns</h1>
|
|
In this example, we're loading items from a Google Spreadsheet (<a href="http://spreadsheets.google.com/pub?key=tu0AB_xb1LtMTuQwIn_ExSQ" target=_blank>published here</a>). Additional arbitrary columns are loaded using the "extraColumns" setting, and displayed in the info window.
|
|
</div>
|
|
<div id="timemap">
|
|
<div id="timelinecontainer">
|
|
<div id="timeline"></div>
|
|
</div>
|
|
<div id="mapcontainer">
|
|
<div id="map"></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|