File tree Expand file tree Collapse file tree
lib-compose/src/main/java/com/what3words/components/compose/maps Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1475,19 +1475,21 @@ class W3WMapManager(
14751475 listName : String = LIST_DEFAULT_ID ,
14761476 zoomOption : W3WZoomOption = W3WZoomOption .CENTER_AND_ZOOM ,
14771477 ): List <W3WResult <W3WMarker >> = withContext(dispatcher) {
1478- val results = inputs.map { input ->
1478+ val conversionResults = inputs.map { input ->
14791479 async {
1480- // Convert and add marker
1481- when (val result = convertFunction(input)) {
1482- is W3WResult .Success -> {
1483- val marker = result.value.toW3WMarker(markerColor)
1484- markersMap.addMarker(listName = listName, marker = marker)
1485- }
1480+ convertFunction(input)
1481+ }
1482+ }.awaitAll()
14861483
1487- is W3WResult .Failure -> W3WResult .Failure (result.error, result.message)
1484+ val results = conversionResults.map { result ->
1485+ when (result) {
1486+ is W3WResult .Success -> {
1487+ val marker = result.value.toW3WMarker(markerColor)
1488+ markersMap.addMarker(listName = listName, marker = marker)
14881489 }
1490+ is W3WResult .Failure -> W3WResult .Failure (result.error, result.message)
14891491 }
1490- }.awaitAll()
1492+ }
14911493
14921494 // Update the map state
14931495 _mapState .update { currentState ->
You can’t perform that action at this time.
0 commit comments