com.nutiteq.maps
Class BaseKaMap

java.lang.Object
  extended by com.nutiteq.maps.BaseMap
      extended by com.nutiteq.maps.projections.EPSG4326
          extended by com.nutiteq.maps.BaseKaMap
All Implemented Interfaces:
GeoMap, Projection
Direct Known Subclasses:
KaMap, StreamedKaMap

public abstract class BaseKaMap
extends EPSG4326
implements GeoMap


Constructor Summary
BaseKaMap(Copyright copyright, int tileSize, int[] scales, int minZoom, int maxZoom)
           
BaseKaMap(java.lang.String copyright, int tileSize, int[] scales, int minZoom, int maxZoom)
           
 
Method Summary
 int getMapHeight(int zoom)
          Get map height for given zoom level.
 int getMapWidth(int zoom)
          Get map width for given zoom level.
 TileMapBounds getTileMapBounds(int zoom)
          Get map bounds for specified zoom level.
 Point mapPosToWgs(MapPos pos)
          Convert a point on pixel map to WGS84 coordinates (decimal coordinates * 1000000)
 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.projections.EPSG4326
getRatio, setWidthHeightRatio
 
Methods inherited from class com.nutiteq.maps.BaseMap
addTileOverlay, getCopyright, getMaxZoom, getMinZoom, getMissingTileImage, getZoomRange, getTileOverlay, getTileSize, setCopyright, setMissingTileImage
 
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, getMaxZoom, getMinZoom, getMissingTileImage, getZoomRange, getTileOverlay, getTileSize, setMissingTileImage
 

Constructor Detail

BaseKaMap

public BaseKaMap(java.lang.String copyright,
                 int tileSize,
                 int[] scales,
                 int minZoom,
                 int maxZoom)

BaseKaMap

public BaseKaMap(Copyright copyright,
                 int tileSize,
                 int[] scales,
                 int minZoom,
                 int maxZoom)
Method Detail

mapPosToWgs

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

Specified by:
mapPosToWgs in interface GeoMap
Specified by:
mapPosToWgs in interface Projection
Overrides:
mapPosToWgs in class EPSG4326
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)

wgsToMapPos

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

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

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

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

getTileMapBounds

public TileMapBounds getTileMapBounds(int zoom)
Description copied from class: BaseMap
Get map bounds for specified zoom level.

Specified by:
getTileMapBounds in interface GeoMap
Overrides:
getTileMapBounds in class BaseMap
Parameters:
zoom - zoom level for witch to get map bounds
Returns:
bounds for zoom level for given map