diff --git a/src/ui-mapbox/index.android.ts b/src/ui-mapbox/index.android.ts index 2d13b43..8f2a09e 100755 --- a/src/ui-mapbox/index.android.ts +++ b/src/ui-mapbox/index.android.ts @@ -1345,13 +1345,13 @@ export class Mapbox extends MapboxCommon implements MapboxApi { if (marker.icon) { // for markers from url see UrlMarker in https://github.com/mapbox/mapbox-gl-native/issues/5370 if (marker.icon.startsWith('res://')) { - let cached = this.iconCache[marker.iconPath]; + let cached = this.iconCache[marker.icon]; if (!cached) { const resourcename = marker.icon.substring(6); const res = Utils.ad.getApplicationContext().getResources(); const identifier = res.getIdentifier(resourcename, 'drawable', Utils.ad.getApplication().getPackageName()); if (identifier !== 0) { - cached = this.iconCache[marker.iconPath] = iconFactory.fromResource(identifier); + cached = this.iconCache[marker.icon] = iconFactory.fromResource(identifier); } } if (cached) { diff --git a/src/ui-mapbox/index.ios.ts b/src/ui-mapbox/index.ios.ts index 2fb05b0..f22d7b9 100755 --- a/src/ui-mapbox/index.ios.ts +++ b/src/ui-mapbox/index.ios.ts @@ -3119,7 +3119,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi { const layer = theMap.style.layerWithIdentifier(name); - resolve(new Layer(layer)); + resolve(layer ? new Layer(layer) : null); } catch (ex) { if (Trace.isEnabled()) { CLog(CLogTypes.info, 'Error in mapbox.getLayer: ' + ex);