ALKMaps.Strategy.Paging

Strategy for vector feature paging

Inherits from

Summary
ALKMaps.Strategy.PagingStrategy for vector feature paging
Properties
features{Array(ALKMaps.Feature.Vector)} Cached features.
length{Integer} Number of features per page.
num{Integer} The currently displayed page number.
paging{Boolean} The strategy is currently changing pages.
Constructor
ALKMaps.Strategy.PagingCreate a new paging strategy.
Functions
activateActivate the strategy.
deactivateDeactivate the strategy.
cacheFeaturesCache features before they are added to the layer.
clearCacheClear out the cached features.
pageCountGet the total count of pages given the current cache of features.
pageNumGet the zero based page number.
pageLengthGets or sets page length.
pageNextDisplay the next page of features.
pagePreviousDisplay the previous page of features.
pageDisplay the page starting at the given index from the cache.

Properties

features

{Array(ALKMaps.Feature.Vector)} Cached features.

length

{Integer} Number of features per page.  Default is 10.

num

{Integer} The currently displayed page number.

paging

{Boolean} The strategy is currently changing pages.

Constructor

ALKMaps.Strategy.Paging

Create a new paging strategy.

Parameters

options{Object} Optional object whose properties will be set on the instance.

Functions

activate

activate: function()

Activate the strategy.  Register any listeners, do appropriate setup.

Returns

{Boolean} The strategy was successfully activated.

deactivate

deactivate: function()

Deactivate the strategy.  Unregister any listeners, do appropriate tear-down.

Returns

{Boolean} The strategy was successfully deactivated.

cacheFeatures

cacheFeatures: function(event)

Cache features before they are added to the layer.

Parameters

event{Object} The event that this was listening for.  This will come with a batch of features to be paged.

clearCache

clearCache: function()

Clear out the cached features.  This destroys features, assuming nothing else has a reference.

pageCount

pageCount: function()

Get the total count of pages given the current cache of features.

Returns

{Integer} The page count.

pageNum

pageNum: function()

Get the zero based page number.

Returns

{Integer} The current page number being displayed.

pageLength

pageLength: function(newLength)

Gets or sets page length.

Parameters

newLength{Integer} Optional length to be set.

Returns

{Integer} The length of a page (number of features per page).

pageNext

pageNext: function(event)

Display the next page of features.

Returns

{Boolean} A new page was displayed.

pagePrevious

pagePrevious: function()

Display the previous page of features.

Returns

{Boolean} A new page was displayed.

page

page: function(start,
event)

Display the page starting at the given index from the cache.

Returns

{Boolean} A new page was displayed.

Vector features use the ALKMaps.Geometry classes as geometry description.
activate: function()
Activate the strategy.
deactivate: function()
Deactivate the strategy.
cacheFeatures: function(event)
Cache features before they are added to the layer.
clearCache: function()
Clear out the cached features.
pageCount: function()
Get the total count of pages given the current cache of features.
pageNum: function()
Get the zero based page number.
pageLength: function(newLength)
Gets or sets page length.
pageNext: function(event)
Display the next page of features.
pagePrevious: function()
Display the previous page of features.
page: function(start,
event)
Display the page starting at the given index from the cache.
Abstract vector layer strategy class.
Close