2015-08-08 218 views
2

我已經使用osmdroid創建了一個簡單的項目。我想在地圖上顯示一個specefic點。 我在項目中使用下列庫:osmdroid:資源未找到:marker_default.png

1. osmdroid-android-4.3.jar 
2. slf4j-android-1.5.8.jar 

這裏是我的代碼:

@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 

    final MapView map = (MapView) findViewById(R.id.map); 

    anotherOverlayItemArray = new ArrayList<OverlayItem>(); 

    anotherOverlayItemArray.add(new OverlayItem(
      "US", "US", new GeoPoint(38.883333, -77.016667))); 

    ItemizedIconOverlay<OverlayItem> anotherItemizedIconOverlay = new ItemizedIconOverlay<OverlayItem>(
      this, anotherOverlayItemArray, null); 
    map.getOverlays().add(anotherItemizedIconOverlay); 
    } 

我收到以下錯誤:

08-09 00:27:24.123: E/AndroidRuntime(4844): Caused by: java.lang.IllegalArgumentException: Resource not found: marker_default.png 08-09 00:27:24.123: E/AndroidRuntime(4844): at org.osmdroid.DefaultResourceProxyImpl.getBitmap(DefaultResourceProxyImpl.java:114)

我要去哪裏錯了?

回答

0

補充一點:

mMapView.setTileSource(new XYTileSource("MapQuest", 
    ResourceProxy.string.mapquest_osm, 13, 19, 256, ".jpg", new String[]{ 
      "http://otile1.mqcdn.com/tiles/1.0.0/map/", 
      "http://otile2.mqcdn.com/tiles/1.0.0/map/", 
      "http://otile3.mqcdn.com/tiles/1.0.0/map/", 
      "http://otile4.mqcdn.com/tiles/1.0.0/map/"})); 

13是最小縮放

19是我發現我的問題最大變焦

+0

感謝您的回覆 –