A simple strategy that reads new features when the viewport invalidates some bounds.
ALKMaps. | A simple strategy that reads new features when the viewport invalidates some bounds. |
Properties | |
bounds | {ALKMaps.Bounds} The current data bounds (in the same projection as the layer - not always the same projection as the map). |
resolution | {Float} The current data resolution. |
ratio | {Float} The ratio of the data bounds to the viewport bounds (in each dimension). |
resFactor | {Float} Optional factor used to determine when previously requested features are invalid. |
response | {ALKMaps.Protocol.Response} The protocol response object returned by the layer protocol. |
Constructor | |
ALKMaps. | Create a new BBOX strategy. |
Functions | |
activate | Set up strategy with regard to reading new batches of remote data. |
deactivate | Tear down strategy with regard to reading new batches of remote data. |
update | Callback function called on “moveend” or “refresh” layer events. |
getMapBounds | Get the map bounds expressed in the same projection as this layer. |
invalidBounds | Determine whether the previously requested set of features is invalid. |
calculateBounds | |
triggerRead | |
createFilter | Creates a spatial BBOX filter. |
merge | Given a list of features, determine which ones to add to the layer. |
{ALKMaps.Bounds} The current data bounds (in the same projection as the layer - not always the same projection as the map).
{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).
{ALKMaps.Protocol.Response} The protocol response object returned by the layer protocol.
update: function( options )
Callback function called on “moveend” or “refresh” layer events.
options | {Object} Optional object whose properties will determine the behavior of this Strategy |
force | {Boolean} if true, new data must be unconditionally read. |
noAbort | {Boolean} if true, do not abort previous requests. |
getMapBounds: function()
Get the map bounds expressed in the same projection as this layer.
{ALKMaps.Bounds} Map bounds in the projection of the layer.
invalidBounds: function( mapBounds )
Determine whether the previously requested set of features is invalid. This occurs when the new map bounds do not contain the previously requested bounds. In addition, if resFactor is set, it will be considered.
mapBounds | {ALKMaps.Bounds} the current map extent, will be retrieved from the map object if not provided |
{Boolean}
calculateBounds: function( mapBounds )
mapBounds | {ALKMaps.Bounds} the current map extent, will be retrieved from the map object if not provided |
triggerRead: function( options )
options | {Object} Additional options for the protocol’s read method (optional) |
{ALKMaps.Protocol.Response} The protocol response object returned by the layer protocol.
createFilter: function()
Creates a spatial BBOX filter. If the layer that this strategy belongs to has a filter property, this filter will be combined with the BBOX filter.
Returns {ALKMaps.Filter} The filter object.
merge: function( resp )
Given a list of features, determine which ones to add to the layer. If the layer projection differs from the map projection, features will be transformed from the layer projection to the map projection.
resp | {ALKMaps.Protocol.Response} The response object passed by the protocol. |
Set up strategy with regard to reading new batches of remote data.
activate: function()
Tear down strategy with regard to reading new batches of remote data.
deactivate: function()
Callback function called on “moveend” or “refresh” layer events.
update: function( options )
Get the map bounds expressed in the same projection as this layer.
getMapBounds: function()
Determine whether the previously requested set of features is invalid.
invalidBounds: function( mapBounds )
calculateBounds: function( mapBounds )
triggerRead: function( options )
Creates a spatial BBOX filter.
createFilter: function()
Given a list of features, determine which ones to add to the layer.
merge: function( resp )