ALKMaps.Strategy.CustomPlaces

Strategy for custom places tiling

Inherits from

Summary
ALKMaps.Strategy.CustomPlacesStrategy for custom places tiling
Properties
ratio{Number} Optional positive integer.
resFactor{Float} Optional factor used to determine when previously requested features are invalid.
visitedTilesHash of visitedTiles.
resolutionCurrent layer resolution.
boundsCurrent layer bounds.
zoomChangedIndicator for zoom level changed or not.
Constructor
ALKMaps.Strategy.CustomPlacesA class for custom places strategy.
Functions
activateActivate the strategy.
deactivateDeactivate the strategy.
updateUpdate custom places layer.
triggerReadPrepare custom places requests in tiles.
boundsToTilesGet tiles to cover the bounds.
mergeAdd features to the layer

Properties

ratio

{Number} Optional positive integer.  The bigger ratio is, the more tiles will get.

resFactor

{Float} Optional factor used to determine when previously requested features are invalid.  If set, the resFactor will be compared to the resolution of the previous request to the current map resolution.  If resFactor > (old / new) and 1/resFactor < (old / new).  If you set a resFactor of 1, data will be requested every time the resolution changes.  If you set a resFactor of 3, data will be requested if the old resolution is 3 times the new, or if the new is 3 times the old.  If the old bounds do not contain the new bounds new data will always be requested (with or without considering resFactor).

visitedTiles

Hash of visitedTiles.  App state variable.  Should not be set by user.

resolution

Current layer resolution.  App state variable.  Should not be set by user.

bounds

Current layer bounds.  App state variable.  Should not be set by user.

zoomChanged

Indicator for zoom level changed or not.  App state variable.  Should not be set by user.

Constructor

ALKMaps.Strategy.CustomPlaces

A class for custom places strategy.

Parameters

options{Object}

Valid options include

ratio{Number} Optional resFactor -{Number} Optional

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.

update

update: function(options)

Update custom places layer.

Parameters

options{Object}

Valid options include

zoomChanged{Boolean}}

triggerRead

triggerRead: function()

Prepare custom places requests in tiles.

boundsToTiles

boundsToTiles: function(bounds)

Get tiles to cover the bounds.

Parameters

bounds{ALKMaps.Bounds}

Returns

{Array}An array of tiles.  A tile properties include id, bounds, custPlaceSetId, custPlaceTag.

merge

merge: function(resp)

Add features to the layer

Parameters

resp{Object}

Valid propertis in resp include

id{String} Tile id.
features{Object} Vector features will be added to the layer.
activate: function()
Activate the strategy.
deactivate: function()
Deactivate the strategy.
update: function(options)
Update custom places layer.
triggerRead: function()
Prepare custom places requests in tiles.
boundsToTiles: function(bounds)
Get tiles to cover the bounds.
merge: function(resp)
Add features to the layer
Abstract vector layer strategy class.
Close