com.nutiteq
Class BasicMapComponent

java.lang.Object
  extended by com.nutiteq.BaseMapComponent
      extended by com.nutiteq.BasicMapComponent
All Implemented Interfaces:
com.nutiteq.maps.MapTilesRequestor, com.nutiteq.net.DownloadHandler, DisplayUpdater, com.nutiteq.ui.Pannable

public class BasicMapComponent
extends com.nutiteq.BaseMapComponent
implements com.nutiteq.maps.MapTilesRequestor, com.nutiteq.ui.Pannable, DisplayUpdater, com.nutiteq.net.DownloadHandler

Main class for mapping. You need to: 1. create the object using one of the constructors, 2. set some default values: minimu is setMap() to set used map 3. start threads using startMapping() See MapComponent in J2ME package to get idea of reasonable default configuration

Author:
Jaak

Field Summary
static int FINGER_CLICK_TOLERANCE
          Pixel tolerance used for phones without stylus to distinguish between screen click and drag events
static int STYLUS_CLICK_TOLERANCE
          Pixel tolerance used for stylus phones to distinguish between screen click and drag events
static int ZOOM_UNKNOWN
           
 
Constructor Summary
BasicMapComponent(java.lang.String licenseKey, com.nutiteq.wrappers.AppContext appContext, int width, int height, WgsPoint middlePoint, int zoom)
          Constructor for map display object.
BasicMapComponent(java.lang.String licenseKey, java.lang.String vendor, java.lang.String appname, int width, int height, WgsPoint middlePoint, int zoom)
          Deprecated. use BasicMapComponent(String, AppContext, int, int, WgsPoint, int) instead
 
Method Summary
 void addKmlService(KmlService service)
          Add kml service to be handled (updated, parsed, painted) internally by library.
 void addLine(Line line)
          Add line to be displayed on map
 void addLines(Line[] lines)
          Add lines to be displayed on map
 void addOnMapElements(OnMapElement[] elements)
          Add elements to be displayed on map
 void addOnMapElements(OnMapElement[] elements, boolean updateScreen)
          Not part of public API
 void addPlace(Place place)
          Add a place to be displayed on map
 void addPlaceFirst(Place place)
          Add a place to be displayed on map first (Z-order)
 void addPlaces(Place[] places)
          Add places to be displayed on map
 void addPlaces(Place[] places, boolean updateScreen)
          Not part of public API.
 void addPolygon(Polygon polygon)
          Add polygon to be displayed on map
 void addPolygons(Polygon[] polygons)
          Add multiple polygons for display
 void calculatePointerPressed(int x, int y)
          Not part of public API
 void calculateZoom(double step)
          Not part of public API
 void cancelDoubleClick()
          Not part of public API
 void cancelDualClick()
          Not part of public API
 void cancelLongClick()
          Not part of public API
 void defineControlKey(int actionCode, int keyCode)
          Set key code values for defined control keys.
 void enqueue(com.nutiteq.task.Task task)
          Not part of public API
 void enqueueDownload(ResourceRequestor downloadable, int cacheLevel)
          Enqueue download requestor to be handled by library.
 void focusOnPlace(Place focusOn, boolean centerScreen)
          Set focus on given place.
 void fullScreenUpdate()
           
 PlaceInfo getAdditionalInfo(Place place)
          Get additional info for place displayed by internally handled service.
 MapTile[] getAllRequiredTiles()
          Not part of public API
 WgsBoundingBox getBoundingBox()
          Get bounding box for current map view.
 WgsPoint getCenterPoint()
          Get map center point.
 DownloadCounter getDownloadCounter()
           
 ErrorListener getErrorListener()
          Get the current error listener.
 int getHeight()
          Return current view height
 MapPos getInternalMiddlePoint()
          Not part of public API.
 KmlPlace[] getKmlPlaces()
           
 KmlPlace[] getKmlPlaces(KmlService service)
          Get KML places which were read by KML parser.
 KmlService[] getKmlServices()
          Get list of used kml services
 java.lang.String getLibraryLog()
          Get internal log for library.
 GeoMap getMap()
          Retrieve currently used map.
 MapListener getMapListener()
          Get the current map listener.
 MapPos getMapPosition(WgsPoint wgsLocation)
          Not part of public API
 WgsPoint getMiddlePoint()
          Get map center point value in lon/lat
 OnMapElementListener getOnMapElementListener()
          Get current listener for objects on map
 MapTile getRequiredTile()
          Not part of public API
 com.nutiteq.ui.ScaleBar getScaleBar()
          Return currently used scale bar
 int getScreenLeft()
          Get the screen position for the top-left corner.
 int getScreenTop()
          Get the screen position for the top-left corner.
 int getZoom()
          Get the current zoom level.
 ZoomRange getZoomRange()
          Get zoom range for currently used map
 int getWidth()
          Return current view width
 Place[] getVisiblePlaces()
          Get places currently visible on map view.
 void keyPressed(int keyCode)
          Handle key pressed event
 void keyReleased(int keyCode)
          Handle key released event
 void keyRepeated(int keyCode)
          Handle key repeated event
 void looseFocusOnDrag(boolean looseFocus)
          On touch screen phones, if some object has been selected, should focus be lost on map drag.
 void loosePlaceFocus()
          Not part of public API
 void moveMap(double lon, double lat)
          Move map without changing zoom.
 void moveMap(WgsPoint point)
          Move map without changing zoom.
 void notifyAfterDoubleClick()
          Not part of public API
 void notifyAfterDoubleClickPress(int x, int y)
          Not part of public API
 void notifyAfterDoubleClickRelease(int x, int y)
          Not part of public API
 void notifyAfterDualClick()
          Not part of public API
 void notifyAfterLongPress()
          Not part of public API
 void paint(com.nutiteq.wrappers.Graphics g)
          Paint the map component.
 void paintAt(com.nutiteq.wrappers.Graphics g, int paintX, int paintY)
          Paint map view to give position on screen
 void panMap(int panX, int panY)
          Move view on map by number of pixels
 void pointerDragged(int x, int y)
          Handle pointer dragged event
 void pointerDraggedDual(double dist)
          Not part of public API
 void pointerPressed(int x, int y)
          Handle pointer pressed event
 void pointerReleased(int x, int y)
          Handle pointer released event
 void refreshTileOverlay()
          refreshes map overlays contribution from http://code.google.com/p/doroga-tv-widget/source/browse/trunk/nutiteq_map_sdk_1_1_0_refresh_tile_overlay.patch
 void removeAllPlaces()
          Remove all places.
 void removeKmlService()
          removes all KML Services added so far
 void removeKmlService(KmlService service)
          Remove previously added kml service
 void removeLine(Line line)
          Remove a line from previously added lines
 void removeLines(Line[] lines)
          Remove lines from previously added lines
 void removeLocationSource()
          Remove used location source
 void removeOnMapElements(OnMapElement[] elements)
          Remove given elements from map display
 void removePlace(Place place)
          Remove a place from previously added places
 void removePlaces(Place[] places)
          Remove places from previously added places
 void removePolygon(Polygon polygon)
          Remove polygon from map
 void removePolygons(Polygon[] polygons)
          Remove multiple polygons from map
 void removeZoomDelay()
          Not part of public API.
 void repaint()
          Not part of public API
 void repaint(boolean fromTimer)
          Not in public API.
 void replacePlaces(Place[] places)
          Add new places to the map and remove all other places previously on the map.
 boolean requiresMoreTiles()
          Not part of public API
 void resize(int width, int height)
          Changes map view size
 void setBoundingBox(WgsBoundingBox bBox)
          Set bounding box for the view.
 void setControlKeysHandler(ControlKeysHandler keysHandler)
          Change control keys handler used for actions mapping.
 void setCursor(Cursor newCursor)
          Set cursor used on screen for places selection, etc.
 void setDoubleClickZoomIn(boolean doubleClickZoomIn)
          Enable/disable zooming in when double clicking the map
 void setDownloadCounter(DownloadCounter counter)
          Set download counter used for gathering information about network traffic
 void setDownloadDisplay(DownloadDisplay display)
          Set used implementation for network traffic display on map.
 void setDownloadStreamOpener(DownloadStreamOpener opener)
          Change the implementation for download stream opening.
 void setDualClickZoomOut(boolean dualClickZoomOut)
          Enable/disable zooming out when dual clicking (with two fingers) the map
 void setErrorListener(ErrorListener errorListener)
          Set listener for library errors
 void setFileSystem(FileSystem fs)
          Set file system to be used for StoredMap handling
 void setImageProcessor(com.nutiteq.ui.ImageProcessor processor)
          Enables processing of all map images.
 void setLicense(com.nutiteq.license.License license)
          Not in public API.
 void setLocationSource(LocationSource source)
          Set location source with GPS marker to be displayed.
 void setMap(GeoMap newMap)
          Change used map
 void setMapDragging(boolean mapDragging)
          Enable or disable map moving by dragging the pointer.
 void setMapListener(MapListener mL)
          Set map listener for receiving map related callback events from library
 void setMiddlePoint(double lon, double lat, int zoom)
          Define middle point location in WGS84
 void setMiddlePoint(WgsPoint wgs)
          Define middle point in WGS84, without changing zoom level
 void setMiddlePoint(WgsPoint point, int zoom)
          Define middle point location in WGS84
 void setNetworkCache(Cache cache)
          Set cache for networking.
 void setOnLongClickListener(com.nutiteq.listeners.OnLongClickListener onLongClickListener)
          Set long click listener
 void setOnMapElementListener(OnMapElementListener listener)
          Set listener for receiving events related to objects shown on map.
 void setOnPointerDragListener(com.nutiteq.listeners.OnPointerDragListener onPointerDragListener)
          Set pointer drag listener
 void setOnPointerPressListener(com.nutiteq.listeners.OnPointerPressListener onPointerPressListener)
          Set pointer press listener
 void setOnPointerReleaseListener(com.nutiteq.listeners.OnPointerReleaseListener onPointerReleaseListener)
          Set pointer release listener
 void setOnScreenZoomControls(OnScreenZoomControls zoomControls)
          Set zoom controls to be displayed on screen and used for touch screen zooming.
 void setPanningStrategy(PanningStrategy panningStrategy)
          Set panning strategy for map component.
 void setScaleBar(com.nutiteq.ui.ScaleBar scaleBar)
          Set scale bar to be displayed on screen
 void setScreenBounds(int x, int y, int w, int h)
          Set bounds on screen.
 void setScreenCenter(int x, int y)
          Set the screen position for the center of the displayed map.
 void setScreenPosition(int x, int y)
          Set position on screen for top-left corner.
 void setShowOverlaysWhileZooming(boolean enabled)
          Enable or disable overlay rendering (Points, KML Services, Lines etc) while zooming.
 void setSize(int w, int h)
          Set map size on screen.
 void setSmoothZoom(boolean enabled)
          Disable or enable smooth zooming
 void setZoom(int newZoom)
          Set map zoom without changing position.
 void setZoomLevelIndicator(ZoomIndicator zoomIndicator)
          Set zoom indicator to be painted on display.
 void setTileDatabaseSystem(TileDatabaseHelper db)
          Set database connection to be used for DbStoredMap handling
 void setTileSearchStrategy(GeoMap[] searched)
          Set search strategy for map tile.
 void setTouchClickTolerance(int pixels)
          Set tolerance for detecting click events instead of dragging on touchscreen.
 void startDualZoom(double x, double y, double dist)
          Not part of public API
 void startMapping()
          Initialize needed resources for mapping and start internal threads.
 void stopDualZoom()
          Not part of public API
 void stopMapping()
          Stop threads started by MapComponent.
 void zoomIn()
          Zoom in one step
 void zoomLevelIndicatorCheck()
          Not part of public API
 void zoomOut()
          Zoom out one step
 void tileRetrieved(MapTile mt)
          Not in public API.
 void updateTile(MapTile mapTile)
          Not part of public API
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLUS_CLICK_TOLERANCE

public static final int STYLUS_CLICK_TOLERANCE
Pixel tolerance used for stylus phones to distinguish between screen click and drag events

See Also:
Constant Field Values

FINGER_CLICK_TOLERANCE

public static final int FINGER_CLICK_TOLERANCE
Pixel tolerance used for phones without stylus to distinguish between screen click and drag events

See Also:
Constant Field Values

ZOOM_UNKNOWN

public static final int ZOOM_UNKNOWN
See Also:
Constant Field Values
Constructor Detail

BasicMapComponent

public BasicMapComponent(java.lang.String licenseKey,
                         java.lang.String vendor,
                         java.lang.String appname,
                         int width,
                         int height,
                         WgsPoint middlePoint,
                         int zoom)
Deprecated. use BasicMapComponent(String, AppContext, int, int, WgsPoint, int) instead

Constructor for map display object. Defines available paint area (width, height), middle point for map display at start (defined in WGS84), and zoom level at start.

Parameters:
licenseKey - License key issued by Nutiteq LLC, get if from http://www.nutiteq.com/generate_key.html
vendor - Vendor name used by library for license check
appname - Application name used by library for license check.
width - map view width
height - map view height
middlePoint - middle point at start (defined in WGS84)
zoom - zoom level at start

BasicMapComponent

public BasicMapComponent(java.lang.String licenseKey,
                         com.nutiteq.wrappers.AppContext appContext,
                         int width,
                         int height,
                         WgsPoint middlePoint,
                         int zoom)
Constructor for map display object. Defines available paint area (width, height), middle point for map display at start (defined in WGS84), and zoom level at start.

Parameters:
licenseKey - License key issued by Nutiteq, get it from http://www.nutiteq.com/generate_key.html
appContext - Application context: use Context in Android or MIDlet class for Java ME application. Created usually as new AppContext(this)
width - map view width in pixels. Often 1 as will be overwritten later during first view update
height - map view height in pixels
middlePoint - map middle point at start (defined in WGS84 lat/long)
zoom - zoom level at start, in Google system (0-world etc)
Method Detail

setImageProcessor

public void setImageProcessor(com.nutiteq.ui.ImageProcessor processor)
Enables processing of all map images. Applied to global cache, so works for all images, not just one map service Set to null to disable it

Parameters:
processor - specific processor. Try e.g. NightModeImageProcessor()

startMapping

public void startMapping()
Initialize needed resources for mapping and start internal threads. This must be called after other initializations.


resize

public void resize(int width,
                   int height)
Changes map view size

Parameters:
width - new map view width
height - new map view height

fullScreenUpdate

public void fullScreenUpdate()

getWidth

public int getWidth()
Return current view width

Returns:
view width

getHeight

public int getHeight()
Return current view height

Returns:
view height

setMiddlePoint

public void setMiddlePoint(double lon,
                           double lat,
                           int zoom)
Define middle point location in WGS84

Parameters:
lon - degrees in wgs
lat - degrees in wgs
zoom - zoom level to be displayed

setMiddlePoint

public void setMiddlePoint(WgsPoint point,
                           int zoom)
Define middle point location in WGS84

Parameters:
point - coordinates in WGS84
zoom - zoom level to be displayed

setMiddlePoint

public void setMiddlePoint(WgsPoint wgs)
Define middle point in WGS84, without changing zoom level

Parameters:
wgs - coordinates in WGS84

setShowOverlaysWhileZooming

public void setShowOverlaysWhileZooming(boolean enabled)
Enable or disable overlay rendering (Points, KML Services, Lines etc) while zooming. Overlay will be resampled as raster, can look ugly

Parameters:
enabled, - default FALSE

paint

public void paint(com.nutiteq.wrappers.Graphics g)
Paint the map component. As default view will be painted to 0, 0 on graphics object. This can be changed with setScreenPosition(int, int)

Parameters:
g - graphics object provided by implementing application

paintAt

public void paintAt(com.nutiteq.wrappers.Graphics g,
                    int paintX,
                    int paintY)
Paint map view to give position on screen

Parameters:
g - graphics object to paint on
paintX - screen position x
paintY - screen position y

getMiddlePoint

public WgsPoint getMiddlePoint()
Get map center point value in lon/lat

Returns:
middle point on screen in WGS84

setSmoothZoom

public void setSmoothZoom(boolean enabled)
Disable or enable smooth zooming


stopDualZoom

public void stopDualZoom()
Not part of public API


startDualZoom

public void startDualZoom(double x,
                          double y,
                          double dist)
Not part of public API


zoomIn

public void zoomIn()
Zoom in one step


zoomOut

public void zoomOut()
Zoom out one step


calculateZoom

public void calculateZoom(double step)
Not part of public API


setMapListener

public void setMapListener(MapListener mL)
Set map listener for receiving map related callback events from library

Parameters:
mL - class implementing MapListener interface

setOnMapElementListener

public void setOnMapElementListener(OnMapElementListener listener)
Set listener for receiving events related to objects shown on map.

Parameters:
listener -

setErrorListener

public void setErrorListener(ErrorListener errorListener)
Set listener for library errors

Parameters:
errorListener - class implementing ErrorListener interface

setOnScreenZoomControls

public void setOnScreenZoomControls(OnScreenZoomControls zoomControls)
Set zoom controls to be displayed on screen and used for touch screen zooming.

Parameters:
zoomControls - zoom controls to be used

setScaleBar

public void setScaleBar(com.nutiteq.ui.ScaleBar scaleBar)
Set scale bar to be displayed on screen

Parameters:
scaleBar - scale bar to be used

getScaleBar

public com.nutiteq.ui.ScaleBar getScaleBar()
Return currently used scale bar

Returns:
scaleBar currently used scale bar

panMap

public void panMap(int panX,
                   int panY)
Move view on map by number of pixels

Specified by:
panMap in interface com.nutiteq.ui.Pannable
Parameters:
panX - number of pixels to be moved left/right
panY - number of pixels to be moved up/down

keyPressed

public void keyPressed(int keyCode)
Handle key pressed event

Parameters:
keyCode - key code forwarded by implementing application

keyReleased

public void keyReleased(int keyCode)
Handle key released event

Parameters:
keyCode - key code forwarded by implementing application

keyRepeated

public void keyRepeated(int keyCode)
Handle key repeated event

Parameters:
keyCode - key code forwarded by implementing application

pointerDragged

public void pointerDragged(int x,
                           int y)
Handle pointer dragged event

Parameters:
x - pixels dragged
y - pixels dragged

pointerPressed

public void pointerPressed(int x,
                           int y)
Handle pointer pressed event

Parameters:
x - pointer x coordinate
y - pointer y coordinate

calculatePointerPressed

public void calculatePointerPressed(int x,
                                    int y)
Not part of public API


pointerReleased

public void pointerReleased(int x,
                            int y)
Handle pointer released event

Parameters:
x - position on screen
y - position on screen

defineControlKey

public void defineControlKey(int actionCode,
                             int keyCode)
Set key code values for defined control keys. Using this method will set the control keys handler to default implementation UserDefinedKeysMapping

Parameters:
actionCode - internal code for action ControlKeys
keyCode - key code value for defined key

setControlKeysHandler

public void setControlKeysHandler(ControlKeysHandler keysHandler)
Change control keys handler used for actions mapping.

Parameters:
keysHandler - new keys mapping handler

getRequiredTile

public MapTile getRequiredTile()
Not part of public API

Specified by:
getRequiredTile in interface com.nutiteq.maps.MapTilesRequestor

requiresMoreTiles

public boolean requiresMoreTiles()
Not part of public API

Specified by:
requiresMoreTiles in interface com.nutiteq.maps.MapTilesRequestor

getAllRequiredTiles

public MapTile[] getAllRequiredTiles()
Not part of public API

Specified by:
getAllRequiredTiles in interface com.nutiteq.maps.MapTilesRequestor

tileRetrieved

public void tileRetrieved(MapTile mt)
Not in public API. Will be obfuscated. Notify when a tile was downloaded.

Specified by:
tileRetrieved in interface com.nutiteq.maps.MapTilesRequestor
Parameters:
mt - the tile downloaded

updateTile

public void updateTile(MapTile mapTile)
Not part of public API

Specified by:
updateTile in interface com.nutiteq.maps.MapTilesRequestor

repaint

public void repaint()
Not part of public API

Specified by:
repaint in interface DisplayUpdater

removePlace

public void removePlace(Place place)
Remove a place from previously added places

Parameters:
place - place to be removed

removeLine

public void removeLine(Line line)
Remove a line from previously added lines

Parameters:
line - line to be removed

removeLines

public void removeLines(Line[] lines)
Remove lines from previously added lines

Parameters:
lines - lines to be removed

removeOnMapElements

public void removeOnMapElements(OnMapElement[] elements)
Remove given elements from map display

Parameters:
elements - elements to be removed

removePlaces

public void removePlaces(Place[] places)
Remove places from previously added places

Parameters:
places - places to be removed

removeAllPlaces

public void removeAllPlaces()
Remove all places.


replacePlaces

public void replacePlaces(Place[] places)
Add new places to the map and remove all other places previously on the map.

Parameters:
places - places to be displayed on map

addPlace

public void addPlace(Place place)
Add a place to be displayed on map

Parameters:
place - place to be displayed on map (if visible)

addPlaceFirst

public void addPlaceFirst(Place place)
Add a place to be displayed on map first (Z-order)

Parameters:
place - place to be displayed on map (if visible)

addPlaces

public void addPlaces(Place[] places)
Add places to be displayed on map

Parameters:
places - places to be displayed on map (if visible)

addPlaces

public void addPlaces(Place[] places,
                      boolean updateScreen)
Not part of public API. Add place to map with possibility to skip repaint.

Parameters:
places - places to be added
updateScreen - should screen be updated after places have been added

addLine

public void addLine(Line line)
Add line to be displayed on map

Parameters:
line - line to be displayed

addLines

public void addLines(Line[] lines)
Add lines to be displayed on map

Parameters:
lines - lines to be displayed

addPolygon

public void addPolygon(Polygon polygon)
Add polygon to be displayed on map

Parameters:
polygon - polygon to be displayed

addPolygons

public void addPolygons(Polygon[] polygons)
Add multiple polygons for display

Parameters:
polygons - polygons to be added

removePolygon

public void removePolygon(Polygon polygon)
Remove polygon from map

Parameters:
polygon - polygon to be removed

removePolygons

public void removePolygons(Polygon[] polygons)
Remove multiple polygons from map

Parameters:
polygons - polygons to be removed

addOnMapElements

public void addOnMapElements(OnMapElement[] elements)
Add elements to be displayed on map

Parameters:
elements - elements to be added for display

addOnMapElements

public void addOnMapElements(OnMapElement[] elements,
                             boolean updateScreen)
Not part of public API


getBoundingBox

public WgsBoundingBox getBoundingBox()
Get bounding box for current map view.

Returns:
bounding box with WGS84 coordinates for current map views left bottom and right top corners.

setBoundingBox

public void setBoundingBox(WgsBoundingBox bBox)
Set bounding box for the view. Finds the best zoom level for the bounding box view.

Parameters:
bBox - are to be displayed (in WGS84 coordinates)

stopMapping

public void stopMapping()
Stop threads started by MapComponent. Called before application exit to clean library resources.


repaint

public void repaint(boolean fromTimer)
Not in public API. Will be removed by obfuscation


setLicense

public void setLicense(com.nutiteq.license.License license)
Not in public API. Will be removed by obfuscation


setMap

public void setMap(GeoMap newMap)
Change used map

Parameters:
newMap - new map to be displayed

getZoomRange

public ZoomRange getZoomRange()
Get zoom range for currently used map

Returns:
zoom range for map

addKmlService

public void addKmlService(KmlService service)
Add kml service to be handled (updated, parsed, painted) internally by library.

Parameters:
service - new service to be displayed on map

getKmlServices

public KmlService[] getKmlServices()
Get list of used kml services

Returns:
kml services inserted by application

removeKmlService

public void removeKmlService(KmlService service)
Remove previously added kml service

Parameters:
service - service to be removed

getAdditionalInfo

public PlaceInfo getAdditionalInfo(Place place)
Get additional info for place displayed by internally handled service.

Parameters:
place - place associated with internal data
Returns:
information object containing additional data for place

getKmlPlaces

public KmlPlace[] getKmlPlaces(KmlService service)
Get KML places which were read by KML parser.

Parameters:
service - service for which KML places are needed
Returns:
array of KmlPlace

getMap

public GeoMap getMap()
Retrieve currently used map.

Returns:
currently displayed map

getLibraryLog

public java.lang.String getLibraryLog()
Get internal log for library.

Returns:
internal log

removeZoomDelay

public void removeZoomDelay()
Not part of public API. Removed by obfuscator


getInternalMiddlePoint

public MapPos getInternalMiddlePoint()
Not part of public API. Removed by obfuscator.

Returns:
middle point location on pixal map

setSize

public void setSize(int w,
                    int h)
Set map size on screen.

Parameters:
w - map width
h - map height

setScreenPosition

public void setScreenPosition(int x,
                              int y)
Set position on screen for top-left corner.

Parameters:
x - left
y - top

setScreenBounds

public void setScreenBounds(int x,
                            int y,
                            int w,
                            int h)
Set bounds on screen.

Parameters:
x - left
y - top
w - width
h - height
See Also:
setScreenPosition(int,int), setSize(int,int)

setScreenCenter

public void setScreenCenter(int x,
                            int y)
Set the screen position for the center of the displayed map.

Parameters:
x - screen position X
y - screen position Y

getScreenLeft

public int getScreenLeft()
Get the screen position for the top-left corner.


getScreenTop

public int getScreenTop()
Get the screen position for the top-left corner.


getCenterPoint

public WgsPoint getCenterPoint()
Get map center point. Synonym for getMiddlePoint

Returns:
middle point on screen in WGS84

setTouchClickTolerance

public void setTouchClickTolerance(int pixels)
Set tolerance for detecting click events instead of dragging on touchscreen. Defaults to 5 pixels.

Parameters:
pixels - needed to be moved for map dragging

moveMap

public void moveMap(double lon,
                    double lat)
Move map without changing zoom.

Parameters:
lon - new map center in WGS84
lat - new map center in WGS84

moveMap

public void moveMap(WgsPoint point)
Move map without changing zoom.

Parameters:
point - new map center in WGS84

setZoom

public void setZoom(int newZoom)
Set map zoom without changing position.

Parameters:
newZoom - new zoom level

setCursor

public void setCursor(Cursor newCursor)
Set cursor used on screen for places selection, etc.

Parameters:
newCursor - cursor implementation

getZoom

public int getZoom()
Get the current zoom level.

Returns:
current zoom level

getMapListener

public MapListener getMapListener()
Get the current map listener.

Returns:
the current map listener

getOnMapElementListener

public OnMapElementListener getOnMapElementListener()
Get current listener for objects on map

Returns:
elements listener

getErrorListener

public ErrorListener getErrorListener()
Get the current error listener.

Returns:
the current error listener

setDownloadStreamOpener

public void setDownloadStreamOpener(DownloadStreamOpener opener)
Change the implementation for download stream opening. As default a direct connection without any additional headers is used.


zoomLevelIndicatorCheck

public void zoomLevelIndicatorCheck()
Not part of public API


setTileSearchStrategy

public void setTileSearchStrategy(GeoMap[] searched)
Set search strategy for map tile.

Parameters:
searched - search strategy to be used

setPanningStrategy

public void setPanningStrategy(PanningStrategy panningStrategy)
Set panning strategy for map component. This is required for map panning with keys.

Parameters:
panningStrategy - new panning strategy

setLocationSource

public void setLocationSource(LocationSource source)
Set location source with GPS marker to be displayed. Here the location retrieving thread is also started.

Parameters:
source - source to be used

setNetworkCache

public void setNetworkCache(Cache cache)
Set cache for networking. Currently data is cached:

Parameters:
cache -

getMapPosition

public MapPos getMapPosition(WgsPoint wgsLocation)
Not part of public API


removeLocationSource

public void removeLocationSource()
Remove used location source


enqueueDownload

public void enqueueDownload(ResourceRequestor downloadable,
                            int cacheLevel)
Enqueue download requestor to be handled by library.

Specified by:
enqueueDownload in interface com.nutiteq.net.DownloadHandler
Parameters:
downloadable - resource to be downloaded
cacheLevel - at which cache levels should response be cached

setZoomLevelIndicator

public void setZoomLevelIndicator(ZoomIndicator zoomIndicator)
Set zoom indicator to be painted on display. This method will overwrite default values set in MapComponent.showZoomLevelIndicator(boolean).

Parameters:
zoomIndicator - zoom indicator to use

setDownloadDisplay

public void setDownloadDisplay(DownloadDisplay display)
Set used implementation for network traffic display on map.

Parameters:
display - display used for info show

setDownloadCounter

public void setDownloadCounter(DownloadCounter counter)
Set download counter used for gathering information about network traffic

Parameters:
counter - implementation used

looseFocusOnDrag

public void looseFocusOnDrag(boolean looseFocus)
On touch screen phones, if some object has been selected, should focus be lost on map drag.

Parameters:
looseFocus - should object focus be lost

loosePlaceFocus

public void loosePlaceFocus()
Not part of public API


focusOnPlace

public void focusOnPlace(Place focusOn,
                         boolean centerScreen)
Set focus on given place.

Parameters:
focusOn - place to be focused on

getVisiblePlaces

public Place[] getVisiblePlaces()
Get places currently visible on map view.

Returns:
visible places

setFileSystem

public void setFileSystem(FileSystem fs)
Set file system to be used for StoredMap handling

Parameters:
fs - platform dependent file system to be used

setTileDatabaseSystem

public void setTileDatabaseSystem(TileDatabaseHelper db)
Set database connection to be used for DbStoredMap handling

Parameters:
db - platform and format dependent database helper to be used

getDownloadCounter

public DownloadCounter getDownloadCounter()

enqueue

public void enqueue(com.nutiteq.task.Task task)
Not part of public API


getKmlPlaces

public KmlPlace[] getKmlPlaces()
Returns:
all KML Places from all loaded KML Services

removeKmlService

public void removeKmlService()
removes all KML Services added so far


refreshTileOverlay

public void refreshTileOverlay()
refreshes map overlays contribution from http://code.google.com/p/doroga-tv-widget/source/browse/trunk/nutiteq_map_sdk_1_1_0_refresh_tile_overlay.patch


pointerDraggedDual

public void pointerDraggedDual(double dist)
Not part of public API


setDoubleClickZoomIn

public void setDoubleClickZoomIn(boolean doubleClickZoomIn)
Enable/disable zooming in when double clicking the map

Parameters:
doubleClickZoomIn - true to enable

setDualClickZoomOut

public void setDualClickZoomOut(boolean dualClickZoomOut)
Enable/disable zooming out when dual clicking (with two fingers) the map

Parameters:
dualClickZoomOut - true to enable

notifyAfterLongPress

public void notifyAfterLongPress()
Not part of public API


notifyAfterDualClick

public void notifyAfterDualClick()
Not part of public API


notifyAfterDoubleClickPress

public void notifyAfterDoubleClickPress(int x,
                                        int y)
Not part of public API


notifyAfterDoubleClickRelease

public void notifyAfterDoubleClickRelease(int x,
                                          int y)
Not part of public API


notifyAfterDoubleClick

public void notifyAfterDoubleClick()
Not part of public API


cancelLongClick

public void cancelLongClick()
Not part of public API


cancelDoubleClick

public void cancelDoubleClick()
Not part of public API


cancelDualClick

public void cancelDualClick()
Not part of public API


setOnLongClickListener

public void setOnLongClickListener(com.nutiteq.listeners.OnLongClickListener onLongClickListener)
Set long click listener

Parameters:
onLongClickListener - long click listener

setMapDragging

public void setMapDragging(boolean mapDragging)
Enable or disable map moving by dragging the pointer.

Parameters:
mapDragging - true if enabled, false if not

setOnPointerDragListener

public void setOnPointerDragListener(com.nutiteq.listeners.OnPointerDragListener onPointerDragListener)
Set pointer drag listener

Parameters:
onPointerDragListener - dragging listener

setOnPointerPressListener

public void setOnPointerPressListener(com.nutiteq.listeners.OnPointerPressListener onPointerPressListener)
Set pointer press listener

Parameters:
onPointerPressListener - press listener

setOnPointerReleaseListener

public void setOnPointerReleaseListener(com.nutiteq.listeners.OnPointerReleaseListener onPointerReleaseListener)
Set pointer release listener

Parameters:
onPointerReleaseListener - release listener