com.radiusnetworks.navigationkit
Class MapView

java.lang.Object
  extended by WebView
      extended by com.radiusnetworks.navigationkit.MapView
All Implemented Interfaces:
NavigationKitLocationNotifier

public class MapView
extends WebView
implements NavigationKitLocationNotifier

The MapView displays a pre-configured map with full Navigation Kit utilities automatically. It uses WebView to display a map with location awareness provided through detecting beacons that have been configured on navigationkit.radiusnetworks.com.

The user location will be displayed using a blue dot that is placed upon the map. This dot's location on the map will correspond with the location of the closest beacon that has been detected. You must configure your beacons and place them into their respective positions to get an accurate representation of the map when navigating through the real-life version of it.

Below is an example of code to use this feature:



 NavigationKitManager mNavigationKitManager = NavigationKitManager.getInstanceForApplication(this);

 //setting up connection to Radius's built-in MapView class
 MapView mMapView = new MapView(this);

 //connecting MapView to UI
 ((FrameLayout)this.findViewById(R.id.webview_layout)).addView(mMapView);
 mMapView.loadMap(mNavigationKitManager.findMap("V1"));

 

See Also:
MapViewNotifier

Field Summary
static boolean isAttachedToWindow
           
 
Constructor Summary
MapView(Context c)
           
 
Method Summary
 void didUpdateMapConfig()
          Invoked when maps and map configurations have been updated from the server.
 void didUpdateMapLocation(MapLocation location)
          Invoked when a new map location is available.
 MapLocation getCurrentLocationMapCoordinate()
           
static boolean isWaitingForMapLoad()
           
 void loadMap(MapConfig mapConfig)
          Loads the given map into the view.
protected  void notifyTapped(double x, double y)
           
 void onAttachedToWindow()
           
 void onDetachedFromWindow()
           
 void onWindowFocusChanged(boolean hasWindowFocus)
           
 void setMapViewNotifier(MapViewNotifier notifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isAttachedToWindow

public static boolean isAttachedToWindow
Constructor Detail

MapView

public MapView(Context c)
Parameters:
c - Activity's Context (NOT Application Context)
Method Detail

loadMap

public void loadMap(MapConfig mapConfig)
Loads the given map into the view.

Parameters:
mapConfig -

setMapViewNotifier

public void setMapViewNotifier(MapViewNotifier notifier)

isWaitingForMapLoad

public static boolean isWaitingForMapLoad()

onAttachedToWindow

public void onAttachedToWindow()

onDetachedFromWindow

public void onDetachedFromWindow()

onWindowFocusChanged

public void onWindowFocusChanged(boolean hasWindowFocus)

didUpdateMapLocation

public void didUpdateMapLocation(MapLocation location)
Description copied from interface: NavigationKitLocationNotifier
Invoked when a new map location is available.

Specified by:
didUpdateMapLocation in interface NavigationKitLocationNotifier
Parameters:
location - is a MapLocation object representing the current location

didUpdateMapConfig

public void didUpdateMapConfig()
Description copied from interface: NavigationKitLocationNotifier
Invoked when maps and map configurations have been updated from the server.

Specified by:
didUpdateMapConfig in interface NavigationKitLocationNotifier

notifyTapped

protected void notifyTapped(double x,
                            double y)

getCurrentLocationMapCoordinate

public MapLocation getCurrentLocationMapCoordinate()