I am trying to make MapView zoom to the current location based on GeoPoint. I set the location using the geo fix command in telnet. My problem is that when I first enter a place using geo fix, my code will move correctly to the location on the map. If I try to install another location using geo fix, it will not be updated. Here is the code to update:
public void updateLocation(Location loc) { p = new GeoPoint((int)(loc.getLongitude() * 1E6),(int)(loc.getLatitude() * 1E6)); mc = mapView.getController(); mc.animateTo(p); }
and here is my code to call the update:
LocationListener onLocationChange=new LocationListener() { public void onLocationChanged(Location location) { updateLocation(location); }
etc...
I have the following in onResume ():
super.onResume(); myLocationManager.requestLocationUpdates("gps", 0, 200, onLocationChange);
The points I'm trying to set geo are far enough apart to meet the minimum distance requirements. Anyone have any ideas on what I am missing?
source share