Telogis.GeoBase.MapLayers.ObjectLayer |
MapLayers.ObjectLayer inherits from MapLayers.AbstractLayer.
Creates a layer to contain multiple Telogis.GeoBase.MapLayer.AbstractObject instances, which allow icons to be displayed on a map. An R-tree may be used to store the objects and cull those that do not lie on the map. All objects placed on the layer can be accessed by subscripting the MapLayers.ObjectLayer instance with their IDs, like so:
var ImageObject = Telogis.GeoBase.MapLayers.ImageObject; var LatLon = Telogis.GeoBase.LatLon; var Map = Telogis.GeoBase.Widgets.Map; var ObjectLayer = Telogis.GeoBase.MapLayers.ObjectLayer; var map = new Map ({id: 'main_map'}); var layer = new ObjectLayer ({id: 'pin_layer', map: map}); new ImageObject ({ id: 'pushpin', layer: layer, location: new LatLon (34.067, -118.000), src: 'pin.png' }); var pin = layer ['pushpin'];
Name | Description | ||||||
---|---|---|---|---|---|---|---|
MapLayers.ObjectLayer(config) | Arguments
|
Name | Description |
---|---|
clear () | Removes all objects from the layer. |
destroy (Boolean destroyObjects) | Disposes of any resources used by the MapLayers.ObjectLayer. Call this if the layer is no longer needed and you want to quickly reclaim resources. Note that this does not clean up any objects placed on the layer -- they must have their own MapLayers.AbstractObject.destroy methods called separately. Arguments
|
destroyChildren () | Removes and destroys all objects on the layer. |
endBulkAdd () | Redisplays this ObjectLayer after a bulk add operation. A call to this function should always follow a call to startBulkAdd. |
getAllObjects () | Finds all the AbstractObject associated with this layer. ReturnsArray - An array of objects. |
startBulkAdd () | Prepares this ObjectLayer so that many objects can be added to it without a serious performance hit. It is recommended to use this function when adding more than 200 items to the layer. A call to this function must be followed by a call to endBulkAdd before the objects will be visible. |