IProjection is the interface for map projections. A map projection
implementor is passed to the constructor of MapType. This interface is
implemented by MercatorProjection, which is used by all predefined map types.
You can implement this interface if you want to define map types with
different map projections. Use class ProjectionBase for your custom
projections.
public function fromLatLngToPixel(latLng:LatLng, zoom:Number):Point
Returns the map coordinates in pixels for the point at the given
geographical coordinates, and the given zoom level.
Parameters
| latLng:LatLng — Geographical position
|
|
| 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 map coordinates in pixels for the point at the given
geographical coordinates, and the given zoom level.
Parameters
| pixel:Point — Map coordinate 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 to the map the periodicity in x-direction, i.e. the number of
pixels after which the map repeats itself because it wrapped once round
the earth. By default, returns Infinity, i.e. the map will 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 — Corresponding pixel range.
|
public function tileCheckRange(tile:Point, zoom:Number, tilesize:Number):Boolean
Returns to the map if the tile index is in a valid range for the map
type. Otherwise the map will display an empty tile. It also may modify
the tile index to point to another instance of the same tile in the case
that the map contains more than one copy of the earth, and hence the
same tile at different tile coordinates.
Parameters
| tile:Point — Tile coordinate.
|
|
| zoom:Number — Tile zoom coordinate.
|
|
| tilesize:Number — The size of this tile.
|
Returns
| Boolean — The tile is within range.
|