Click or drag to resize

Telogis.GeoBase.MapLayers.ObjectLayer

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release

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:

JavaScript
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'];
Constructor
NameDescription
MapLayers.ObjectLayer(config)

Arguments

  • config (Object) - Configuration options for the MapLayers.ObjectLayer.

    Properties
    NameTypeDescription
    managedBoolean

    Whether the object-layer should use an R-Tree to cull objects outside the map viewport from the document's DOM tree.

    Defaults to true.
Functions
NameDescription
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
  • (Optional) destroyObjects (Boolean) - Whether the objects currently associated with the layer should be destroyed along with it. Defaults to false.

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.

Returns

Array - 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.