Skip to content

GeoJson breaks marker listener #530

Description

@alfroid2k

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ...")
    Maps compose
  2. OS type and version
    Any version
  3. Library version and other environment information
    4.3.3

Steps to reproduce

When loading a geoJson layer the click listeners for the MarkerComposable stops working

Code example

                    GoogleMap(
                        modifier = Modifier.fillMaxSize(),
                        cameraPositionState = cameraPositionState
                    ) {
                        val context = LocalContext.current
                        MarkerComposable(state = MarkerState(position = LatLng(1.35, 103.87)), onClick = {
                            Toast.makeText(context, "marker clicked!!", Toast.LENGTH_SHORT).show()
                            true
                        }) {
                            Box(modifier = Modifier
                                .size(32.dp)
                                .background(color = Color.Blue))
                        }
                        MapEffect(key1 = "12313", block = { map ->

                            val layer = GeoJsonLayer(map, R.raw.anyjson, context)


                            layer.setOnFeatureClickListener { feature ->
                                Toast.makeText(context, "Map layer feature clicked", Toast.LENGTH_SHORT)
                            }

                            layer.addLayerToMap()
                        })
                    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions