API Docs for: 7.2
Show:

MQA.Tile Class

Module: MQA

A base tile implementation. All tile implementations use this class as a prototype.

Constructor

MQA.Tile

(
  • zoom
  • colRow
)

Parameters:

  • zoom Number

    the zoom level for the tile

  • colRow Array

    the x/y coordinates of the tile in tile space.

Properties

colRow

Array

The [x,y] coordinates of the tile in display space.

servers

Array

The list of server names to pull the tile images from. This is used to overcome the limitations of some browsers that limit the number of open connections per host.

type

String

The tile type. Used to build the tile URL.

zoom

Number

The zoom level the tile exists in.

Methods

getElt

() Element

Builds the actual DOM Element representation of the tile. For all Tile instances this is an IMG Element. If you have a custom class that uses Tile as its prototype, you'll unlikely need to override this method. getPath, the type property, and the servers property are the main customization points.

Returns <Element>

the IMG element that represents the tile.

getKey

() String

Returns the unique key for the tile.

Returns <String>

the unique key

getPath

() String

Returns the base path for the tile URL. Comes before the type, zoom, and colRow parts of the tile URL are built. Useful for versioning tiles.

Returns <String>

the base path for the tile URL

getServer

() String

Returns the server host for this tile. (ex: tile1.mytileserver.com)

Returns <String>

the hostname for the tile URL

renderTile

(
  • tile
)
Element private

Creates the img element representation of the Tile instance.

Parameters:

Returns <Element>

the img element that represents the tile in the DOM