私がここで見つけた地図の例をしようとしています http://codemagician.wordpress.com/2010/05/06/android-google-mapview-tutorial-done-right/
問題はこのコードです。具体的には、コンパイラはMapViewが何であるかを知らないようです。実際、android.graphics.drawable.Drawableにも適用されます。importステートメントでそれを解決できると思いましたが、他のセットアップ手順が欠落している必要があります。
助けていただければ幸いです。
package com.example.HelloGoogleMaps2;
import java.util.List;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
public class MainMap extends MapActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
**MapView** mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
List<Overlay> mapOverlays = mapView.getOverlays();
**Drawable** drawable = this.getResources().getDrawable(R.drawable.icon);
HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this);
GeoPoint point = new GeoPoint(30443769,-91158458);
OverlayItem overlayitem = new OverlayItem(point, "Laissez les bon temps rouler!", "I'm in Louisiana!");
GeoPoint point2 = new GeoPoint(17385812,78480667);
OverlayItem overlayitem2 = new OverlayItem(point2, "Namashkaar!", "I'm in Hyderabad, India!");
itemizedoverlay.addOverlay(overlayitem);
itemizedoverlay.addOverlay(overlayitem2);
mapOverlays.add(itemizedoverlay);
}
@Override
protected boolean isRouteDisplayed()
{
return false;
}
}