
Ergebnis 1 bis 1 von 1
-
- 16.12.2011, 15:57
- #1
Hallo Community,
hoffe ihr könnt mir weiterhelfen.
Ich plane eine App mit einer MapView.
Soweit klappt alles, doch ein paar Probleme/Fragen bestehen noch:
Ich kann weder die Map auf dem Smartphone verschieben noch pinch-to-zoom anwenden.
Auch klappen bei mir die Setfunktionen (SetCenter und AnimateTo) des MapControllers nicht.
Suchergebnisse bei Google haben bis jetzt leider nur folgendes gebracht:
Es gab in 2.1 einen Bug mit dem Zoom. setZoom musste vorher aufgerufen werden und dann sollte es gehen. Leider funktioniert auch das nicht.
Mein aktueller Code sieht folgendermaßen aus:
Code:package -******-; 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.content.Context; import android.graphics.drawable.Drawable; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.location.LocationProvider; import android.os.Bundle; import android.widget.Toast; public class MAIN extends MapActivity { MapController MC; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MapView MV = (MapView) findViewById(R.id.MAP); //MV.setBuiltInZoomControls(true); MC = MV.getController(); MC.setZoom(5); MC.setCenter(new GeoPoint(**, **)); MC.animateTo(new GeoPoint(**, **)); /* LocationManager LM = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); LocationListener LL = new LocationListener() { public void onLocationChanged(Location arg0) { MC.setCenter(new GeoPoint((int)arg0.getLatitude()*10^6,(int)arg0.getLongitude()*10^6)); Toast.makeText(getBaseContext(),"lat: " + arg0.getLatitude() + "\nlon: " + arg0.getLongitude(), Toast.LENGTH_LONG).show(); } public void onProviderDisabled(String arg0) { // TODO Auto-generated method stub } public void onProviderEnabled(String arg0) { // TODO Auto-generated method stub } public void onStatusChanged(String arg0, int arg1, Bundle arg2) { // TODO Auto-generated method stub }}; LM.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, LL); //Location l = LM.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);//lastknownposition */ } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } }
Ähnliche Themen
-
diverse Probleme/Fragen
Von James Blond im Forum HTC 7 MozartAntworten: 0Letzter Beitrag: 02.02.2011, 23:35 -
Fragen und Probleme
Von htcxlegend im Forum HTC LegendAntworten: 0Letzter Beitrag: 08.01.2011, 09:20 -
Fragen / Probleme / Hilfe
Von SigiDaMasta im Forum Windows Phone 7 AllgemeinAntworten: 1Letzter Beitrag: 26.11.2010, 11:40 -
4 Probleme/Fragen
Von XKontohackerX im Forum HTC S710Antworten: 2Letzter Beitrag: 26.01.2010, 18:37 -
2 Probleme/Fragen
Von Mauly im Forum HTC HD2 KommunikationAntworten: 1Letzter Beitrag: 22.12.2009, 15:21
Pixel 10 Serie mit Problemen:...