android-maps-compose
android-maps-compose copied to clipboard
Prevent Maps Compose elements from being used outside of MapApplier's scope
At the moment, GoogleMap composable methods are basic composable method that can be called from any composable. They dont work outside of the GoogleMap composable. It would be better to have GoogleMapScope interface like ColumnScope, RowScope. And all of GoogleMap methods could be methods of GoogleMapScope and it would be easier to find methods and prevent making mistakes.
I am waiting for the ComposableTarget annotation class to be released which will prevent invocation of Google Map elements outside of MapApplier
. My original design used this technique but ComposableTarget
is much preferable. The next compiler plugin containing this change might be able to infer the target automatically but we will need to wait until it is released.
ComposableTarget looks interesting. I hope compiler and IDE will understand in perfectly. Without any scope or heritage, currently all methods look same and it confused developer.
Done in #130. It'll be part of the next Maps Compose release
:tada: This issue has been resolved in version 2.2.1 :tada:
The release is available on:
-
v2.2.1
- GitHub release
Your semantic-release bot :package::rocket:
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!