com.nutiteq.maps
Class StoredMap

java.lang.Object
  extended by com.nutiteq.maps.BaseMap
      extended by com.nutiteq.maps.projections.EPSG3785
          extended by com.nutiteq.maps.StoredMap
All Implemented Interfaces:
GeoMap, Projection, UnstreamedMap
Direct Known Subclasses:
MultiStoredMap

public class StoredMap
extends EPSG3785
implements GeoMap, UnstreamedMap

Note: to use stored map You need to also insert FileSystem into map component using BasicMapComponent.setFileSystem(FileSystem)


Constructor Summary
StoredMap(java.lang.String name, java.lang.String path, boolean readCacheConf)
          Constructor for StoredMap.
StoredMap(java.lang.String name, java.lang.String path, boolean readCacheConf, Copyright copyright)
          Constructor for StoredMap.
 
Method Summary
 java.lang.String buildPath(int mapX, int mapY, int zoom)
          Build path for the tile image.
 WgsPoint getCenterLocation()
           
 int getCenterZoom()
           
 com.nutiteq.config.StoredMapConfig getConfig()
           
 java.lang.String getFileExtension()
          Get extension for files used by stored maps.
 int getHashSize()
          Get the hash size.
 int getMaxZoom()
          Maximum zoom level for implementing map.
 int getMinZoom()
          Minimum zoom level for implementing map.
 ZoomRange getZoomRange()
          Get zoom range for the map
 int getTilesPerFile()
          Get the number of tiles per file.
 void initializeConfigUsingFs(FileSystem fs)
          Read cache.conf
 boolean isInitializeConf()
           
 com.nutiteq.config.StoredMapConfig readConfig(FileSystem fs)
           
 void setFileExtension(java.lang.String fileExt)
          Set extension for files used by stored maps.
 void setHashSize(int hashSize)
          Set hash size.
 void setMaxZoom(int maxZoom)
          Set maximum zoom level.
 void setMinZoom(int minZoom)
          Set minimum zoom level.
 void setName(java.lang.String name)
          Set the name of this map.
 void setZoomRange(ZoomRange zoomRange)
          Set zoom range.
 void setTilesPerFile(int tilesPerFile)
          Set tiles per file.
 
Methods inherited from class com.nutiteq.maps.projections.EPSG3785
mapPosToWgs, wgsToMapPos
 
Methods inherited from class com.nutiteq.maps.BaseMap
addTileOverlay, getCopyright, getInitializationTask, getMapHeight, getMapWidth, getMissingTileImage, getTileMapBounds, getTileOverlay, getTileSize, setCopyright, setMissingTileImage, zoom
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.nutiteq.maps.GeoMap
addTileOverlay, getCopyright, getInitializationTask, getMapHeight, getMapWidth, getMissingTileImage, getTileMapBounds, getTileOverlay, getTileSize, mapPosToWgs, setMissingTileImage, zoom, wgsToMapPos
 

Constructor Detail

StoredMap

public StoredMap(java.lang.String name,
                 java.lang.String path,
                 boolean readCacheConf)
Constructor for StoredMap. Default map name is the last component of the path.

Parameters:
name - map name
path - root path for the stored map data
readCacheConf - whether to read tiles_per_file and hash_size settings from cache.conf

StoredMap

public StoredMap(java.lang.String name,
                 java.lang.String path,
                 boolean readCacheConf,
                 Copyright copyright)
Constructor for StoredMap. Default map name is the last component of the path.

Parameters:
name - map name
path - root path for the stored map data
readCacheConf - whether to read tiles_per_file and hash_size settings from cache.conf
copyright - Text/image for the copyright overlay
Method Detail

initializeConfigUsingFs

public void initializeConfigUsingFs(FileSystem fs)
Read cache.conf


readConfig

public com.nutiteq.config.StoredMapConfig readConfig(FileSystem fs)

getCenterLocation

public WgsPoint getCenterLocation()

getCenterZoom

public int getCenterZoom()

setName

public void setName(java.lang.String name)
Set the name of this map.

Parameters:
name - new name

getMaxZoom

public int getMaxZoom()
Description copied from interface: GeoMap
Maximum zoom level for implementing map.

Specified by:
getMaxZoom in interface GeoMap
Overrides:
getMaxZoom in class BaseMap
Returns:
maximum zoom for the map

getMinZoom

public int getMinZoom()
Description copied from interface: GeoMap
Minimum zoom level for implementing map.

Specified by:
getMinZoom in interface GeoMap
Overrides:
getMinZoom in class BaseMap
Returns:
minimum zoom level

getZoomRange

public ZoomRange getZoomRange()
Description copied from interface: GeoMap
Get zoom range for the map

Specified by:
getZoomRange in interface GeoMap
Overrides:
getZoomRange in class BaseMap
Returns:
zoom range (min zoom, max zoom) for the map

buildPath

public java.lang.String buildPath(int mapX,
                                  int mapY,
                                  int zoom)
Description copied from interface: UnstreamedMap
Build path for the tile image. Images reading from network and application jar is supported.

Specified by:
buildPath in interface UnstreamedMap
Parameters:
mapX - tile top-left corner x on pixel map
mapY - tile top-left corner x on pixel map
zoom - zoom level
Returns:
path for the tile image. For on-line URL must start with "http://" or "https://"; for filesystem starts with "file://"; for application package resource starts with "/"

setTilesPerFile

public void setTilesPerFile(int tilesPerFile)
Set tiles per file.

Parameters:
tilesPerFile - new value for tiles per file

setMaxZoom

public void setMaxZoom(int maxZoom)
Set maximum zoom level.

Parameters:
maxZoom - new max zoom level

setMinZoom

public void setMinZoom(int minZoom)
Set minimum zoom level.

Parameters:
minZoom - new min zoom level

setZoomRange

public void setZoomRange(ZoomRange zoomRange)
Set zoom range.

Parameters:
zoomRange - new zoom range

setHashSize

public void setHashSize(int hashSize)
Set hash size.

Parameters:
hashSize - new hash size value.

getHashSize

public int getHashSize()
Get the hash size.

Returns:
hashSize, default 1

getTilesPerFile

public int getTilesPerFile()
Get the number of tiles per file.

Returns:
tilesPerFile, default 1

setFileExtension

public void setFileExtension(java.lang.String fileExt)
Set extension for files used by stored maps.

Parameters:
fileExt - file extension

getFileExtension

public java.lang.String getFileExtension()
Get extension for files used by stored maps.

Returns:
file extension, default "mgm"

getConfig

public com.nutiteq.config.StoredMapConfig getConfig()

isInitializeConf

public boolean isInitializeConf()