googlemaps / android-maps-compose

Jetpack Compose composables for the Maps SDK for Android
https://developers.google.com/maps/documentation/android-sdk/maps-compose
Apache License 2.0
1.16k stars 142 forks source link

fix: update set() to update() for a ComposeNode (map objects) #547

Closed el-qq closed 6 months ago

el-qq commented 7 months ago

Is your feature request related to a problem? Please describe. For map objects (e.g., Circle()), parameters are created both in factory and in the update block


    ComposeNode<CircleNode, MapApplier>(
        factory = {
            val circle = mapApplier?.map?.addCircle {
                center(center)
                 //...
            } ?: error("Error adding circle")
            circle.tag = tag
            CircleNode(circle, onClick)
        },
        update = {
            update(onClick) { this.onCircleClick = it }

            set(center) { this.circle.center = it }

In addition, update() is recommended. From the description: For example, use [update} when value is passed into the class constructor parameters.

Describe the solution you'd like


//....
        update = {
            update(onClick) { this.onCircleClick = it }

            update(center) { this.circle.center = it }
bubenheimer commented 7 months ago

I'd call this a bug, not a feature request. Affected code uses the wrong operator, causing slower performance on initial composition.

googlemaps-bot commented 6 months ago

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

The release is available on:

Your semantic-release bot :package::rocket:

googlemaps-bot commented 6 months ago

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

The release is available on:

Your semantic-release bot :package::rocket: