imageTile

geo. imageTile

new imageTile(spec)

Description:
  • This class defines a tile that is part of a standard "image pyramid", such as an open street map tile set. Every tile is uniquely indexed by a row, column, and zoom level. The number of rows/columns at zoom level z is 2^z, the number of pixels per tile is configurable.

    By default, this class assumes that images are fetched from the url, but subclasses may define additional rendering steps to produce the images before passing them off to the handlers.

Source:
Parameters:
Name Type Description
spec geo.imageTile.spec

The tile specification.

Extends

Members

bottom

Description:
  • Computes the global coordinates of the bottom edge.

Source:
Inherited From:
Properties:
Name Type Description
bottom number

The global coordinates of the bottom edge.

Computes the global coordinates of the bottom edge.

image

Description:
  • Read only accessor to the Image object used by the tile. Note, this method does not guarantee that the image data is available. Use the promise interface to add asynchronous handlers.

Source:
Properties:
Name Type Description
image Image

The image object used by the tile.

Read only accessor to the Image object used by the tile. Note, this method does not guarantee that the image data is available. Use the promise interface to add asynchronous handlers.

index

Description:
  • Return the index coordinates. Read only.

Source:
Inherited From:
Properties:
Name Type Description
index object

The tile index.

Properties
Name Type Attributes Description
x number

The tile x index.

y number

The tile y index.

level number <optional>

The tile level index.

reference number <optional>

The tile reference index.

Return the index coordinates. Read only.

left

Description:
  • Computes the global coordinates of the left edge.

Source:
Inherited From:
Properties:
Name Type Description
left number

The global coordinates of the left edge.

Computes the global coordinates of the left edge.

overlap

Description:
  • Return the tile overlap. Read only.

Source:
Inherited From:
Properties:
Name Type Description
overlap object

The tile overlap.

Properties
Name Type Description
x number

The tile x overlap.

y number

The tile y overlap.

Return the tile overlap. Read only.

Description:
  • Computes the global coordinates of the right edge.

Source:
Inherited From:
Properties:
Name Type Description
right number

The global coordinates of the right edge.

Computes the global coordinates of the right edge.

size

Description:
  • Return the tile size. Read only.

Source:
Inherited From:
Properties:
Name Type Description
size object

The tile size.

Properties
Name Type Description
x number

The tile width.

y number

The tile height.

Return the tile size. Read only.

top

Description:
  • Computes the global coordinates of the top edge.

Source:
Inherited From:
Properties:
Name Type Description
top number

The global coordinates of the top edge.

Computes the global coordinates of the top edge.

Methods

bounds(index, shift) → {object}

Description:
  • Return the bounds of the tile given an index offset and a translation.

Source:
Inherited From:
Parameters:
Name Type Description
index object

The tile index containing (0, 0).

shift object

The coordinates of (0, 0) inside the tile.

Returns:

An object with left, top, right, bottom.

Type
object

catch(method) → {this}

Description:
  • Add a method to be called with the data when the ajax fails.

Source:
Inherited From:
Parameters:
Name Type Description
method function

The rejection handler.

Returns:
Type
this

fadeIn(duration) → {this}

Description:
  • Set the opacity of the tile to 0 and gradually fade in over the given number of milliseconds. This will also resolve the embedded promise interface.

Source:
Overrides:
Parameters:
Name Type Description
duration number

The duration of the animation in ms.

Returns:
Type
this

fetch() → {this}

Description:
  • Initiate the image request.

Source:
Overrides:
Returns:
Type
this

fetched() → {boolean}

Description:
  • Return whether this tile has been fetched already.

Source:
Inherited From:
Returns:

True if the tile has been fetched.

Type
boolean

then(onSuccessnullable, onFailurenullable) → {this}

Description:
  • Add a method to be called with the data when the ajax request is successfully resolved.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
onSuccess function <nullable>

The success handler.

onFailure function <nullable>

The failure handler.

Returns:
Type
this

toString() → {string}

Description:
  • Return a unique string representation of the given tile usable as a hash key. Possibly extend later to include url information to make caches aware of the tile source.

Source:
Inherited From:
Returns:
Type
string

Type Definitions

spec

Source:
Properties:
Name Type Attributes Default Description
index object

The global position of the tile.

Properties
Name Type Description
x number

The x-coordinate (the column number).

y number

The y-coordinate (the row number).

level number

The zoom level.

size object <optional>

The size of each tile.

Properties
Name Type Attributes Default Description
x number <optional>
256

Width in pixels.

y number <optional>
256

Height in pixels.

crossDomain string <optional>
'anonymous'

Image CORS attribute. This is used for the crossorigin property when loading images.

url object | string

A url or jQuery ajax config object.

overlap object <optional>

The size of overlap with neighboring tiles.

Properties
Name Type Default Description
x number 0
y number 0
Type: