It's the 15th anniversary of Google Maps Platform - Check out the latest news and announcements

Google.Maps.Coord.TileCoord

An immutable representation of the x,y coordinates of a Google Maps tile.

Summary

For more information, see Map and Tile Coordinates.

Inheritance

Inherits from: IEquatable< TileCoord >

Constructors and Destructors

TileCoord(int x, int y, int zoom, bool normalize)
The TileCoord constructor.

Public attributes

X
readonly int
The x coordinate.
Y
readonly int
The y coordinate.
Zoom
readonly int
The zoom level.

Public functions

East(out TileCoord east, bool normalize)
bool
Produces the TileCoord to the immediate east of this tile coordinate. Returns true if the coordinate to the east falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.
Equals(TileCoord other)
bool
Implements the IEquatable{T} interface.
Equals(object obj)
override bool
Overrides the Equals() method.
GetHashCode()
override int
Overrides the GetHashCode() method.
Neighbors(bool normalize)
Generates an array of coordinates for the tiles surrounding the supplied tile, accounting for boundaries, without wrapping.
North(out TileCoord north, bool normalize)
bool
Produces the TileCoord to the immediate north of this tile coordinate. Returns true if the coordinate to the north falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.
Offset(out TileCoord offset, int xOffset, int yOffset, bool normalize)
bool
Produces the TileCoord offset from this tile coordinate by the specified X and Y. Returns true if this coordinate falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.
South(out TileCoord south, bool normalize)
bool
Produces the TileCoord to the immediate south of this tile coordinate. Returns true if the coordinate to the south falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.
ToString()
override string
Returns the formatted string representation of this TileCoord.
West(out TileCoord west, bool normalize)
bool
Produces the TileCoord to the immediate west of this tile coordinate. Returns true if the coordinate to the west falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.

Public attributes

X

readonly int Google::Maps::Coord::TileCoord::X

The x coordinate.

This value is returned by the MaxValue() method. The X coordinates wrap. For more information, see Map and Tile Coordinates.

Y

readonly int Google::Maps::Coord::TileCoord::Y

The y coordinate.

The Y coordinates are clamped. For more information, see Map and Tile Coordinates.

Zoom

readonly int Google::Maps::Coord::TileCoord::Zoom

The zoom level.

Public functions

East

bool Google::Maps::Coord::TileCoord::East(
  out TileCoord east,
  bool normalize
)

Produces the TileCoord to the immediate east of this tile coordinate. Returns true if the coordinate to the east falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.

Details
Parameters
east
This parameter is filled with the tile coordinate to the immediate east of this one.
normalize
Whether the returned coordinate should be normalized.

Equals

bool Google::Maps::Coord::TileCoord::Equals(
  TileCoord other
)

Implements the IEquatable{T} interface.

Details
Parameters
other
The other TileCoord to compare with this one.
Returns
A boolean value that indicates whether the specified TileCoord and this one are equal.

Equals

override bool Google::Maps::Coord::TileCoord::Equals(
  object obj
)

Overrides the Equals() method.

Details
Parameters
obj
The other object to compare with this TileCoord.

GetHashCode

override int Google::Maps::Coord::TileCoord::GetHashCode()

Overrides the GetHashCode() method.

Neighbors

TileCoord[] Google::Maps::Coord::TileCoord::Neighbors(
  bool normalize
)

Generates an array of coordinates for the tiles surrounding the supplied tile, accounting for boundaries, without wrapping.

Details
Parameters
normalize
If true, neighbours on the other side of the anti-meridian will be included, otherwise only tiles on the same edge of the map will be returned.
Returns
The coordinates of neighboring tiles

North

bool Google::Maps::Coord::TileCoord::North(
  out TileCoord north,
  bool normalize
)

Produces the TileCoord to the immediate north of this tile coordinate. Returns true if the coordinate to the north falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.

Details
Parameters
north
This parameter is filled with the tile coordinate to the immediate north of this one.
normalize
Whether the returned coordinate should be normalized.

Offset

bool Google::Maps::Coord::TileCoord::Offset(
  out TileCoord offset,
  int xOffset,
  int yOffset,
  bool normalize
)

Produces the TileCoord offset from this tile coordinate by the specified X and Y. Returns true if this coordinate falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.

Details
Parameters
offset
This parameter is filled with the tile coordinate whose position relative to this one is specified by xOffset and yOffset.
xOffset
The number of tiles to move to the east (negative for west, zero to stay in place).
yOffset
The number of tiles to move to the south (negative for north, zero to stay in place).
normalize
Whether the returned coordinate should be normalized.

South

bool Google::Maps::Coord::TileCoord::South(
  out TileCoord south,
  bool normalize
)

Produces the TileCoord to the immediate south of this tile coordinate. Returns true if the coordinate to the south falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.

Details
Parameters
south
This parameter is filled with the tile coordinate to the immediate south of this one.
normalize
Whether the returned coordinate should be normalized.

TileCoord

 Google::Maps::Coord::TileCoord::TileCoord(
  int x,
  int y,
  int zoom,
  bool normalize
)

The TileCoord constructor.

Details
Parameters
x
The x coordinate.
y
The y coordinate.
zoom
The zoom level.
normalize
If this parameter is true, then the x coordinate is wrapped, and the y coordinate is clamped to the extent of the tile coordinate space at this zoom level.

ToString

override string Google::Maps::Coord::TileCoord::ToString()

Returns the formatted string representation of this TileCoord.

West

bool Google::Maps::Coord::TileCoord::West(
  out TileCoord west,
  bool normalize
)

Produces the TileCoord to the immediate west of this tile coordinate. Returns true if the coordinate to the west falls within the valid bounds of the tile coordinate space before any optional wrapping is applied. False if not.

Details
Parameters
west
This parameter is filled with the tile coordinate to the immediate west of this one.
normalize
Whether the returned coordinate should be normalized.