Hi Group,
Having just delved into the Android Maps stuff, and have run into
something I can't figure out yet. I have set up a basic mapping
application, and it works fine. EXCEPT--I cannot pan using the
trackball. Panning works fine using the touch screen, and I have
overridden the ontrackballevent to see if the events are being fired,
and they are. (This is all on an G1 dev phone, flashed to current
software, and a target of Google API v1.5 in Eclipse (im using the
ADT).
Is there some magic to getting the trackball to pan?
code posted below:
package com.nbt.android.cbibs;
import android.os.Bundle;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.view.KeyEvent;
import android.view.MotionEvent;
public class NBTAndroid extends MapActivity {
private MapView myMapView;
private MapController mc;
@Override
protected boolean isRouteDisplayed() {
return false;
}
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
myMapView = new MapView(this,
"009hGQjnGAb9hRp7uEGWKQNm5bGf1bUNYkiLK4w");
GeoPoint p = new GeoPoint((int) (40.689213 * 1000000),
(int) (-74.044558 * 1000000));
// Get the controller, that is used for translation and
zooming
mc = myMapView.getController();
mc.animateTo(p);
mc.setZoom(5);
// Make myMapView the view of this app
setContentView(myMapView);
myMapView.setSatellite(true);
myMapView.setEnabled(true);
myMapView.setClickable(true);
myMapView.setBuiltInZoomControls(true);
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en