コード例 #1
0
 /** @see com.brantapps.polaris.api.Mappable#getMyLocation() */
 @Override
 public GeoPoint getMyLocation() {
   if (myLocationOverlay.getMyLocation() == null) {
     return new GeoPoint(0, 0); // Default to [0,0].
   } else {
     return KindleGeoPointHelper.fromIGeoPointToRoverGeoPoint(myLocationOverlay.getMyLocation());
   }
 }
コード例 #2
0
  /** @see com.brantapps.polaris.api.Mappable#setMyLocationEnabled(boolean) */
  @Override
  public void setMyLocationEnabled(final boolean aEnabled) {
    if (aEnabled) {
      if (myLocationOverlay == null) {
        myLocationOverlay = new MyLocationNewOverlay(context, mapView);
        myLocationOverlay.enableFollowLocation();
        myLocationOverlay.runOnFirstFix(
            new Runnable() {

              @Override
              public void run() {
                locationFoundListener.onLocationKnown(getMyLocation());
              }
            });
        mapView.getOverlays().add(myLocationOverlay);
      }
      myLocationOverlay.enableMyLocation();
    }
    if (!aEnabled && myLocationOverlay != null) {
      myLocationOverlay.disableMyLocation();
    }
  }
コード例 #3
0
 /** @see com.brantapps.polaris.api.Mappable#isMyLocationEnabled() */
 @Override
 public boolean isMyLocationEnabled() {
   return myLocationOverlay != null && myLocationOverlay.isMyLocationEnabled();
 }