com.maryanovsky.map.client.osm
Class OsmTileLayer

java.lang.Object
  extended by com.maryanovsky.map.client.ImageTileLayer
      extended by com.maryanovsky.map.client.osm.OsmTileLayer
All Implemented Interfaces:
TileLayer

public class OsmTileLayer
extends ImageTileLayer

Implements an OpenStreetMaps.org tile layer.

Author:
Maryanovsky Alexander

Constructor Summary
OsmTileLayer(String baseUrl, int minZoom, int maxZoom)
          Creates a new OsmTileLayer with the specified base URL and minimum and maximum zoom values.
OsmTileLayer(String baseUrl, String tileExtension, int minZoom, int maxZoom)
          Creates a new OsmTileLayer with the specified base URL pattern, tile files' extension, and minimum and maximum zoom values.
 
Method Summary
 String getTileUrl(int xIndex, int yIndex, int zoom)
          Returns the URL of the tile image at the specified zoom and indices, or null if none.
 
Methods inherited from class com.maryanovsky.map.client.ImageTileLayer
getTile, getTileSize, getTileUrl, releaseTile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsmTileLayer

public OsmTileLayer(String baseUrl,
                    String tileExtension,
                    int minZoom,
                    int maxZoom)
Creates a new OsmTileLayer with the specified base URL pattern, tile files' extension, and minimum and maximum zoom values. The base URL (and, actually, the extension as well) is treated as part of a URL pattern as described in ImageTileLayer.ImageTileLayer(com.maryanovsky.gwtutils.client.geom.SizeView, String). You can use that to specify multiple domains from which to retrieve the tile image.


OsmTileLayer

public OsmTileLayer(String baseUrl,
                    int minZoom,
                    int maxZoom)
Creates a new OsmTileLayer with the specified base URL and minimum and maximum zoom values.

Method Detail

getTileUrl

public String getTileUrl(int xIndex,
                         int yIndex,
                         int zoom)
Returns the URL of the tile image at the specified zoom and indices, or null if none. Note that xIndex and yIndex are not pixel coordinates like in TileLayer.getTile(int, int, int), but the indices of the tiles in their respective row and column at the tile grid of the specified zoom. The default implementation converts the three arguments to string representations via String.valueOf(int) and invokes ImageTileLayer.getTileUrl(int, int, int). You should override this method if you need to perform some checks or possibly change the values of the parameters, or if you need a different representation of them to be inserted into the pattern.

Overrides:
getTileUrl in class ImageTileLayer