Skip to content
Permalink
Browse files

#1223 should resolve this issue

  • Loading branch information...
spyhunter99 committed Jun 1, 2019
1 parent b6ea341 commit 3b94ae3c7e8d367a8e8defa27ab9995982bc6ca6
Showing with 13 additions and 1 deletion.
  1. +13 −1 osmdroid-android/src/main/java/org/osmdroid/views/MapViewRepository.java
@@ -1,5 +1,6 @@
package org.osmdroid.views;

import android.content.Context;
import android.graphics.drawable.Drawable;

import org.osmdroid.library.R;
@@ -69,9 +70,20 @@ public BasicInfoWindow getDefaultPolygonInfoWindow() {
return mDefaultPolygonInfoWindow;
}

/**
* note: it's possible for this to return null during certain lifecycle events. Such as
* invoke this method after {@link #onDetach()} has been called
* @return
*/
public Drawable getDefaultMarkerIcon() {
if (mDefaultMarkerIcon == null) {
mDefaultMarkerIcon = mMapView.getContext().getResources().getDrawable(R.drawable.marker_default);
if (mMapView!=null) {
Context context = mMapView.getContext();
if (context!=null) {
mDefaultMarkerIcon = context.getResources().getDrawable(R.drawable.marker_default);
}
}

}
return mDefaultMarkerIcon;
}

0 comments on commit 3b94ae3

Please sign in to comment.
You can’t perform that action at this time.