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

Can we use MapService directly? #196

Open
zelanter opened this issue Sep 20, 2024 · 1 comment
Open

Can we use MapService directly? #196

zelanter opened this issue Sep 20, 2024 · 1 comment

Comments

@zelanter
Copy link

zelanter commented Sep 20, 2024

Hi,

documentation mentions MapService, and looking at MapComponent code, I understand how it uses that service internally. It's also a private property, but MapService itself is Injectable based on its code.

So I was hoping I could inject it in my components, but when I do so (I need to manually add it to providers) it's not the instance that the component is using internally for sure, so I was wondering if there is any way to "tap" into that mapService the component is using, as it doesn't seem to be exposed.

Since it's part of the API, I assumed it's meant to be used, so if that's really the case, the question remains: how?

I guess I could just manually assign the instance to it, but then I'd check if there is any added value compared to simply using the instance directly. Would the benefit be that we remain in the "Angular zone" and it's more consistent if we do map operations using it instead of the mapInstance directly?

@HarelM
Copy link
Collaborator

HarelM commented Sep 20, 2024

I'm not sure it is meant to be used, probably needs to be "internal" in the docs.
The original docs didn't have it exposed, I rewrote three docs using typedoc so I might have forgotten to mark it internal.

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

2 participants