Hello,
I'm fairly new to TimeMap. I am implementing a version of TimeMap with
google maps v3, using a Google spreadsheet to provide data for my
timeline and map. I have basically copied and pasted from timeMap
examples and changed lines of code to match my specific needs.
I have been unable to get my description bubbles to automatically
disappear when another event marker is selected either on the map or
the timeline itself. I assume this should be the default behavior
since I haven't found any other threads on the issue. Why would this
not be working (see code below)?
In addition to this issue, does anyone know if it is possible to have
imprecise start and end dates for events in the timeline while using
the timeMap interface? If it is possible, could you provide an
example implementation for one imprecise duration event? I have
commented out code that I assumed would have been the correct
implementation for this issue, but did not result in any changes in my
timeline.
Thanks for your help!
-Gabe
html code below:
<!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>Art History Example</title>
<script type="text/javascript" src="
http://maps.google.com/maps/
api/js?
sensor=false&key=ABQIAAAAGIqlDliIK8VkXkJGb3KfQxRejvqmi1fk_fUV8G6u33Kpaf23LhRkMj-
DRiDlNzAM0NLo9g8fxuzVnA"></script>
<script type="text/javascript" src="../lib/jquery-1.4.4.min.js"></
script>
<script type="text/javascript" src="../lib/mxn/mxn.js?
(googlev3)"></script>
<script type="text/javascript" src="../lib/timeline-2.3.0.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">
//https: //
spreadsheets.google.com/spreadsheet/pub?
hl=en&hl=en&key=0Ajx3M2Ty1uetdGZsR2IwOExTajUtdUFsTjJ4TVBYVHc&output=html
var tm;
$(function () {
// make a custom map style
var styledMapType = new google.maps.StyledMapType([
{
featureType: "road",
elementType: "all",
stylers: [
{ saturation: 50 },
{ lightness: 50 }
]
},
{
featureType: "all",
elementType: "all",
stylers: [
{ saturation: 0 }
]
}
], {
name: "white"
});
tm = TimeMap.init({
mapId: "map", // Id of map div element
(required)
timelineId: "timeline", // Id of timeline div
element (required)
options: {
centerMapOnItems: true,
mapType: "physical",
eventIconPath: "../images/"
},
datasets: [
{
title: "Events",
id: "events",
theme: "default",
type: "gss",
options: {
// note that your spreadsheet must be
published for this to work
key:
"0Ajx3M2Ty1uetdGZsR2IwOExTajUtdUFsTjJ4TVBYVHc",
// map spreadsheet column names to
expected ids
paramMap: {
start: "StartDate",
//latestStart: "latestStart",
//earliestEnd: "earliestEnd",
//durationEvent: "isDuration",
end: "EndDate"
},
// 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'>Details</th></tr>" +
"<tr><th>Event</
th><td>{{title}}</td></tr>" +
"<tr><th>Description</
th><td>{{description}}</td></tr>" +
"</table>",
}
}
],
bandIntervals: [
Timeline.DateTime.DECADE,
Timeline.DateTime.CENTURY
]
});
// set the map to our custom style
var gmap = tm.getNativeMap();
gmap.mapTypes.set("white", styledMapType);
gmap.setMapTypeId("white");
});
</script>
<link href="style.css" type="text/css" rel="stylesheet"/>
<style>
div#timelinecontainer{ height: 300px; }
div#mapcontainer{ height: 300px; }
</style>
</head>
<body onload="onLoad();">
<div id="help">
<h1>Art History Example</h1>
Here is a TimeMap loaded from this google spreadsheet: (<a
href="//
spreadsheets.google.com/spreadsheet/pub?
hl=en&hl=en&key=0Ajx3M2Ty1uetdGZsR2IwOExTajUtdUFsTjJ4TVBYVHc&output=html"
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>