Skip to content

setMapStyle and removeOnDidFailLoadingMapListener #393

Open
@amlibtest

Description

@amlibtest

Hello,
I recently migrated an application (with angular) to nativescript 6.8.0 and updated the mapbox plugin to version 5.0.1. However, when I try to call setMapStyle function using a JSON file from my app I get the following error

Unhandled Promise rejection: loading style failed: Could not read asset ; Zone: <root> ; Task: Promise.then ; Value: loading style failed: Could not read asset undefined

Note that this code used to work correctly back in nativescript 5, so there shouldn't be any mistake from my JSON file or its path (~/maps/custom.json)

Also, when going back from a component while using Android, this error is shown on console:

Unhandled Promise rejection: Cannot read property 'removeOnDidFailLoadingMapListener' of null ; Zone: <root> ; Task: setTimeout ; Value: TypeError: Cannot read property 'removeOnDidFailLoadingMapListener' of null TypeError: Cannot read property 'removeOnDidFailLoadingMapListener' of null

I have to add that I always call destroy before leaving or pausing the component. I've seen it's the only way to avoid creating multiple maps in the previous version, besides the fact that it will make the map to get loaded again on resume instead of showing a black screen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions