Babak Mahmoudabadi
Babak Mahmoudabadi

Reputation: 455

osmdroid :Resource not found: marker_default.png

I have created a simple project using osmdroid. I want to show a specefic point on the map. I am using the following libraries in the project:

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

Here is my code:

@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);
   }

I am getting the following error:

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)

Where am I going wrong?

Upvotes: 2

Views: 339

Answers (2)

Babak Mahmoudabadi
Babak Mahmoudabadi

Reputation: 455

I've found my problem, it was incorrect JAR file adding reference. https://github.com/osmdroid/osmdroid/issues/145

Upvotes: 1

Gianluca Demarinis
Gianluca Demarinis

Reputation: 2191

Add this:

    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 is the minimum zoom

19 is the maximum zoom

Upvotes: 0

Related Questions