We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edcf001 commit b1d978bCopy full SHA for b1d978b
src/ui-carto/ui/index.android.ts
@@ -300,11 +300,15 @@ export class CartoMap<T = DefaultLatLonKeys> extends CartoViewBase {
300
if (this.mapView) {
301
const native: com.carto.layers.TileLayer = layer.getNative();
302
if (!!native) {
303
- const layers = this.mapView.getLayers();
304
- if (index !== undefined && index < layers.count()) {
305
- layers.insert(index, native);
306
- } else {
307
- layers.add(native);
+ try {
+ const layers = this.mapView.getLayers();
+ if (index !== undefined && index < layers.count()) {
+ layers.insert(index, native);
+ } else {
308
+ layers.add(native);
309
+ }
310
+ } catch (error) {
311
+ console.error(error)
312
}
313
314
0 commit comments