<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to show popup view in Kotlin Maps SDK in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1289989#M39</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/683593"&gt;@YuDong&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;There is no support for a PopupView with the ArcGIS Maps SDK for Kotlin at 200.1.0. We are working on a new toolkit for this SDK, and we are aiming to also provide support for showing popups in one of the upcoming releases.&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 08:04:25 GMT</pubDate>
    <dc:creator>GuntherHeppner</dc:creator>
    <dc:date>2023-05-17T08:04:25Z</dc:date>
    <item>
      <title>How to show popup view in Kotlin Maps SDK</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1289050#M38</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't find solution to show popups in mapview of Kotlin Maps SDK 200.1.0.&lt;/P&gt;&lt;P&gt;I notice that there is a popup view of toolkit in Android SDK 100.x and Swift Maps SDK 200.x, but not exist in Kotlin Maps SDK 200.x.&lt;/P&gt;&lt;P&gt;Is there some easy way to show popups or callout now?&lt;/P&gt;&lt;P&gt;Thanks for you help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 08:34:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1289050#M38</guid>
      <dc:creator>YuDong</dc:creator>
      <dc:date>2023-05-15T08:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to show popup view in Kotlin Maps SDK</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1289989#M39</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/683593"&gt;@YuDong&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;There is no support for a PopupView with the ArcGIS Maps SDK for Kotlin at 200.1.0. We are working on a new toolkit for this SDK, and we are aiming to also provide support for showing popups in one of the upcoming releases.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 08:04:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1289989#M39</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2023-05-17T08:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to show popup view in Kotlin Maps SDK</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1290513#M40</link>
      <description>&lt;P&gt;Very Thanks for that.&amp;nbsp;&lt;EM&gt;full of expectation.&lt;span class="lia-unicode-emoji" title=":two_hearts:"&gt;💕&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 01:27:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1290513#M40</guid>
      <dc:creator>YuDong</dc:creator>
      <dc:date>2023-05-18T01:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to show popup view in Kotlin Maps SDK</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1296791#M68</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46685"&gt;@GuntherHeppner&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I was wondering is there is any update on showing callout feature?&lt;/P&gt;&lt;P&gt;I've just started migrating to Kotlin SDK but there is no mapView.callout for me to access.&lt;/P&gt;&lt;P&gt;Any suggestion or replacement solutions I can use for the purpose?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 17:11:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1296791#M68</guid>
      <dc:creator>khitk_abadata</dc:creator>
      <dc:date>2023-06-07T17:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to show popup view in Kotlin Maps SDK</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1297011#M69</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/691357"&gt;@khitk_abadata&lt;/a&gt;&amp;nbsp;I can confirm that&amp;nbsp;&lt;SPAN&gt;mapView.callout will be supported in the next release of the ArcGIS Maps SDK for Kotlin, release 200.2.0. &lt;/SPAN&gt;&lt;SPAN&gt;I want to point out that Callout is different from&amp;nbsp;PopupView, which the initial question in this post referred to. We will not have support for PopupView in the 200.2.0 release.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:30:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1297011#M69</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2023-06-08T07:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to show popup view in Kotlin Maps SDK</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1416257#M407</link>
      <description>&lt;P&gt;I was able to display popups in a bottom sheet.&amp;nbsp; The &lt;A href="https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/blob/6008ed17ec1e357fbc6f80b80b46452afd401163/display-clusters/src/main/java/com/esri/arcgismaps/sample/displayclusters/components/MapViewModel.kt#L150" target="_self"&gt;display clusters sample&lt;/A&gt;&amp;nbsp;pointed me in the right direction.&amp;nbsp; Here is a sample of my code, note that it does not account for of every type of popup, just the ones I need for my app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my mapViewModel, on single tap I am calling identifyLayers.&amp;nbsp; Then looping through the popups of the results and calling evaluateExpressions(), which will run any Arcade expressions that you have in your popups.&amp;nbsp; Then store the evaluatedElements to a list of PopupElements and the title to a string.&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;    private val _popupTitle = MutableStateFlow("")
    private val _popupElements = MutableStateFlow&amp;lt;List&amp;lt;PopupElement&amp;gt;&amp;gt;(emptyList())

    suspend fun onSingleTap(screenCoordinate: ScreenCoordinate) {
        mapViewProxy.identifyLayers(
            screenCoordinate = screenCoordinate,
            tolerance = 100.dp,
            returnPopupsOnly = true
        ).onSuccess { results -&amp;gt;
            results.forEach { result -&amp;gt;
                result.popups.forEach { popup -&amp;gt;
                    _popupTitle.value = popup.title
                    popup.evaluateExpressions().onSuccess {
                        _popupElements.value = popup.evaluatedElements
                    }
                }
            }
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then displaying the elements in a Column.&amp;nbsp; If its a FieldsPopupElement, I'm displaying the label and formattedValues in a Row for each field.&amp;nbsp; If its a MediaPopupElement and the PopupMediaType is Image, then I am displaying an AsyncImage.&amp;nbsp; I'm still not fully sure the best way to show TextPopupElements, since it can be HTML (the display clusters sample handles it a differently).&amp;nbsp; I haven't found a good way to handle links yet.&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val popupTitle by mapViewModel.popupTitle.collectAsState()
val popupElements by mapViewModel.popupElements.collectAsState()

Column (modifier = Modifier
        .fillMaxSize()
        .padding(it)
        .padding(start = 30.dp, end = 30.dp)) {
        Text(popupTitle,
            style = MaterialTheme.typography.titleLarge
        )
        LazyColumn {
            items(popupElements) {expression -&amp;gt;
                if (element is FieldsPopupElement) {
                    element.labels.forEachIndexed { index, label -&amp;gt;
                        Row (modifier = Modifier
                            .padding(10.dp)
                            .fillMaxWidth(),
                            horizontalArrangement = Arrangement.SpaceBetween
                        ) {
                            Text(text = label, modifier = Modifier.weight(1f))
                            Text(text = element.formattedValues.get(index), modifier = Modifier.weight(1f))
                        }
                    }
                }
                if (element is MediaPopupElement) {
                    element.media.forEach { media -&amp;gt;
                        if (media.type == PopupMediaType.Image) {
                            AsyncImage(model = media.value?.sourceUrl, contentDescription = media.title)
                        }
                    }
                }
                if (element is TextPopupElement) {
                    AndroidView(
                        factory = { context -&amp;gt;
                            MaterialTextView(context).apply {
                                // links
                                autoLinkMask = Linkify.WEB_URLS
                                linksClickable = true
                            }
                        },
                        update = { a -&amp;gt; a.text = HtmlCompat.fromHtml(expression.text, HtmlCompat.FROM_HTML_MODE_COMPACT) }
                    )
                }
            }
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 18:20:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1416257#M407</guid>
      <dc:creator>Justin_Greco</dc:creator>
      <dc:date>2024-04-27T18:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to show popup view in Kotlin Maps SDK</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1417783#M410</link>
      <description>&lt;P&gt;This looks good. Also looks like you are on the right track to display&amp;nbsp;&lt;SPAN&gt;TextPopupElements using AndroidView. We are currently working on a `PopupView` component which will show the various properties of different popup element types out of the box. It should be out as a toolkit component in our next release.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 20:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1417783#M410</guid>
      <dc:creator>PuneetPrakash</dc:creator>
      <dc:date>2024-05-01T20:50:38Z</dc:date>
    </item>
  </channel>
</rss>

