|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.microedition.lcdui.Item
javax.microedition.lcdui.CustomItem
com.nutiteq.MapItem
public class MapItem
A high level wrapper around MapComponent, to be used inside Forms.
| Field Summary |
|---|
| Fields inherited from class javax.microedition.lcdui.Item |
|---|
BUTTON, HYPERLINK, LAYOUT_2, LAYOUT_BOTTOM, LAYOUT_CENTER, LAYOUT_DEFAULT, LAYOUT_EXPAND, LAYOUT_LEFT, LAYOUT_NEWLINE_AFTER, LAYOUT_NEWLINE_BEFORE, LAYOUT_RIGHT, LAYOUT_SHRINK, LAYOUT_TOP, LAYOUT_VCENTER, LAYOUT_VEXPAND, LAYOUT_VSHRINK, PLAIN |
| Constructor Summary | |
|---|---|
MapItem(java.lang.String label,
java.lang.String licenseKey,
javax.microedition.midlet.MIDlet midlet,
int width,
int height,
WgsPoint startPoint,
int zoom)
Constructor for map component wrapper, that can be used in high level UI components. |
|
MapItem(java.lang.String label,
java.lang.String licenseKey,
java.lang.String vendor,
java.lang.String appname,
int width,
int height,
WgsPoint startPoint,
int zoom)
Constructor for map component wrapper, that can be used in high level UI components. |
|
| Method Summary | |
|---|---|
void |
addKmlService(KmlService service)
Add KML layer to the map Usage example: mapItem.addKmlService(new KmlUrlReader("http://www.panoramio.com/panoramio.kml? |
void |
addLine(Line line)
Add single line to map |
void |
addLines(Line[] lines)
Add multiple lines to map |
void |
addOnMapElements(OnMapElement[] elements)
Add elements to be displayed on map |
void |
addPlace(Place place)
Add Place to map |
void |
addPlaces(Place[] places)
Add many places to map |
void |
addPolygon(Polygon polygon)
|
void |
addPolygons(Polygon[] polygons)
|
void |
defineControlKey(int keyCode,
int keyValue)
Define Control Keys codes for map manipulation. |
void |
enableDownloadCounter()
Enable network traffic counter using default implementation ( NutiteqDownloadCounter). |
void |
enableDownloadDisplay()
Enable network traffic overlay using default implementation for painting ( NutiteqDownloadDisplay). |
void |
enqueueDownload(ResourceRequestor downloadable,
int cacheLevel)
Enqueue new download task to be executed by library. |
PlaceInfo |
getAdditionalInfo(Place place)
Get additional info for internally handled (retrieved from kml service) objects. |
WgsBoundingBox |
getBoundingBox()
Get Bounding Box of current map view |
DownloadCounter |
getDownloadCounter()
|
KmlService[] |
getKmlServices()
List currently added KML Services |
java.lang.String |
getLibraryLog()
Get internal log for library. |
GeoMap |
getMap()
Retrieve currently used map. |
WgsPoint |
getMiddlePoint()
Get current center point of map |
int |
getZoom()
Get the current zoom level. |
ZoomRange |
getZoomRange()
get max and min zoom of current map (typically 0...18) |
void |
mapClicked(WgsPoint p)
Event for clicking on map (used in MapListener) |
void |
mapMoved()
Event for moving of map (used in MapListener) |
void |
needRepaint(boolean mapIsComplete)
Event if map needs repainting (used in MapListener) |
void |
removeKmlService(KmlService service)
Remove previously added kml service |
void |
removeLine(Line line)
Remove previously added line |
void |
removeLines(Line[] lines)
Remove multiple lines |
void |
removeLocationSource()
Remove used location source |
void |
removeOnMapElements(OnMapElement[] elements)
Remove given elements from map display |
void |
removePlace(Place place)
Remove Place from map |
void |
removePlaces(Place[] places)
remove several places from map |
void |
removePolygon(Polygon polygon)
|
void |
removePolygons(Polygon[] polygons)
|
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)
Replace the default cursor. |
void |
setDownloadCounter(DownloadCounter downloadCounter)
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)
Set download stream opener, that creates connections to downloaded resources |
void |
setErrorListener(ErrorListener eL)
Set listener for component error events (connection errors, license errors, parsing errors etc |
void |
setFileSystem(FileSystem fs)
|
void |
setLocationSource(LocationSource marker)
Set location source with GPS marker to be displayed on map |
void |
setMap(GeoMap newMap)
Change base map |
void |
setMapListener(MapListener mL)
Set map listener for receiving callback events from library. |
void |
setMiddlePoint(double lon,
double lat,
int zoom)
Set Center point of map |
void |
setMiddlePoint(WgsPoint wgs,
int zoom)
Set middle point of map |
void |
setNetworkCache(Cache cache)
Set cache for networking. |
void |
setOnMapElementListener(OnMapElementListener listener)
|
void |
setOnScreenZoomControls(OnScreenZoomControls controls)
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 |
setPlaceListener(PlaceListener pL)
Set Place listener to receive place "mouseover" and selection events |
void |
setZoom(int newZoom)
Set map zoom without changing position. |
void |
setZoomLevelIndicator(ZoomIndicator zoomIndicator)
Set zoom indicator to be painted on display |
void |
setTileSearchStrategy(GeoMap[] tileSearchStrategy)
Set search strategy for map tile. |
void |
showZoomLevelIndicator(boolean showInicator)
Show map zoom scale after zoom action. |
void |
startMapping()
Initialize needed resources for mapping and start internal threads. |
void |
stopMapping()
Stop threads started by MapComponent. |
void |
zoomIn()
Zoom in map 1 step |
void |
zoomOut()
Zoom out map 1 step |
| Methods inherited from class javax.microedition.lcdui.CustomItem |
|---|
getGameAction |
| Methods inherited from class javax.microedition.lcdui.Item |
|---|
addCommand, getLabel, getLayout, getMinimumHeight, getMinimumWidth, getPreferredHeight, getPreferredWidth, notifyStateChanged, removeCommand, setDefaultCommand, setItemCommandListener, setLabel, setLayout, setPreferredSize |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapItem(java.lang.String label,
java.lang.String licenseKey,
javax.microedition.midlet.MIDlet midlet,
int width,
int height,
WgsPoint startPoint,
int zoom)
label - name for the item, can be nulllicenseKey - license key issued by Nutiteq LLCmidlet - MIDlet instance for the applicationwidth - component preferred width.height - component preferred height.startPoint - initial middle point on map (in WGS84)zoom - initial zoom level for display
public MapItem(java.lang.String label,
java.lang.String licenseKey,
java.lang.String vendor,
java.lang.String appname,
int width,
int height,
WgsPoint startPoint,
int zoom)
label - name for the item, can be nulllicenseKey - license key issued by Nutiteq LLCvendor - vendor name for license checkappname - application name for license checkwidth - component preferred width.height - component preferred height.startPoint - initial middle point on map (in WGS84)zoom - initial zoom level for display| Method Detail |
|---|
public void startMapping()
public void defineControlKey(int keyCode,
int keyValue)
mapItem.defineControlKey(ControlKeys.SELECT_KEY, -5);
keyCode - map component key code, see
ControlKeyskeyValue - device key code, for some can use Canvas constants like
Canvas.KEY_NUM2public void setControlKeysHandler(ControlKeysHandler keysHandler)
keysHandler - new keys mapping handlerpublic void zoomIn()
public void zoomOut()
public void setMapListener(MapListener mL)
mL - Listener class reference, e.g. thispublic void setPlaceListener(PlaceListener pL)
pL - Listener class reference, e.g. thispublic void setErrorListener(ErrorListener eL)
eL - Listener class reference, e.g. this
public void setMiddlePoint(WgsPoint wgs,
int zoom)
wgs - a WgsPoint objectzoom - zoom level, 0 - world to max zoom (17 typically)
public void setMiddlePoint(double lon,
double lat,
int zoom)
lon - longitude, in WGS84 decimal degreeslat - latitude, in WGS84 decimal degreeszoom - zoom level, 0 - world to max zoom (17 typically)public WgsPoint getMiddlePoint()
public void mapClicked(WgsPoint p)
mapClicked in interface MapListenerp - point clicked in WGS84public void mapMoved()
mapMoved in interface MapListenerpublic void needRepaint(boolean mapIsComplete)
needRepaint in interface MapListenermapIsComplete - is current map view complete (if FALSE, then some map tiles are
not yet downloaded)public void addPlace(Place place)
place - a Place objectpublic void addOnMapElements(OnMapElement[] elements)
elements - elements to be added for displaypublic void addPlaces(Place[] places)
places - array of Place objectspublic void removePlace(Place place)
place - the Place object to be removedpublic void removePlaces(Place[] places)
places - array of Place objectspublic void addLine(Line line)
line - a Line objectpublic void addLines(Line[] lines)
lines - array of Line objectLine.Line(WgsPoint[] points, com.nutiteq.components.LineStyle style)public void removeLine(Line line)
line - line to be removedpublic void removeLines(Line[] lines)
lines - lines to be removedpublic void setOnScreenZoomControls(OnScreenZoomControls controls)
controls - zoom controls to be usedpublic void showZoomLevelIndicator(boolean showInicator)
showInicator - should the zoom indicator be shownpublic WgsBoundingBox getBoundingBox()
public void setBoundingBox(WgsBoundingBox bBox)
bBox - are to be displayed (in WGS84 coordinates)public ZoomRange getZoomRange()
public void setZoom(int newZoom)
newZoom - new zoom levelpublic int getZoom()
public void addKmlService(KmlService service)
mapItem.addKmlService(new KmlUrlReader("http://www.panoramio.com/panoramio.kml?LANG=en_US.utf8",true));
service - Reference to KML Service, can be own implementation or use
KmlUrlReaderKmlUrlReader.KmlUrlReader(String, boolean)public KmlService[] getKmlServices()
public void removeKmlService(KmlService service)
service - service to be removedpublic void stopMapping()
public void setMap(GeoMap newMap)
newMap - reference to the map objectCloudMade.CloudMade(String, int, int)public GeoMap getMap()
public PlaceInfo getAdditionalInfo(Place place)
place - place associated with internal data
public void setCursor(Cursor newCursor)
newCursor - cursor implementationpublic void removeOnMapElements(OnMapElement[] elements)
elements - elements to be removedpublic java.lang.String getLibraryLog()
public void setDownloadStreamOpener(DownloadStreamOpener opener)
opener - opener to be used for resources readingpublic void setPanningStrategy(PanningStrategy panningStrategy)
ThreadDrivenPanning
panningStrategy - new panning strategypublic void setTileSearchStrategy(GeoMap[] tileSearchStrategy)
tileSearchStrategy - search strategy to be usedpublic void setLocationSource(LocationSource marker)
marker - source to be usedpublic void removeLocationSource()
public void setNetworkCache(Cache cache)
cache - public void addPolygon(Polygon polygon)
public void addPolygons(Polygon[] polygons)
public void removePolygon(Polygon polygon)
public void removePolygons(Polygon[] polygons)
public void enqueueDownload(ResourceRequestor downloadable,
int cacheLevel)
downloadable - resource to be downloadedcacheLevel - at which cache levels should response be cachedpublic void setZoomLevelIndicator(ZoomIndicator zoomIndicator)
zoomIndicator - zoom indicator to usepublic void enableDownloadCounter()
NutiteqDownloadCounter).
public void setDownloadCounter(DownloadCounter downloadCounter)
downloadCounter - implementation usedpublic DownloadCounter getDownloadCounter()
public void enableDownloadDisplay()
NutiteqDownloadDisplay).
public void setDownloadDisplay(DownloadDisplay display)
display - display used for info showpublic void setFileSystem(FileSystem fs)
public void setOnMapElementListener(OnMapElementListener listener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||