API Docs for: 7.2
Show:

MQA.ShapeCollection Class

Module: MQA

Base shape extension. This file provides the default TileMap default shape collection management. The only shape it defines is the POI.

Constructor

MQA.ShapeCollection

()

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.

guid

String

Inherited from MQA.TKObjectCollection

Unique id for object

items

Array

Inherited from MQA.TKObjectCollection

Items contained in this collection

Methods

_onAdd

() private

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

_onRemove

() private

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:

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

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

Returns the shape with the matching key.

Parameters:

Returns <Object>

the shape, or null if not found

getDeclutter

() Object

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

Get the min getMaxZoomLevel for this collection.

Returns <Number>

defaults to 16 if one is not set

getMinZoomLevel

() Number

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

Get the visibility state for this collection.

Returns <Boolean>

defaults to true if one is not set

inZoomWindow

() Boolean

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

True if shape collection is on map

Returns <Boolean>

true if on map

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
)

Sets Declutter

Parameters:

setMaxZoomLevel

(
  • maxZoomLevel
)

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

Parameters:

setMinZoomLevel

(
  • minZoomLevel
)

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
)

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

Parameters:

verifyPeerContract

(
  • peer
)
private

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

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

Parameters: