# Class: modelit.mapviewer.AbstractTileSource (Abstract)

## DESCRIPTION:

modelit.mapviewer.AbstractTileSource/AbstractTileSource is a constructor. obj = modelit.mapviewer.AbstractTileSource

#

## Properties

baseUrl | string, default value: 'png'. |
      The tile url without parameters.
isWGS | boolean |
      Return true if WGS coordinate.
maxZoomLevel | number |
      Maximum (greatest detail) zoomlevel.
minZoomLevel | number |
      Minimum (lowest detail) zoomlevel.
name | string |
      The name of the tilesource.
numberOfThreads | number, default value: 2 |
      Number of threads that can be used to download the tiles.
      Note that some of the tileproviders have a limit of the number of
      parallel requests.
tileSize | number, default value: 256. |
      The tilesize in pixels. Tile are assumed to be square.
tileType | string, default value: 'png'. |
      The image type of the tiles.
tileUrl | string|@(zoomlevel, x, y) = string> |
      The part of the url that defines which tile to retrieve.

# Public Abstract Method: WGSToLocal

## DESCRIPTION:

Transform WGS to local coordinates

# Public Abstract Method: localToWGS

## DESCRIPTION:

Transform local coordinates to WGS

# Public Abstract Method: localToPixel

## DESCRIPTION:

Transform local coordinates to pixel coordinates, all in 1

# Public Abstract Method: pixelToLocal

## DESCRIPTION:

Transform pixel coordinates to local coordinates, all in 1

# Public Abstract Method: YToLat

## DESCRIPTION:

Transform y-coordinate in pixels to second local coordinate.

# Public Abstract Method: XToLon

## DESCRIPTION:

Transform x-coordinate in pixels to first local coordinate.

# Public Abstract Method: LatToY

## DESCRIPTION:

Transform local y coordinate to y-coordinate in pixels.

# Public Abstract Method: LonToX

## DESCRIPTION:

Transform local x coordinate to x-coordinate in pixels.

# Public Abstract Method: getMaxPixels

## DESCRIPTION:

Get the maximum number of pixels in y or x for a zoomlevel.

# Public Method: getTileUrl

## DESCRIPTION:

Get url to retrieve a specific tile at a given (x,y) index and zoomlevel from the tileserver

## CALL:

url = getTileUrl(obj, zoomlevel, x, y)

## INPUT:

obj | modelit.mapviewer.PDOKTileSource |
zoomlevel | integer |
    the zoomlevel. Choose zoomlevel between
    getMinZoomLevel and getMaxZoomLevel
x | number |
    Horizontal tile index.
y | number |
    Vertical tile index.

## OUTPUT:

url | string |
    url for a tile with index (x,y) and zoomlevel at the tileserver.

# Public Method: getBaseUrl

## DESCRIPTION:

Get the base url for this TileSource, use this with getTileUrl. To get the url for a specific tile at a specific coordinate and zoomlevel.

## CALL:

url = getBaseUrl(obj)

## INPUT:

obj | modelit.mapviewer.AbstractTileSource |

## OUTPUT:

url | string |
    with base url.

# Public Method: getTileType

## DESCRIPTION:

Get the image type of the tiles.

## CALL:

type = getTileType(obj)

## INPUT:

obj | modelit.mapviewer.AbstractTileSource |

## OUTPUT:

type | string |
    with image type. For OpenStreetMap tiles type='png'

# Public Method: getMinZoomLevel

## DESCRIPTION:

The minimum zoom value. This value is usually 0.

## CALL:

zoom = getMinZoomLevel(obj)

## INPUT:

obj | modelit.mapviewer.AbstractTileSource |

## OUTPUT:

zoom | integer |
    with the minimum (less detailed) zoomlevel.

# Public Method: getMaxZoomLevel

## DESCRIPTION:

The maximum zoom value.

## CALL:

zoom = getMaxZoomLevel(obj)

## INPUT:

obj | modelit.mapviewer.AbstractTileSource |

## OUTPUT:

zoom | integer |
    with the maximum (most detailed) zoomlevel.

# Public Method: getName

## DESCRIPTION:

Get name that uniquely identifies this tilesource. Used for caching.

## CALL:

name = getName(obj)

## INPUT:

obj | modelit.mapviewer.AbstractTileSource |

## OUTPUT:

name | string |

# Public Method: getTileSize

## DESCRIPTION:

The tilesize of the square tiles in pixels.

## CALL:

tileSize = getTileSize(obj)

## INPUT:

obj | modelit.mapviewer.AbstractTileSource |

## OUTPUT:

tileSize | integer |
    the width and height for a tile in pixels.

# Public Method: AbstractTileSource

## DESCRIPTION:

modelit.mapviewer.AbstractTileSource/AbstractTileSource is a constructor. obj = modelit.mapviewer.AbstractTileSource modelit.mapviewer.AbstractTileSource Properties: numberOfThreads - Number of threads that can be used to download the tiles. minZoomLevel - Minimum (lowest detail) zoomlevel. maxZoomLevel - Maximum (greatest detail) zoomlevel. baseUrl - The tile url without parameters. tileUrl - The part of the url that defines which tile to retrieve. name - The name of the tilesource. tileType - The image type of the tiles. isWGS - Return true if WGS coordinate. modelit.mapviewer.AbstractTileSource Methods: WGSToLocal - (Abstract) Transform WGS to local coordinates localToWGS - (Abstract) Transform local coordinates to WGS localToPixel - (Abstract) Transform local coordinates to pixel coordinates, all in 1 pixelToLocal - (Abstract) Transform pixel coordinates to local coordinates, all in 1 YToLat - (Abstract) Transform y-coordinate in pixels to second local coordinate. XToLon - (Abstract) Transform x-coordinate in pixels to first local coordinate. LatToY - (Abstract) Transform local y coordinate to y-coordinate in pixels. LonToX - (Abstract) Transform local x coordinate to x-coordinate in pixels. getMaxPixels - (Abstract) Get the maximum number of pixels in y or x for a zoomlevel. getTileSize - (Abstract) Get the size (height and width) of each tile in pixels getTileUrl - Get url to retrieve a specific tile at a given (x,y) index getBaseUrl - Get the base url for this TileSource, use this with getTileUrl. getTileType - Get the image type of the tiles. getMinZoomLevel - The minimum zoom value. This value is usually 0. getMaxZoomLevel - The maximum zoom value. getName - Get name that uniquely identifies this tilesource. AbstractTileSource - modelit.mapviewer.AbstractTileSource/AbstractTileSource is a constructor.