Back to project page CrimeSweeper.
The source code is released under:
Apache License
If you think the Android project CrimeSweeper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.markupartist.crimesweeper; // w w w . j a va2s . com import com.google.android.maps.MyLocationOverlay; import com.google.android.maps.MapView; import android.content.Context; import android.location.Location; import java.util.List; public class PlayerLocationOverlay extends MyLocationOverlay { private CrimeLocationHitListener listener; private List<CrimeSite> mCrimeSites; public PlayerLocationOverlay(Context context, MapView mapView) { super(context, mapView); } public void setCrimeLocationHitListener(CrimeLocationHitListener listener) { this.listener = listener; } public void setCrimeSites(List<CrimeSite> crimeSites) { this.mCrimeSites = crimeSites; } @Override public void onLocationChanged(Location location) { super.onLocationChanged(location); if(listener == null || mCrimeSites == null) { return; } for(CrimeSite crimeSite : mCrimeSites) { if(crimeSite.intersectWithPlayer(location)) { listener.onCrimeLocationHit(crimeSite); } } } }