|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.maps.client.geom.Projection
com.google.gwt.maps.client.geom.MercatorProjection
public final class MercatorProjection
An implementation of the Projection interface for the Mercator projection is used by all predefined map types. A Mercator projection is one way to map a sphere onto a two dimensional surface and is typically used for world maps. A Mercator projection shows all lines of longitude as parallel vertical lines rather than intersecting line, therefore, distances become distorted near the poles. A Mercator map projection not only allows a rectangular map to be drawn. but also easily allows tiles to be aligned for a continuous image.
Field Summary |
---|
Fields inherited from class com.google.gwt.maps.client.geom.Projection |
---|
jsoPeer |
Constructor Summary | |
---|---|
|
MercatorProjection(int numZoomLevels)
Constructs a Mercator projection for the given number of zoom levels. |
protected |
MercatorProjection(com.google.gwt.core.client.JavaScriptObject jsoPeer)
Wrap an existing GMercatorProjection object. |
Method Summary | |
---|---|
Point |
fromLatLngToPixel(LatLng latlng,
int zoomLevel)
Returns the map coordinates in pixels for the point at the given geographical coordinates, and the given zoom level. |
LatLng |
fromPixelToLatLng(Point point,
int zoomLevel,
boolean unbound)
Returns the geographical coordinates for the point at the given map coordinates in pixels, and the given zoom level. |
double |
getWrapWidth(int zoomLevel)
Mercator projection is periodic in longitude direction, therefore this returns the width of the map of the entire Earth in pixels at the given zoom level. |
boolean |
tileCheckRange(TileIndex index,
int zoomLevel,
int tileSize)
Indicates to the map if the tile index is in a valid range for the map type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MercatorProjection(int numZoomLevels)
numZoomLevels
- the number of zoom levels to support.protected MercatorProjection(com.google.gwt.core.client.JavaScriptObject jsoPeer)
jsoPeer
- the existing JavaScript object to wrap.Method Detail |
---|
public Point fromLatLngToPixel(LatLng latlng, int zoomLevel)
Projection
fromLatLngToPixel
in class Projection
latlng
- map coordinates to translate.zoomLevel
- zoom level to translate.
public LatLng fromPixelToLatLng(Point point, int zoomLevel, boolean unbound)
Projection
fromPixelToLatLng
in class Projection
point
- the point at the given map coordinates in pixels to translate.zoomLevel
- zoom level to translate.unbound
- if true
, causes the geographical longitude coordinate
not to wrap when beyond the -180 or 180 degrees meridian.
public double getWrapWidth(int zoomLevel)
getWrapWidth
in class Projection
zoomLevel
- the zoom level to use.
Projection.getWrapWidth(int)
public boolean tileCheckRange(TileIndex index, int zoomLevel, int tileSize)
Projection
tileCheckRange
in class Projection
index
- the tile index to check. The coordinates may be modified 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.zoomLevel
- the zoom level to check
true
if the tile index is in a valid range for the map type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |