Class TimeMapItem
- Defined in:
- timemap.js
The TimeMapItem object holds references to one or more map placemarks and an associated timeline event.
Constructor
TimeMapItem(data, dataset)
Static Methods
Method | |
---|---|
TimeMapItem.closeInfoWindowBasic()
Standard close window function, using the map window
|
|
TimeMapItem.openInfoWindowAjax()
Open info window function using ajax-loaded text in map window
|
|
TimeMapItem.openInfoWindowBasic()
Standard open info window function, using static text in map window
|
Fields
Field | |
---|---|
This item's parent dataset
|
|
event
:{Timeline.Event}
This item's timeline event
|
|
eventVisible
:{Boolean}
Whether the item's event is visible
|
|
map
:{Mapstraction}
The timemap's map object
|
|
opts
:{Object}
Container for optional settings passed in through the "options" parameter
|
|
placemark
:{Marker|Polyline|Array}
This item's placemark(s)
|
|
placemarkVisible
:{Boolean}
Whether the item's placemark is visible
|
|
timeline
:{Timeline}
The timemap's timeline object
|
|
visible
:{Boolean}
Whether the item is visible
|
Methods
Method | |
---|---|
changeTheme(theme, suppressLayout)
Change the theme for an item
|
|
clear(suppressLayout)
Delete placemark from map and event from timeline
|
|
Close the info window for this item.
|
|
createEvent(start, end)
Create a new event for the item.
|
|
getEnd()
Return the end date of the item's event, if any
|
|
Return the timestamp of the end date of the item's event, if any
|
|
Get the HTML for the info window, filling in the template if necessary
|
|
Return the item's "info point" (the anchor for the map info window)
|
|
Return this item's native placemark object (specific to map provider;
undefined if this item has more than one placemark)
|
|
getNext(inDataset)
Find the next item chronologically
|
|
getNextPrev(backwards, inDataset)
Find the next or previous item chronologically
|
|
getPrev(inDataset)
Find the previous item chronologically
|
|
getStart()
Return the start date of the item's event, if any
|
|
Return the timestamp of the start date of the item's event, if any
|
|
getTitle()
Return the title for this item
|
|
getType()
Return the placemark type for this item
|
|
hide()
Hide event and placemark
|
|
Hide the timeline event.
|
|
Hide the map placemark(s)
|
|
Whether the item is currently selected
(i.e.
|
|
Determine if this item's event is in the current visible area
of the top band of the timeline.
|
|
Open the info window for this item.
|
|
scrollToStart(animated)
Scroll the timeline to the start of this item's event
|
|
show()
Show event and placemark
|
|
Show the timeline event.
|
|
Show the map placemark(s)
|
Class Detail
TimeMapItem(data, dataset)
Parameters (optional) | ||
---|---|---|
data | {String} | Object containing all item data |
data.title | {String} |
Title of the item (visible on timeline)
Default: Untitled
|
data.start | {String|Date} | Start time of the event on the timeline |
data.end | {String|Date} | End time of the event on the timeline (duration events only) |
data.point | {Object} | Data for a single-point placemark: |
data.point.lat | {Float} | Latitude of map marker |
data.point.lon | {Float} | Longitude of map marker |
data.polyline | {Object[]} | Data for a polyline placemark, as an array in "point" format |
data.polygon | {Object[]} | Data for a polygon placemark, as an array "point" format |
data.overlay | {Object} | Data for a ground overlay: |
data.overlay.image | {String} | URL of image to overlay |
data.overlay.north | {Float} | Northern latitude of the overlay |
data.overlay.south | {Float} | Southern latitude of the overlay |
data.overlay.east | {Float} | Eastern longitude of the overlay |
data.overlay.west | {Float} | Western longitude of the overlay |
data.placemarks | {Object[]} | Array of placemarks, e.g. [{point:{...}}, {polyline:[...]}] |
data.options | {Object} | A container for optional arguments |
data.options.description | {String} | Plain-text description of the item |
data.options.infoPoint | {LatLonPoint} | Point indicating the center of this item |
data.options.infoHtml | {String} | Full HTML for the info window |
data.options.infoUrl | {String} | URL from which to retrieve full HTML for the info window |
data.options.infoTemplate | {String} | HTML for the info window content, with variable expressions (as "{{varname}}" by default) to be replaced by option data |
data.options.templatePattern | {String} |
Regex pattern defining variable syntax in the infoTemplate
Default: /{{([^}]+)}}/g
|
data.options.openInfoWindow | {Function} |
Function redefining how info window opens
Default: TimeMapItem.openInfoWindowBasic
|
data.options.closeInfoWindow | {Function} |
Function redefining how info window closes
Default: TimeMapItem.closeInfoWindowBasic
|
data.options.theme | {String|TimeMapTheme} | Theme applying to this item, overriding dataset theme |
data.options[...] | {mixed} | Any of the options for TimeMapTheme may be set here |
dataset | {TimeMapDataset} | Reference to the parent dataset object |
Static Method Details
TimeMapItem.closeInfoWindowBasic()
Standard close window function, using the map window
TimeMapItem.openInfoWindowAjax()
Open info window function using ajax-loaded text in map window
TimeMapItem.openInfoWindowBasic()
Standard open info window function, using static text in map window
Field Details
dataset
:{TimeMapDataset}
This item's parent dataset
event
:{Timeline.Event}
This item's timeline event
eventVisible
:{Boolean}
Whether the item's event is visible
map
:{Mapstraction}
The timemap's map object
opts
:{Object}
Container for optional settings passed in through the "options" parameter
placemark
:{Marker|Polyline|Array}
This item's placemark(s)
placemarkVisible
:{Boolean}
Whether the item's placemark is visible
timeline
:{Timeline}
The timemap's timeline object
visible
:{Boolean}
Whether the item is visible
Method Details
changeTheme(theme, suppressLayout)
Change the theme for an item
Parameters (optional) | ||
---|---|---|
theme | {TimeMapTheme|String} | New theme, or string key in TimeMap.themes |
suppressLayout | Whether to suppress laying out the timeline (e.g. for batch operations) |
- Defined in:
- manipulation.js
clear(suppressLayout)
Delete placemark from map and event from timeline
Parameters (optional) | ||
---|---|---|
suppressLayout | Whether to suppress laying out the timeline (e.g. for batch operations) |
- Defined in:
- manipulation.js
closeInfoWindow()
Close the info window for this item.
By default this is the map infoWindow, but you can set custom functions
for whatever behavior you want.
createEvent(start, end)
Create a new event for the item.
Parameters (optional) | ||
---|---|---|
start | {Date} | Start date for the event |
end | {Date} | End date for the event |
- Defined in:
- manipulation.js
getEnd()
:{Date}
Return the end date of the item's event, if any
- Returns:
- {Date} Item end dateor undefined
getEndTime()
:{Number}
Return the timestamp of the end date of the item's event, if any
- Returns:
- {Number} Item end date timestamp or undefined
getInfoHtml()
:{String}
Get the HTML for the info window, filling in the template if necessary
- Returns:
- {String} Info window HTML
getInfoPoint()
:{GLatLng}
Return the item's "info point" (the anchor for the map info window)
- Returns:
- {GLatLng} Info point
getNativePlacemark()
:{Object}
Return this item's native placemark object (specific to map provider;
undefined if this item has more than one placemark)
- Returns:
- {Object} The native placemark object (e.g. GMarker)
Find the next item chronologically
Parameters (optional) | ||
---|---|---|
inDataset | {Boolean} |
Whether to only look in this item's dataset
Default: false
|
- Returns:
- {TimeMapItem} Next item, if any
- Defined in:
- manipulation.js
Find the next or previous item chronologically
Parameters (optional) | ||
---|---|---|
backwards | {Boolean} |
Whether to look backwards (i.e. find previous)
Default: false
|
inDataset | {Boolean} |
Whether to only look in this item's dataset
Default: false
|
- Returns:
- {TimeMapItem} Next/previous item, if any
- Defined in:
- manipulation.js
Find the previous item chronologically
Parameters (optional) | ||
---|---|---|
inDataset | {Boolean} |
Whether to only look in this item's dataset
Default: false
|
- Requires:
- Timeline v.2.2.0 or greater
- Returns:
- {TimeMapItem} Next item, if any
- Defined in:
- manipulation.js
getStart()
:{Date}
Return the start date of the item's event, if any
- Returns:
- {Date} Item start date or undefined
getStartTime()
:{Number}
Return the timestamp of the start date of the item's event, if any
- Returns:
- {Number} Item start date timestamp or undefined
getTitle()
:{String}
Return the title for this item
- Returns:
- {String} Item title
getType()
:{String}
Return the placemark type for this item
- Returns:
- {String} Placemark type
hide()
Hide event and placemark
- Defined in:
- manipulation.js
hideEvent()
Hide the timeline event.
NB: Will likely require calling timeline.layout(),
AND calling eventSource._events._index() (ugh)
hidePlacemark()
Hide the map placemark(s)
isSelected()
Whether the item is currently selected
(i.e., the item's info window is open)
- Returns:
- Boolean
onVisibleTimeline()
:{Boolean}
Determine if this item's event is in the current visible area
of the top band of the timeline. Note that this only considers the
dates, not whether the event is otherwise hidden.
- Returns:
- {Boolean} Whether the item's event is visible
openInfoWindow()
Open the info window for this item.
By default this is the map infoWindow, but you can set custom functions
for whatever behavior you want when the event or placemark is clicked
scrollToStart(animated)
Scroll the timeline to the start of this item's event
Parameters (optional) | ||
---|---|---|
animated | {Boolean} | Whether to do an animated scroll, rather than a jump. |
show()
Show event and placemark
- Defined in:
- manipulation.js
showEvent()
Show the timeline event.
NB: Will likely require calling timeline.layout()
showPlacemark()
Show the map placemark(s)
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)