Android Open Source - qshuttle_driver Overlay Map Location






From Project

Back to project page qshuttle_driver.

License

The source code is released under:

MIT License

If you think the Android project qshuttle_driver listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * /*from ww  w.  j  a  v a  2 s  .c  o  m*/
 */
package com.qshuttle.car;

import android.content.Context;
import android.graphics.Canvas;
import android.location.Location;
import android.location.LocationListener;

import com.amap.mapapi.core.GeoPoint;
import com.amap.mapapi.map.MapView;
import com.amap.mapapi.map.MyLocationOverlay;

/**
 * @author wangpeifeng
 *
 */
public class OverlayMapLocation extends MyLocationOverlay {
  
  /*
   * fields
   */
  
  private Context context;

  private MapView mapView;
  
  private LocationListener listener = null;
  
  
  /**
   * @param arg0
   * @param arg1
   */
  public OverlayMapLocation(Context context, MapView mapView) {
    super(context, mapView);
    // TODO Auto-generated constructor stub
    
    this.context = context;
    
    this.mapView = mapView;
    
  }


  /* (non-Javadoc)
   * @see com.amap.mapapi.map.MyLocationOverlay#onLocationChanged(android.location.Location)
   */
  @Override
  public void onLocationChanged(Location location) {
    // TODO Auto-generated method stub
    super.onLocationChanged(location);
    
    if(this.listener != null){
      
      listener.onLocationChanged(location);
      
    }
  }
  
  
  /*
   * 
   */
  
  /* (non-Javadoc)
   * @see com.amap.mapapi.map.MyLocationOverlay#drawMyLocation(android.graphics.Canvas, com.amap.mapapi.map.MapView, android.location.Location, com.amap.mapapi.core.GeoPoint, long)
   */
  @Override
  protected void drawMyLocation(Canvas canvas, MapView mapview, Location location,
      GeoPoint point, long arg4) {
    // TODO Auto-generated method stub
//    super.drawMyLocation(canvas, mapview, location, point, arg4);
  }


  public void registerLocationListener(LocationListener listener){
    
    this.listener = listener;
    
  }
  
  /*
   * 
   */
  
  public void removeLocationListener(Location listener){
    
    if(this.listener.equals(listener)){
      
      this.listener = null;
      
    }
    
  }
  
  
  

}




Java Source Code List

com.qshuttle.car.ActivityAddress.java
com.qshuttle.car.ActivityInfoRequest.java
com.qshuttle.car.ActivityMain.java
com.qshuttle.car.ActivityOfflineMap.java
com.qshuttle.car.DataOperator.java
com.qshuttle.car.DataProvider.java
com.qshuttle.car.DatabaseHelper.java
com.qshuttle.car.ExpandableListAdapter.java
com.qshuttle.car.GPSLocationOverlay.java
com.qshuttle.car.HostSettingActivity.java
com.qshuttle.car.ListAdapterAddress.java
com.qshuttle.car.ListAdapter.java
com.qshuttle.car.LongPressPopupOverlay.java
com.qshuttle.car.MapGestureDetectorOverlay.java
com.qshuttle.car.OverlayMapLocation.java
com.qshuttle.car.PassengerScheduleOverlay.java
com.qshuttle.car.PrefProxy.java
com.qshuttle.car.ThreadHttpPost.java
com.qshuttle.car.ThreadTimer.java
com.qshuttle.car.TimerCallBack.java
com.qshuttle.car.Timer.java
com.qshuttle.car.Utilities.java
com.qshuttle.car.WebApi.java