android-maps-compose icon indicating copy to clipboard operation
android-maps-compose copied to clipboard

Prevent Maps Compose elements from being used outside of MapApplier's scope

Open kozaxinan opened this issue 2 years ago • 4 comments

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.

kozaxinan avatar Feb 14 '22 09:02 kozaxinan

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.

arriolac avatar Feb 14 '22 17:02 arriolac

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.

kozaxinan avatar Feb 14 '22 18:02 kozaxinan

Done in #130. It'll be part of the next Maps Compose release

arriolac avatar Jun 06 '22 17:06 arriolac

:tada: This issue has been resolved in version 2.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

googlemaps-bot avatar Jun 07 '22 13:06 googlemaps-bot

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!

stale[bot] avatar Nov 02 '22 04:11 stale[bot]