SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface which has to be implemented by all map projections. A projection is used by the map to convert from pixel space to map coordinates and vice versa.
Constructor Summary | |
IWProjection()
Default constructor. |
Method Summary | |
IWPoint
|
calculateGridOffset(map)
Calculates the offset of the point (0, 0) to a position on the tile grid. |
|
clone()
Returns a copy of this projection. |
object
|
generateTileInformation(x, y, gridOffset)
Generates information like the tile screen position, tile index and tile id for a pixel position. |
void
|
initialize(xmlDocument)
Initializes the projection parameters from a XML document. |
IWPoint
|
meterToPixel(coord)
Returns the offset in pixels of the specified coordinate to the map center. |
boolean
|
needsReload(size)
Checks whether the map has to be reloaded completely to display the specified region. |
IWCoordinate
|
pixelToMeter(offset)
Returns the coordinate of the current map center plus the specified offset in pixels. |
String
|
toString()
Returns a text representation of this projection. |
Constructor Detail |
IWProjection()
Method Detail |
IWPoint calculateGridOffset(map)
IWMap map
- a map
IWPoint
the offset
clone()
object generateTileInformation(x, y, gridOffset)
number x
- screen position of the tile
number y
- screen position of the tile
IWPoint gridOffset
- offset of (0, 0) to the tile grid
object
void initialize(xmlDocument)
Document xmlDocument
- a XML document storing all parameters used by the current projection
void
IWPoint meterToPixel(coord)
IWCoordinate coord
- a coordinate
IWPoint
boolean needsReload(size)
IWSize size
- the size of the visible part of the map in pixels
boolean
IWCoordinate pixelToMeter(offset)
IWPoint offset
- an offset
IWCoordinate
String toString()
String