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

Globe.gl with Angular ? #138

Closed
ClementVaugoyeau opened this issue Nov 29, 2022 · 3 comments
Closed

Globe.gl with Angular ? #138

ClementVaugoyeau opened this issue Nov 29, 2022 · 3 comments

Comments

@ClementVaugoyeau
Copy link

Describe the bug
Hello, I try to use Globe.gl in an Angular component, but I have problem with the DOM render of angular I think. In a classic htlm JavaScript file, the function Globe() is rendered well, but I can't convert this function to a renderable element in Angular. Sorry it's not really a bug, is anyone succeed to import globe.gl with Angular 14 maybe there is a same problem in React ? And thank you for this great library.

Expected behavior
The Globe() function is render in the htlm element.

Desktop (please complete the following information):

  • OS: [Windows]
  • Browser: [Firefox]
  • Version: [e.g. 22]
@dunlavy
Copy link

dunlavy commented Mar 1, 2023

You can either write a custom directive to manage the data layers or use a service to initialize GlobeGL the typical way.

I'm using imports, too, and not a CDN.

image

It works - don't expect that because you're in Angular there aren't ways to use it:

image

@dunlavy
Copy link

dunlavy commented Mar 1, 2023

But I will say I'm having unexpected behavior in #148. Furthermore, with imports you could have trouble with build optimizers but for my project we do not engage them (we're not really worried about transit).

@ClementVaugoyeau
Copy link
Author

Thank you for your response,
I managed a way around it, but your solution is a lot cleaner than mine, aha.

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