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

How to check if a source or a layer already exists #180

Closed
mariusvn opened this issue Dec 20, 2022 · 6 comments
Closed

How to check if a source or a layer already exists #180

mariusvn opened this issue Dec 20, 2022 · 6 comments

Comments

@mariusvn
Copy link
Contributor

How to check if a source or a layer already exists.

I might need to do a pull request

@mariusvn
Copy link
Contributor Author

Also, when we add a source that already exists, the error is in the library but not in the app using it

@BartoszStasiurka
Copy link
Contributor

I always register source /layer even if there is an empty dataset and I don't care if it is already registered.

@mariusvn
Copy link
Contributor Author

Would be nice if there was a way to get the liste of current layers on the map

@GaelleJoubert
Copy link
Contributor

I personnally get layers with the function :
await mapController.getLayerIds() ;

But I would really apreciate a way to get the sources like that.
Because if I try to add a source with the same name, it crashes the app.

@mariusvn
Copy link
Contributor Author

Oh i wasn't aware of this method, thanks for the tip.
I'll work a bit today on the lib, i'll check if i can add it

@mariusvn
Copy link
Contributor Author

mariusvn commented Feb 17, 2023

@GaelleJoubert resolved in PR #197
I added the getSourceIds

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

3 participants