ProjectionBase is an abstract base class for creating custom projections.
Sub-class this and implement each
method to create a custom projection for the map.
public function ProjectionBase()
Constructs an instance of ProjectionBase.
public function fromLatLngToPixel(latLng:LatLng, zoom:Number):Point
Returns the map pixel coordinates corresponding to the specified
geographical location and zoom level.
Parameters
| latLng:LatLng — Geographical location.
|
|
| zoom:Number — Zoom level.
|
Returns
| Point — Corresponding map coordinate in pixels
|
public function fromPixelToLatLng(pixel:Point, zoom:Number, opt_nowrap:Boolean = false):LatLng
Returns the geographical location corresponding to the specified
map pixel coordinates and zoom level.
Parameters
| pixel:Point — Map coordinates in pixels
|
|
| zoom:Number — Zoom level
|
|
| opt_nowrap:Boolean (default = false ) — Do not wrap longitudes outside of [-180,180)
|
Returns
| LatLng —
Corresponding geographical position
|
public function getWrapWidth(zoom:Number):Number
Returns the map periodicity in the x-direction: the number of
pixels after which the map repeats itself because it wraps around
the earth. By default, returns Infinity, i.e. the map does not repeat
itself. This is used by the map to compute the placement of overlays on
map views that contain more than one copy of the earth (this usually
happens only at low zoom levels).
Parameters
| zoom:Number — Zoom level.
|
Returns
| Number — Width of the earth in pixels.
|
public function tileCheckRange(tile:Point, zoom:Number, tileSize:Number):Boolean
Tests whether the tile index is within the valid range for the map type
(the map displays empty tiles outside of this range). Note that this
function may modify the tile index to point to another instance of the same
tile should the map contain more than one Earth.
Parameters
| tile:Point — Tile coordinate.
|
|
| zoom:Number — Zoom level.
|
|
| tileSize:Number — The size of this tile.
|
Returns
| Boolean — true if the tile is within range.
|