API Docs for: 7.2
Show:

MQA.RemoteCollection Class

Module: MQA

Creates a remote collection to process a remote data feed. This only works with HTTP GET requests currently. By default the load method of this collection will be executed when adding the collection to the map.

Properties

bestFit

Boolean

Inherited from MQA.TKObjectCollection

Should this collection participate in best fitting on the map, defaults to true Example: routes & pois should, traffic markets should not

collectionName

String

Inherited from MQA.TKObjectCollection

Name of this collection, blank by default.

deserializer

MQA.BaseDeserializer or subclass

Deserilizer class

guid

String

Inherited from MQA.TKObjectCollection

Unique id for object

items

Array

Inherited from MQA.TKObjectCollection

Items contained in this collection

loaded

Boolean

loadOnAdd

Boolean

If not yet loaded and this is true we allow the map to load this collection when added (defaults to true).

loadStrategy

String

Stategy to load the remote data known strategies include XHR & JSONP, defaults to XHR

options

Object

Options to pass on to the HTTPXHRequest object - these can be an options supported by the MQA.IO.doXhr function

url

String

url of resource to load and deserialize into an MQA.ShapeCollection

Methods

_handleResponseJSONV

(
  • data
  • errorInfo
)
private

handles the response callback for JSONV strategy, this will allow the callers to determin where the JSONV varible is stored but will tell the caller it has been loaded by either the event that is triggered or by the call to the deserializer class, your pick.

Parameters:

  • data Null

    will be null with JSONV strategy

  • errorInfo Null

    will be null with JSONV strategy

_handleResponseXHR

(
  • data
  • errorInfo
)
private

handles the response callback for XHR strategy

Parameters:

  • data Object

    from service

  • errorInfo Object
    • if an error comes back from the xhr request, there is info on it here

_loaded

() private

after deserializers do thier work, they should call this function

_onAdd

() private

Inherited from MQA.ShapeCollection

Extension point that hooks into MQA.TKObjectCollection.add()

_onRemove

() private

Inherited from MQA.ShapeCollection

Extension point that hooks into MQA.TKObjectCollection.remove()

add

(
  • obj
)
Number

Inherited from MQA.TKObjectCollection

Adds an object to the collection. Calls collection's _onAdd method if defined.

Parameters:

  • obj Object

    Object to be added

Returns <Number>

the new length of the collection

append

(
  • collToAppend
)

Inherited from MQA.TKObjectCollection

Appends the specified TKObjectCollection to this TKObjectCollection.

Parameters:

clone

()

remote collections dont clone, calling this function will return itself, you can call reload or just create another remote collection if you need a copy instance of this

contains

(
  • item
)
Boolean

Inherited from MQA.TKObjectCollection

Function to test if object is in collection.

Parameters:

  • item Object

    The object to test.

Returns <Boolean>

true if object is contained in the collection

getAt

(
  • index
)
Object

Inherited from MQA.TKObjectCollection

Returns an object at the specified index.

Parameters:

  • index Number

    The index of the item to retrieve

Returns <Object>

object stored at the index

getBoundingRect

() MQA.RectLL

Inherited from MQA.ShapeCollection

Calculates the bounding rect (Lat/Lng) of the collection, taking all shapes into consideration.

Returns <MQA.RectLL>

bounding rectangle for shape collection

getById

(
  • strId
)
Object | Null

Inherited from MQA.TKObjectCollection

Returns an object with the specified ID.

Parameters:

  • strId String

    The ID of the item to retrieve

Returns <Object | Null>

The object if found, otherwise null.

getByKey

(
  • key
)
Object

Inherited from MQA.ShapeCollection

Returns the shape with the matching key.

Parameters:

Returns <Object>

the shape, or null if not found

getDeclutter

() Object

Inherited from MQA.ShapeCollection

Gets declutter

Returns <Object>

declutter

getItemIndex

(
  • item
)
Number | Boolean

Inherited from MQA.TKObjectCollection

Returns the index of the specified item in the collection.

Parameters:

  • item Object

    The item to find the index for.

Returns <Number | Boolean>

If the item is found its index is returned, otherwise returns false. TODO: Should probably return -1 instead of false to have consistent return typing

getMaxZoomLevel

() Number

Inherited from MQA.ShapeCollection

Get the min getMaxZoomLevel for this collection.

Returns <Number>

defaults to 16 if one is not set

getMinZoomLevel

() Number

Inherited from MQA.ShapeCollection

Get the min zoomlevel for this collection.

Returns <Number>

defaults to 1 if one is not set

getName

() String

Inherited from MQA.TKObjectCollection

Returns the name of the collection

Returns <String>

name of collection

getSize

() Number

Inherited from MQA.TKObjectCollection

Returns the size of the Collection

Returns <Number>

the size of the collection.

getVisible

() Boolean

Inherited from MQA.ShapeCollection

Get the visibility state for this collection.

Returns <Boolean>

defaults to true if one is not set

inZoomWindow

() Boolean

Inherited from MQA.ShapeCollection

Return true if attached to a map and the shape collection is valid for the current zoom level.

Returns <Boolean>

true if the collection in the current zoom window

isOnMap

() Boolean

Inherited from MQA.ShapeCollection

True if shape collection is on map

Returns <Boolean>

true if on map

load

()

Loads the collection from the url enpoint and calls the deserializer to perform its magic

reload

()

forces a reload of this remote collection

remove

(
  • index
)
Object

Inherited from MQA.TKObjectCollection

Removes an object at specified index. Calls collection's _onRemove method if defined.

Parameters:

  • index Number

    Index of the item to be removed.

Returns <Object>

the object at the specified index

removeAll

()

Inherited from MQA.TKObjectCollection

Remove all elements from collection.

removeItem

(
  • item
)

Inherited from MQA.TKObjectCollection

Remove an item by its pointer.

Parameters:

  • item Object

    The item to remove

setDeclutter

(
  • declutter
)

Inherited from MQA.ShapeCollection

Sets Declutter

Parameters:

setMaxZoomLevel

(
  • maxZoomLevel
)

Inherited from MQA.ShapeCollection

Sets the max zoom level at which the collection should appear on the map.

Parameters:

setMinZoomLevel

(
  • minZoomLevel
)

Inherited from MQA.ShapeCollection

Sets the minimum zoom level at which the collection should appear on the map.

Parameters:

setName

(
  • n
)

Inherited from MQA.TKObjectCollection

Sets the name of the collection.

Parameters:

setVisible

(
  • visible
)

Inherited from MQA.ShapeCollection

Sets the visibility of the collection and shapes added to it on the map.

Parameters:

verifyPeerContract

(
  • peer
)
private

Inherited from MQA.ShapeCollection

This function is called during checked builds to verify that, only exists in checked builds a shape meets the general shape contract.

Parameters:

verifyShapeContract

(
  • shape
)
private

Inherited from MQA.ShapeCollection

Verify the shape contract in checked builds, only exists in checked builds.

Parameters: