com.nutiteq.maps
Class UnstreamedDoubleSizedTilesMap

java.lang.Object
  extended by com.nutiteq.maps.BaseMap
      extended by com.nutiteq.maps.UnstreamedDoubleSizedTilesMap
All Implemented Interfaces:
GeoMap, UnstreamedMap

public class UnstreamedDoubleSizedTilesMap
extends BaseMap
implements GeoMap, UnstreamedMap


Constructor Summary
UnstreamedDoubleSizedTilesMap(GeoMap resizedMap)
          Resizes ("zooms in") all map images for the map, exactly 2 times
UnstreamedDoubleSizedTilesMap(GeoMap resizedMap, boolean resizeOnlyLastLevel)
          Digitally zooms map images for the map
 
Method Summary
 void addTileOverlay(MapTileOverlay overlay)
          Add overlay for displaying tiles with additional data on map tiles.
 java.lang.String buildPath(int mapX, int mapY, int zoom)
          Build path for the tile image.
 Copyright getCopyright()
          Map copyright string painted on screen
 int getMapHeight(int zoom)
          Get map height for given zoom level.
 int getMapWidth(int zoom)
          Get map width for given zoom level.
 int getMaxZoom()
          Maximum zoom level for implementing map.
 int getMinZoom()
          Minimum zoom level for implementing map.
 com.nutiteq.wrappers.Image getMissingTileImage()
          Get image used for showing missing image.
 ZoomRange getZoomRange()
          Get zoom range for the map
 MapTileOverlay getTileOverlay()
          Get overlay used for map
 int getTileSize()
          Get tile size for implemented map
 Point mapPosToWgs(MapPos pos)
          Convert a point on pixel map to WGS84 coordinates (decimal coordinates * 1000000)
 void setMissingTileImage(com.nutiteq.wrappers.Image missingTile)
          Set image used for missing tiles
 MapPos zoom(MapPos middlePoint, int zoomSteps)
           Handles zoom for display middle point (as default the red cross on screen) by assuming that map size between single zoom levels is always magnitude of two (next map size is two times smaller or bigger).
 MapPos wgsToMapPos(Point wgs, int zoom)
          Convert WGS84 coordinates to pixel point on map
 
Methods inherited from class com.nutiteq.maps.BaseMap
getInitializationTask, getTileMapBounds, setCopyright
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.nutiteq.maps.GeoMap
getInitializationTask, getTileMapBounds
 

Constructor Detail

UnstreamedDoubleSizedTilesMap

public UnstreamedDoubleSizedTilesMap(GeoMap resizedMap)
Resizes ("zooms in") all map images for the map, exactly 2 times

Parameters:
resizedMap - Map which will be used as resized map, could be any map service of library

UnstreamedDoubleSizedTilesMap

public UnstreamedDoubleSizedTilesMap(GeoMap resizedMap,
                                     boolean resizeOnlyLastLevel)
Digitally zooms map images for the map

Parameters:
resizedMap - Map which will be used as resized map, could be any map service of library
resizeOnlyLastLevel - If true then enable to "digitally zoom" last map level only, otherwise zoom all maps.
Method Detail

addTileOverlay

public void addTileOverlay(MapTileOverlay overlay)
Description copied from interface: GeoMap
Add overlay for displaying tiles with additional data on map tiles.

Specified by:
addTileOverlay in interface GeoMap
Overrides:
addTileOverlay in class BaseMap
Parameters:
overlay - overlay to be used for additional data

getCopyright

public Copyright getCopyright()
Description copied from interface: GeoMap
Map copyright string painted on screen

Specified by:
getCopyright in interface GeoMap
Overrides:
getCopyright in class BaseMap
Returns:
copyright string

getMapHeight

public int getMapHeight(int zoom)
Description copied from class: BaseMap
Get map height for given zoom level. Default implementation is done for OpenStreetMap system (map tile edge is power of 2)

Specified by:
getMapHeight in interface GeoMap
Overrides:
getMapHeight in class BaseMap
Parameters:
zoom - zoom level for witch to get map height
Returns:
map height

getMapWidth

public int getMapWidth(int zoom)
Description copied from class: BaseMap
Get map width for given zoom level. Default implementation is done for OpenStreetMap system (map tile edge is power of 2)

Specified by:
getMapWidth in interface GeoMap
Overrides:
getMapWidth in class BaseMap
Parameters:
zoom - zoom level for witch to get map width
Returns:
map width

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

getMissingTileImage

public com.nutiteq.wrappers.Image getMissingTileImage()
Description copied from interface: GeoMap
Get image used for showing missing image.

Specified by:
getMissingTileImage in interface GeoMap
Overrides:
getMissingTileImage in class BaseMap
Returns:
image used

getTileOverlay

public MapTileOverlay getTileOverlay()
Description copied from interface: GeoMap
Get overlay used for map

Specified by:
getTileOverlay in interface GeoMap
Overrides:
getTileOverlay in class BaseMap
Returns:
overlay used for additional data

getTileSize

public int getTileSize()
Description copied from interface: GeoMap
Get tile size for implemented map

Specified by:
getTileSize in interface GeoMap
Overrides:
getTileSize in class BaseMap
Returns:
tile size in pixels

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

mapPosToWgs

public Point mapPosToWgs(MapPos pos)
Description copied from interface: GeoMap
Convert a point on pixel map to WGS84 coordinates (decimal coordinates * 1000000)

Specified by:
mapPosToWgs in interface GeoMap
Parameters:
pos - pixel point on the map (on 256x256 pixels map of the world 0E 0N is located at map pixel 128x : 128y)
Returns:
point in internally used WGS84 format (decimal degrees * 1000000)

setMissingTileImage

public void setMissingTileImage(com.nutiteq.wrappers.Image missingTile)
Description copied from interface: GeoMap
Set image used for missing tiles

Specified by:
setMissingTileImage in interface GeoMap
Overrides:
setMissingTileImage in class BaseMap
Parameters:
missingTile - image used

wgsToMapPos

public MapPos wgsToMapPos(Point wgs,
                          int zoom)
Description copied from interface: GeoMap
Convert WGS84 coordinates to pixel point on map

Specified by:
wgsToMapPos in interface GeoMap
Parameters:
wgs - WGS84 coordinates (decimal coordinates * 1000000)
zoom - zoom level for the map
Returns:
pixel position on map for the coordinates

zoom

public MapPos zoom(MapPos middlePoint,
                   int zoomSteps)
Description copied from class: BaseMap

Handles zoom for display middle point (as default the red cross on screen) by assuming that map size between single zoom levels is always magnitude of two (next map size is two times smaller or bigger).

For example for OpenStreetMap zoom level 0 world size is 256x256 pixels and center point will be in 128x128. If zoomed in one level world size will be 512x512 pixels and center point will be at 256x256.

Specified by:
zoom in interface GeoMap
Overrides:
zoom in class BaseMap
Parameters:
middlePoint - map position on witch to perform zoom action
zoomSteps - zoom steps needed to handle
Returns:
maps position on new zoom level

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 "/"