Skip to content

Commit 10eeee5

Browse files
authored
Merge pull request #77 from seros00/master
Update index.android.ts - Fixes #32 Same icon for all markers added
2 parents f343a3a + 2f8b68e commit 10eeee5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ui-mapbox/index.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,13 +1345,13 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
13451345
if (marker.icon) {
13461346
// for markers from url see UrlMarker in https://github.com/mapbox/mapbox-gl-native/issues/5370
13471347
if (marker.icon.startsWith('res://')) {
1348-
let cached = this.iconCache[marker.iconPath];
1348+
let cached = this.iconCache[marker.icon];
13491349
if (!cached) {
13501350
const resourcename = marker.icon.substring(6);
13511351
const res = Utils.ad.getApplicationContext().getResources();
13521352
const identifier = res.getIdentifier(resourcename, 'drawable', Utils.ad.getApplication().getPackageName());
13531353
if (identifier !== 0) {
1354-
cached = this.iconCache[marker.iconPath] = iconFactory.fromResource(identifier);
1354+
cached = this.iconCache[marker.icon] = iconFactory.fromResource(identifier);
13551355
}
13561356
}
13571357
if (cached) {

src/ui-mapbox/index.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2810,7 +2810,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
28102810

28112811
const layer = theMap.style.layerWithIdentifier(name);
28122812

2813-
resolve(new Layer(layer));
2813+
resolve(layer ? new Layer(layer) : null);
28142814
} catch (ex) {
28152815
if (Trace.isEnabled()) {
28162816
CLog(CLogTypes.info, 'Error in mapbox.getLayer: ' + ex);

0 commit comments

Comments
 (0)