Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setMapStyle and removeOnDidFailLoadingMapListener #393

Open
amlibtest opened this issue Oct 27, 2020 · 0 comments
Open

setMapStyle and removeOnDidFailLoadingMapListener #393

amlibtest opened this issue Oct 27, 2020 · 0 comments

Comments

@amlibtest
Copy link

amlibtest commented Oct 27, 2020

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

@amlibtest amlibtest changed the title setMapStyle not working with custom JSON files setMapStyle and removeOnDidFailLoadingMapListener Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant