hi all,
i have a problem with mapview. in old version mapview work well, but in SDK 1.0 mapview not work.
Now with SDk 1.0 mapview not show,not toggle for satellite, it's only blank screen.
my code same Marchu's code
Using java Syntax Highlighting
package com.google.android.example;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
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.graphics.Point;
public class BasicMap extends MapActivity {
private MapView myMapView;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
myMapView = new MapView(this, "key?");
// Lets start at the Statue of Liberty
// I grabbed the data from Google-Maps
GeoPoint p = new GeoPoint((int) (40.689213 * 1000000),
(int) (-74.044558 * 1000000));
// Get the controller, that is used for translation and zooming
MapController mc = myMapView.getController();
// Translate to the Statue of Liberty
mc.animateTo(p);
// Zoom Very close
mc.setZoom(21);
// Make myMapView the exilicit view of this app
setContentView(myMapView);
// Enable Sattelite-Mode, so we will se the
// Statue of liberty instantly on the screen
myMapView.setSatellite(true);
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_I) {
// Zooming In
myMapView.getController().zoomIn();
return true;
} else if (keyCode == KeyEvent.KEYCODE_O) {
// Zooming Out
myMapView.getController().zoomOut();
return true;
} else if (keyCode == KeyEvent.KEYCODE_S) {
// Switch to satellite view
myMapView.setSatellite(true);;
return true;
} else if (keyCode == KeyEvent.KEYCODE_T) {
// Switch on traffic overlays
myMapView.setTraffic(true);
return true;
}
return false;
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
Parsed in 0.038 seconds, using
GeSHi 1.0.8.4
my Manifest.xml
Using xml Syntax Highlighting
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.example"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<activity android:name=".BasicMap"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Parsed in 0.003 seconds, using
GeSHi 1.0.8.4
what wrong here?please help me.
thanks a lot.