com.google.gwt.maps.client
Class TileLayer

java.lang.Object
  extended by com.google.gwt.maps.client.TileLayer

public abstract class TileLayer
extends java.lang.Object

Implement this class in order to provide custom map tile layers, either through MapType or TileLayerOverlay. An implementation should use an instance of TileLayer as a prototype, because this implements the copyright handling.


Field Summary
protected  com.google.gwt.core.client.JavaScriptObject jsoPeer
           
 
Constructor Summary
  TileLayer(CopyrightCollection copyrights, int minResolution, int maxResolution)
           
protected TileLayer(com.google.gwt.core.client.JavaScriptObject jsoPeer)
          Constructs a new TileLayer instance by wrapping an existing JavaScript instance of GTileLayer.
 
Method Summary
 void addTileLayerNewCopyrightHandler(TileLayerNewCopyrightHandler handler)
          Add a handler for "newcopyright" events.
static TileLayer createPeer(com.google.gwt.core.client.JavaScriptObject jsoPeer)
           
 int getMaxResolution()
          Returns to the map type the highest zoom level of this tile layer.
 int getMinResolution()
          Returns to the map type the lowest zoom level of this tile layer.
abstract  double getOpacity()
          Returns to the map the opacity with which to display this tile layer.
abstract  java.lang.String getTileURL(Point tile, int zoomLevel)
          Returns to the map the URL of the map tile with the tile indices given by the x and y properties of the Point, at the given zoom level.
abstract  boolean isPng()
          Returns to the map the copyright messages for this tile layer that are pertinent for the given map region at the given zoom level.
 void removeTileLayerNewCopyrightHandler(TileLayerNewCopyrightHandler handler)
          Removes a single handler of this tile layer previously added with addTileLayerNewCopyrightHandler(TileLayerNewCopyrightHandler).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jsoPeer

protected final com.google.gwt.core.client.JavaScriptObject jsoPeer
Constructor Detail

TileLayer

public TileLayer(CopyrightCollection copyrights,
                 int minResolution,
                 int maxResolution)
Parameters:
copyrights - copyrights to use for copyright handling
minResolution - minimum zoom level to use for this tile layer
maxResolution - maximum zoom level to use for this tile layer

TileLayer

protected TileLayer(com.google.gwt.core.client.JavaScriptObject jsoPeer)
Constructs a new TileLayer instance by wrapping an existing JavaScript instance of GTileLayer.

Parameters:
jsoPeer - object to wrap.
Method Detail

createPeer

public static TileLayer createPeer(com.google.gwt.core.client.JavaScriptObject jsoPeer)

addTileLayerNewCopyrightHandler

public void addTileLayerNewCopyrightHandler(TileLayerNewCopyrightHandler handler)
Add a handler for "newcopyright" events. This event is fired when a new copyright was added to this copyright collection.

Parameters:
handler - handler to invoke on mouse click events.

getMaxResolution

public int getMaxResolution()
Returns to the map type the highest zoom level of this tile layer.

Returns:
the highest zoom level of this tile layer.

getMinResolution

public int getMinResolution()
Returns to the map type the lowest zoom level of this tile layer.

Returns:
the the lowest zoom level of this tile layer.

getOpacity

@Exported
public abstract double getOpacity()
Returns to the map the opacity with which to display this tile layer. 1.0 is opaque, 0.0 is transparent.

Returns:
the opacity value to use for this tile layer.

getTileURL

@Exported
@FieldName(value="getTileUrl")
public abstract java.lang.String getTileURL(Point tile,
                                                                    int zoomLevel)
Returns to the map the URL of the map tile with the tile indices given by the x and y properties of the Point, at the given zoom level.

Parameters:
tile - index of tile to compute URL for
zoomLevel - zoom level to compute URL for
Returns:
a URL to use to fetch the tile at the specified point and zoom level.

isPng

@Exported
public abstract boolean isPng()
Returns to the map the copyright messages for this tile layer that are pertinent for the given map region at the given zoom level. This is used to generate the copyright message of the GMapType to which this tile layer belongs.

Returns:
A string representing the copyright messages.

removeTileLayerNewCopyrightHandler

public void removeTileLayerNewCopyrightHandler(TileLayerNewCopyrightHandler handler)
Removes a single handler of this tile layer previously added with addTileLayerNewCopyrightHandler(TileLayerNewCopyrightHandler).

Parameters:
handler - the handler to remove