de.monarchy.guideme.map
Class MapWrapper

java.lang.Object
  extended by de.monarchy.guideme.map.MapWrapper
Direct Known Subclasses:
NutiteqWrapper

public abstract class MapWrapper
extends java.lang.Object

MapWrapper: A class to implement an api wrapping mapping component. This will be used as a controller for an underlying map view.

Author:
dstuerze

Constructor Summary
MapWrapper()
          The mapping base class MapWrapper is initialized with all internal attributes set to true.
 
Method Summary
abstract  void centerAt(GeoCoordinate g)
          Centers the map view at the given coordinate.
 void clearTouchDelegate()
          Removes the touch delegate.
abstract  GeoCoordinate getCenter()
          Returns the center position of the map.
abstract  View getView()
          Returns the map view the controller has power over.
 boolean isScrollable()
          Returns whether the related view is scrollable.
abstract  void onOrientationChanged(float[] arg)
          Callback method for when the device's orientation has changed.
abstract  void onPositionChanged(GeoCoordinate arg, POI[] arg1)
          Callback method indicating a change of the device's orientation happened.
abstract  void positionZoomControls(int x, int y)
          Sets zoom controls of the map view to the particular values.
abstract  void removeRoute()
          Convenience method for removing the route to be mapped.
 void setDrawing(boolean b)
          Sets whether the map has to be drawn.
 void setFullScreen(boolean b)
          Allows the controller to inform the view about being in fullscreen mode.
abstract  void setRoute(RoutePoint[] route)
          Callback method indicating a new route has been calculated.
 void setScrollable(boolean b)
          Indicates whether the map view should have the ability to scroll.
 void setTouchDelegate(TouchDelegate d)
          Sets the touch delegate for the map.
 void showViewDirection(boolean b)
          Sets, whether the map should give a visual indicator where the device is pointing to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapWrapper

public MapWrapper()
The mapping base class MapWrapper is initialized with all internal attributes set to true.

Method Detail

onOrientationChanged

public abstract void onOrientationChanged(float[] arg)
Callback method for when the device's orientation has changed. The orientation will be given in an array with three values as described by Android's SensorEvent.

Parameters:
arg - new orientation

onPositionChanged

public abstract void onPositionChanged(GeoCoordinate arg,
                                       POI[] arg1)
Callback method indicating a change of the device's orientation happened. With the new position, an array of POIs in a range around this location is submitted.

Parameters:
arg - new position
arg1 - POIs around that spot

setRoute

public abstract void setRoute(RoutePoint[] route)
Callback method indicating a new route has been calculated. If a routing request failed, this method's parameter will be indicating it by being null.

Parameters:
route - array with route instructions

removeRoute

public abstract void removeRoute()
Convenience method for removing the route to be mapped.


getView

public abstract View getView()
Returns the map view the controller has power over.

Returns:
map view

positionZoomControls

public abstract void positionZoomControls(int x,
                                          int y)
Sets zoom controls of the map view to the particular values. The parameters shall be constants from RelativeLayout.LayoutParams indicating the position in respect to the parent (which is the map view itself).

Parameters:
x - horizontal position
y - vertical position

setDrawing

public void setDrawing(boolean b)
Sets whether the map has to be drawn.

Parameters:
b - true, if the map view should be drawn.

showViewDirection

public void showViewDirection(boolean b)
Sets, whether the map should give a visual indicator where the device is pointing to.

Parameters:
b - true if advice is wanted

setFullScreen

public void setFullScreen(boolean b)
Allows the controller to inform the view about being in fullscreen mode.

Parameters:
b - true if map is filling the whole parent.

setScrollable

public void setScrollable(boolean b)
Indicates whether the map view should have the ability to scroll.

Parameters:
b - true if scrolling is allowed

isScrollable

public boolean isScrollable()
Returns whether the related view is scrollable.

Returns:
true if scrollable, false else

setTouchDelegate

public void setTouchDelegate(TouchDelegate d)
Sets the touch delegate for the map.

Parameters:
d - new touch delegate reacting to touches on the view

clearTouchDelegate

public void clearTouchDelegate()
Removes the touch delegate.


centerAt

public abstract void centerAt(GeoCoordinate g)
Centers the map view at the given coordinate.

Parameters:
g - position of the new center

getCenter

public abstract GeoCoordinate getCenter()
Returns the center position of the map.

Returns:
momentary center position of the view in world coordinates