Package org.jxmapviewer
Class OSMTileFactoryInfo
java.lang.Object
org.jxmapviewer.viewer.TileFactoryInfo
org.jxmapviewer.OSMTileFactoryInfo
public class OSMTileFactoryInfo extends TileFactoryInfo
Uses OpenStreetMap
-
Field Summary
-
Constructor Summary
Constructors Constructor Description OSMTileFactoryInfo()Default constructorOSMTileFactoryInfo(java.lang.String name, java.lang.String baseURL) -
Method Summary
Modifier and Type Method Description java.lang.StringgetAttribution()Some map providers require explicit attribution, can benulljava.lang.StringgetLicense()java.lang.StringgetTileUrl(int x, int y, int zoom)Returns the tile url for the specified tile at the specified zoom level.Methods inherited from class org.jxmapviewer.viewer.TileFactoryInfo
getBaseURL, getDefaultZoomLevel, getLongitudeDegreeWidthInPixels, getLongitudeRadianWidthInPixels, getMapCenterInPixelsAtZoom, getMapWidthInTilesAtZoom, getMaximumZoomLevel, getMinimumZoomLevel, getName, getTileSize, getTotalMapZoom, isXr2l, isYt2b, setDefaultZoomLevel, setXr2l, setYt2b
-
Constructor Details
-
OSMTileFactoryInfo
public OSMTileFactoryInfo()Default constructor -
OSMTileFactoryInfo
public OSMTileFactoryInfo(java.lang.String name, java.lang.String baseURL)- Parameters:
name- the name of the factorybaseURL- the base URL to load tiles from
-
-
Method Details
-
getTileUrl
public java.lang.String getTileUrl(int x, int y, int zoom)Description copied from class:TileFactoryInfoReturns the tile url for the specified tile at the specified zoom level. By default it will generate a tile url using the base url and parameters specified in the constructor. Thus if
then the resulting url would be:baseURl = http://www.myserver.com/maps?version=0.1 xparam = x yparam = y zparam = z tilepoint = [1,2] zoom level = 3
Note that the URL can be ahttp://www.myserver.com/maps?version=0.1&x=1&y=2&z=3file:url.- Overrides:
getTileUrlin classTileFactoryInfo- Parameters:
x- the x value, measured from left to righty- the y value, measured from top to bottomzoom- the zoom level- Returns:
- a valid url to load the tile
-
getAttribution
public java.lang.String getAttribution()Description copied from class:TileFactoryInfoSome map providers require explicit attribution, can benull- Overrides:
getAttributionin classTileFactoryInfo- Returns:
- the attribution text
-
getLicense
public java.lang.String getLicense()- Overrides:
getLicensein classTileFactoryInfo- Returns:
- the license of the map provider, can be
null
-