Click or drag to resize

Telogis.GeoBase.Objects

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

A namespace enclosing GeoBase functions for manipulating objects. Normally, these would be attached to the Object prototype, but this is avoided to maintain compatibility with some other libraries.

Functions
NameDescription
freeHandlers (Object obj)

Iterates through all EventHandler objects registered as properties of the given object, destroying each and deleting references to break cycles and prevent memory leaks.

Arguments
  • obj (Object) - The object to deallocate handlers from.

freeProperty (Object obj, String key)

Deallocates a property of an object in the manner appropriate to its type. If the property refers to an array, the elements of the array are freed individually; if it is a DOM element, it is safely detached from the page; if it is an object with a destroy method, this is executed. In all cases, the reference of the object to the freed property is deleted.

Arguments
  • obj (Object) - The object to delete a property from.

  • key (String) - The name of the property to free from Objects.freeProperty.obj.

getPropString (Object obj, Number maxPropCount)

Gets a string describing an object by finding the names of its first few properties and forming a string such as '{prop1, prop2, prop3, prop4, ...}'. This is helpful in generating a useful error message when processing an object of critical but unknown type, e.g. during serialization.

Arguments
  • obj (Object) - The object to get a property string for.

  • (Optional) maxPropCount (Number) - The maximum number of property names to include in the generated string. Defaults to 4.

Returns

String - A string describing Objects.getPropString.obj by its properties.

isElement (Mixed elem)

Checks whether a given object is a DOM element by evaluating the types of its nodeType and nodeName properties.

Arguments
  • elem (Mixed) - The item to test the type of.

Returns

Boolean - True if Objects.isElement.elem is a DOM element; false otherwise.

lookupObject (String name, Object root)

Finds the globally-accessible object with the given name. For example, if Objects.lookupObject.name is specified as 'Objects.lookupObject', this function breaks this into individual properties and returns a reference to the function itself.

Arguments
  • name (String) - The (fully-scoped) name of the object to look up.

  • (Optional) root (Object) - The root object in the hierarchy to start the lookup from. Defaults to window.

Returns

Mixed - The item referred to by the property-chain specified by Objects.lookupObject.name.