|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.nutiteq.BaseMapComponent
com.nutiteq.BasicMapComponent
public class BasicMapComponent
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
| 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 |
|---|
public static final int STYLUS_CLICK_TOLERANCE
public static final int FINGER_CLICK_TOLERANCE
public static final int ZOOM_UNKNOWN
| Constructor Detail |
|---|
public BasicMapComponent(java.lang.String licenseKey,
java.lang.String vendor,
java.lang.String appname,
int width,
int height,
WgsPoint middlePoint,
int zoom)
BasicMapComponent(String, AppContext, int, int, WgsPoint, int) instead
licenseKey - License key issued by Nutiteq LLC, get if from http://www.nutiteq.com/generate_key.htmlvendor - Vendor name used by library for license checkappname - Application name used by library for license check.width - map view widthheight - map view heightmiddlePoint - middle point at start (defined in WGS84)zoom - zoom level at start
public BasicMapComponent(java.lang.String licenseKey,
com.nutiteq.wrappers.AppContext appContext,
int width,
int height,
WgsPoint middlePoint,
int zoom)
licenseKey - License key issued by Nutiteq, get it from http://www.nutiteq.com/generate_key.htmlappContext - 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 updateheight - map view height in pixelsmiddlePoint - map middle point at start (defined in WGS84 lat/long)zoom - zoom level at start, in Google system (0-world etc)| Method Detail |
|---|
public void setImageProcessor(com.nutiteq.ui.ImageProcessor processor)
processor - specific processor. Try e.g. NightModeImageProcessor()public void startMapping()
public void resize(int width,
int height)
width - new map view widthheight - new map view heightpublic void fullScreenUpdate()
public int getWidth()
public int getHeight()
public void setMiddlePoint(double lon,
double lat,
int zoom)
lon - degrees in wgslat - degrees in wgszoom - zoom level to be displayed
public void setMiddlePoint(WgsPoint point,
int zoom)
point - coordinates in WGS84zoom - zoom level to be displayedpublic void setMiddlePoint(WgsPoint wgs)
wgs - coordinates in WGS84public void setShowOverlaysWhileZooming(boolean enabled)
enabled, - default FALSEpublic void paint(com.nutiteq.wrappers.Graphics g)
setScreenPosition(int, int)
g - graphics object provided by implementing application
public void paintAt(com.nutiteq.wrappers.Graphics g,
int paintX,
int paintY)
g - graphics object to paint onpaintX - screen position xpaintY - screen position ypublic WgsPoint getMiddlePoint()
public void setSmoothZoom(boolean enabled)
public void stopDualZoom()
public void startDualZoom(double x,
double y,
double dist)
public void zoomIn()
public void zoomOut()
public void calculateZoom(double step)
public void setMapListener(MapListener mL)
mL - class implementing MapListener interfacepublic void setOnMapElementListener(OnMapElementListener listener)
listener - public void setErrorListener(ErrorListener errorListener)
errorListener - class implementing ErrorListener interfacepublic void setOnScreenZoomControls(OnScreenZoomControls zoomControls)
zoomControls - zoom controls to be usedpublic void setScaleBar(com.nutiteq.ui.ScaleBar scaleBar)
scaleBar - scale bar to be usedpublic com.nutiteq.ui.ScaleBar getScaleBar()
public void panMap(int panX,
int panY)
panMap in interface com.nutiteq.ui.PannablepanX - number of pixels to be moved left/rightpanY - number of pixels to be moved up/downpublic void keyPressed(int keyCode)
keyCode - key code forwarded by implementing applicationpublic void keyReleased(int keyCode)
keyCode - key code forwarded by implementing applicationpublic void keyRepeated(int keyCode)
keyCode - key code forwarded by implementing application
public void pointerDragged(int x,
int y)
x - pixels draggedy - pixels dragged
public void pointerPressed(int x,
int y)
x - pointer x coordinatey - pointer y coordinate
public void calculatePointerPressed(int x,
int y)
public void pointerReleased(int x,
int y)
x - position on screeny - position on screen
public void defineControlKey(int actionCode,
int keyCode)
UserDefinedKeysMapping
actionCode - internal code for action ControlKeyskeyCode - key code value for defined keypublic void setControlKeysHandler(ControlKeysHandler keysHandler)
keysHandler - new keys mapping handlerpublic MapTile getRequiredTile()
getRequiredTile in interface com.nutiteq.maps.MapTilesRequestorpublic boolean requiresMoreTiles()
requiresMoreTiles in interface com.nutiteq.maps.MapTilesRequestorpublic MapTile[] getAllRequiredTiles()
getAllRequiredTiles in interface com.nutiteq.maps.MapTilesRequestorpublic void tileRetrieved(MapTile mt)
tileRetrieved in interface com.nutiteq.maps.MapTilesRequestormt - the tile downloadedpublic void updateTile(MapTile mapTile)
updateTile in interface com.nutiteq.maps.MapTilesRequestorpublic void repaint()
repaint in interface DisplayUpdaterpublic void removePlace(Place place)
place - place to be removedpublic void removeLine(Line line)
line - line to be removedpublic void removeLines(Line[] lines)
lines - lines to be removedpublic void removeOnMapElements(OnMapElement[] elements)
elements - elements to be removedpublic void removePlaces(Place[] places)
places - places to be removedpublic void removeAllPlaces()
public void replacePlaces(Place[] places)
places - places to be displayed on mappublic void addPlace(Place place)
place - place to be displayed on map (if visible)public void addPlaceFirst(Place place)
place - place to be displayed on map (if visible)public void addPlaces(Place[] places)
places - places to be displayed on map (if visible)
public void addPlaces(Place[] places,
boolean updateScreen)
places - places to be addedupdateScreen - should screen be updated after places have been addedpublic void addLine(Line line)
line - line to be displayedpublic void addLines(Line[] lines)
lines - lines to be displayedpublic void addPolygon(Polygon polygon)
polygon - polygon to be displayedpublic void addPolygons(Polygon[] polygons)
polygons - polygons to be addedpublic void removePolygon(Polygon polygon)
polygon - polygon to be removedpublic void removePolygons(Polygon[] polygons)
polygons - polygons to be removedpublic void addOnMapElements(OnMapElement[] elements)
elements - elements to be added for display
public void addOnMapElements(OnMapElement[] elements,
boolean updateScreen)
public WgsBoundingBox getBoundingBox()
public void setBoundingBox(WgsBoundingBox bBox)
bBox - are to be displayed (in WGS84 coordinates)public void stopMapping()
public void repaint(boolean fromTimer)
public void setLicense(com.nutiteq.license.License license)
public void setMap(GeoMap newMap)
newMap - new map to be displayedpublic ZoomRange getZoomRange()
public void addKmlService(KmlService service)
service - new service to be displayed on mappublic KmlService[] getKmlServices()
public void removeKmlService(KmlService service)
service - service to be removedpublic PlaceInfo getAdditionalInfo(Place place)
place - place associated with internal data
public KmlPlace[] getKmlPlaces(KmlService service)
service - service for which KML places are needed
public GeoMap getMap()
public java.lang.String getLibraryLog()
public void removeZoomDelay()
public MapPos getInternalMiddlePoint()
public void setSize(int w,
int h)
w - map widthh - map height
public void setScreenPosition(int x,
int y)
x - lefty - top
public void setScreenBounds(int x,
int y,
int w,
int h)
x - lefty - topw - widthh - heightsetScreenPosition(int,int),
setSize(int,int)
public void setScreenCenter(int x,
int y)
x - screen position Xy - screen position Ypublic int getScreenLeft()
public int getScreenTop()
public WgsPoint getCenterPoint()
public void setTouchClickTolerance(int pixels)
pixels - needed to be moved for map dragging
public void moveMap(double lon,
double lat)
lon - new map center in WGS84lat - new map center in WGS84public void moveMap(WgsPoint point)
point - new map center in WGS84public void setZoom(int newZoom)
newZoom - new zoom levelpublic void setCursor(Cursor newCursor)
newCursor - cursor implementationpublic int getZoom()
public MapListener getMapListener()
public OnMapElementListener getOnMapElementListener()
public ErrorListener getErrorListener()
public void setDownloadStreamOpener(DownloadStreamOpener opener)
public void zoomLevelIndicatorCheck()
public void setTileSearchStrategy(GeoMap[] searched)
searched - search strategy to be usedpublic void setPanningStrategy(PanningStrategy panningStrategy)
panningStrategy - new panning strategypublic void setLocationSource(LocationSource source)
source - source to be usedpublic void setNetworkCache(Cache cache)
cache - public MapPos getMapPosition(WgsPoint wgsLocation)
public void removeLocationSource()
public void enqueueDownload(ResourceRequestor downloadable,
int cacheLevel)
enqueueDownload in interface com.nutiteq.net.DownloadHandlerdownloadable - resource to be downloadedcacheLevel - at which cache levels should response be cachedpublic void setZoomLevelIndicator(ZoomIndicator zoomIndicator)
MapComponent.showZoomLevelIndicator(boolean).
zoomIndicator - zoom indicator to usepublic void setDownloadDisplay(DownloadDisplay display)
display - display used for info showpublic void setDownloadCounter(DownloadCounter counter)
counter - implementation usedpublic void looseFocusOnDrag(boolean looseFocus)
looseFocus - should object focus be lostpublic void loosePlaceFocus()
public void focusOnPlace(Place focusOn,
boolean centerScreen)
focusOn - place to be focused onpublic Place[] getVisiblePlaces()
public void setFileSystem(FileSystem fs)
StoredMap handling
fs - platform dependent file system to be usedpublic void setTileDatabaseSystem(TileDatabaseHelper db)
DbStoredMap handling
db - platform and format dependent database helper to be usedpublic DownloadCounter getDownloadCounter()
public void enqueue(com.nutiteq.task.Task task)
public KmlPlace[] getKmlPlaces()
public void removeKmlService()
public void refreshTileOverlay()
public void pointerDraggedDual(double dist)
public void setDoubleClickZoomIn(boolean doubleClickZoomIn)
doubleClickZoomIn - true to enablepublic void setDualClickZoomOut(boolean dualClickZoomOut)
dualClickZoomOut - true to enablepublic void notifyAfterLongPress()
public void notifyAfterDualClick()
public void notifyAfterDoubleClickPress(int x,
int y)
public void notifyAfterDoubleClickRelease(int x,
int y)
public void notifyAfterDoubleClick()
public void cancelLongClick()
public void cancelDoubleClick()
public void cancelDualClick()
public void setOnLongClickListener(com.nutiteq.listeners.OnLongClickListener onLongClickListener)
onLongClickListener - long click listenerpublic void setMapDragging(boolean mapDragging)
mapDragging - true if enabled, false if notpublic void setOnPointerDragListener(com.nutiteq.listeners.OnPointerDragListener onPointerDragListener)
onPointerDragListener - dragging listenerpublic void setOnPointerPressListener(com.nutiteq.listeners.OnPointerPressListener onPointerPressListener)
onPointerPressListener - press listenerpublic void setOnPointerReleaseListener(com.nutiteq.listeners.OnPointerReleaseListener onPointerReleaseListener)
onPointerReleaseListener - release listener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||