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

Expose the MapsIndoors Instance so it can be used from the outside #366

Merged
merged 18 commits into from
Jul 4, 2024

Conversation

andreeaceachir142
Copy link
Contributor

What

  • Expose the MapsIndoors Instance so it can be used from the outside

How

  • Refactor the Map.jsx component to be using the useImperativeHandle
  • Return the mapsIndoorsInstance
  • Use the ref to assign the mapsIndoorsInstance to the window so it can be accessible from the outside

@andreeaceachir142
Copy link
Contributor Author

Ready for re-review @ammapspeople

@ammapspeople
Copy link
Contributor

I get this error when running as React app:

image

@ammapspeople
Copy link
Contributor

And I get somewhat same error when running the test app for the built React component:

image

@andreeaceachir142
Copy link
Contributor Author

Oops, missed a check 👀 Pushing the fix now @ammapspeople

@ammapspeople
Copy link
Contributor

Oops, missed a check 👀 Pushing the fix now @ammapspeople

How do I get the instance when using the built React component? 🤔

@andreeaceachir142
Copy link
Contributor Author

@ammapspeople updated the implementation to expose the MapsIndoors Instance on the window instead.

Copy link
Contributor

@ammapspeople ammapspeople left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider how we could document it in the code, and not just on the docs site.

@andreeaceachir142
Copy link
Contributor Author

Hmm, I could add a section to the README file, do you think that would be sufficient? @ammapspeople

@ammapspeople
Copy link
Contributor

Hmm, I could add a section to the README file, do you think that would be sufficient? @ammapspeople

@andreeaceachir142 That might work!

@andreeaceachir142
Copy link
Contributor Author

Updated README files @ammapspeople

packages/map-template/README.md Outdated Show resolved Hide resolved
packages/map-template/.github/README.md Outdated Show resolved Hide resolved
Co-authored-by: Anders Mogensen <am@mapspeople.com>
Copy link
Contributor

@ammapspeople ammapspeople left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@andreeaceachir142
Copy link
Contributor Author

@ammapspeople The docs on GitBook has been updated with the new example for polygonFillColor as well. ✅

@andreeaceachir142 andreeaceachir142 merged commit dba0001 into main Jul 4, 2024
@andreeaceachir142 andreeaceachir142 deleted the feature/mapsindoors-instance branch July 4, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants