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

.htmlElementsData() and .htmlElement() causes an uncaught type error - missing definition? #52

Closed
divljikunic opened this issue Apr 18, 2022 · 2 comments

Comments

@divljikunic
Copy link

Using .htmlElementsData() and .htmlElement() causes a "Uncaught TypeError: ...is not a function"

Going to the definition in "three-globe.d.ts", nothing resembling those functions exists there. As per the docs, there are hexes, polygons, custom layers etc. but no html elements.

Steps to reproduce the behavior:

  1. initialize an instance of ThreeGlobe() and try using the .htmlElementsData() or .htmlElement()
@vasturiano
Copy link
Owner

@divljikunic thanks for reaching out.

The type definitions should be there:

three-globe/src/index.d.ts

Lines 264 to 276 in bc84922

// HTML Elements layer
htmlElementsData(): object[];
htmlElementsData(data: object[]): ChainableInstance;
htmlLat(): ObjAccessor<number>;
htmlLat(latitudeAccessor: ObjAccessor<number>): ChainableInstance;
htmlLng(): ObjAccessor<number>;
htmlLng(longitudeAccessor: ObjAccessor<number>): ChainableInstance;
htmlAltitude(): ObjAccessor<number>;
htmlAltitude(altitudeAccessor: ObjAccessor<number>): ChainableInstance;
htmlElement(): HTMLElement | string | ((d: object) => HTMLElement);
htmlElement(htmlElementAccessor: HTMLElement | string | ((d: object) => HTMLElement)): ChainableInstance;
htmlTransitionDuration(): number;
htmlTransitionDuration(durationMs: number): ChainableInstance;

Are you using a recent version of the package?

@divljikunic
Copy link
Author

I did an 'npm update' and the error is indeed gone! Thank you.
I had installed the package just recently, so it didn't occur to me this could even be an issue.

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