<?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: Click on symbols to show a small text field in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/click-on-symbols-to-show-a-small-text-field/m-p/1293447#M49</link>
    <description>&lt;P&gt;A switched from GraphicsOveray to a FeatureCollectionLayer to display features as proposed here: &lt;A href="https://community.esri.com/t5/kotlin-maps-sdk-questions/create-empty-featurelayer-and-fill-manually-with/m-p/1292984/thread-id/45#M47" target="_blank"&gt;https://community.esri.com/t5/kotlin-maps-sdk-questions/create-empty-featurelayer-and-fill-manually-with/m-p/1292984/thread-id/45#M47&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Now, I try to follow this tutorial on making features clickable: &lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/blob/main/kotlin/feature-layer-selection/src/main/java/com/esri/arcgisruntime/sample/featurelayerselection/MainActivity.kt" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-android/blob/main/kotlin/feature-layer-selection/src/main/java/com/esri/arcgisruntime/sample/featurelayerselection/MainActivity.kt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, a FeatureCollectionLayer has no attributes to get or set selected features. Or am I looking at the wrong object?&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2023 13:35:50 GMT</pubDate>
    <dc:creator>padmalcom</dc:creator>
    <dc:date>2023-05-26T13:35:50Z</dc:date>
    <item>
      <title>Click on symbols to show a small text field</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/click-on-symbols-to-show-a-small-text-field/m-p/1292986#M46</link>
      <description>&lt;P&gt;We draw several graphics in a GraphicsOverlay. We want our users to touch these graphics and show a small hint, some kind of ballon. But there does not seem to be something like a touch event. Maybe a popup is the right object for such a ballon but to be honest: I don't know what it is, since it is not documented.&lt;/P&gt;&lt;P&gt;Can you help me out here?&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 12:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/click-on-symbols-to-show-a-small-text-field/m-p/1292986#M46</guid>
      <dc:creator>padmalcom</dc:creator>
      <dc:date>2023-05-25T12:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Click on symbols to show a small text field</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/click-on-symbols-to-show-a-small-text-field/m-p/1293447#M49</link>
      <description>&lt;P&gt;A switched from GraphicsOveray to a FeatureCollectionLayer to display features as proposed here: &lt;A href="https://community.esri.com/t5/kotlin-maps-sdk-questions/create-empty-featurelayer-and-fill-manually-with/m-p/1292984/thread-id/45#M47" target="_blank"&gt;https://community.esri.com/t5/kotlin-maps-sdk-questions/create-empty-featurelayer-and-fill-manually-with/m-p/1292984/thread-id/45#M47&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Now, I try to follow this tutorial on making features clickable: &lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/blob/main/kotlin/feature-layer-selection/src/main/java/com/esri/arcgisruntime/sample/featurelayerselection/MainActivity.kt" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-android/blob/main/kotlin/feature-layer-selection/src/main/java/com/esri/arcgisruntime/sample/featurelayerselection/MainActivity.kt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, a FeatureCollectionLayer has no attributes to get or set selected features. Or am I looking at the wrong object?&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 13:35:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/click-on-symbols-to-show-a-small-text-field/m-p/1293447#M49</guid>
      <dc:creator>padmalcom</dc:creator>
      <dc:date>2023-05-26T13:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Click on symbols to show a small text field</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/click-on-symbols-to-show-a-small-text-field/m-p/1295550#M60</link>
      <description>&lt;P&gt;You will need to retrieve the list of feature layers as part of the `FeatureCollectionLayer`:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;featureCollectionLayer.layers&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can get the selected features using the same function used in the Select features in feature layer sample: &lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/tree/main/kotlin/feature-layer-selection" target="_blank" rel="noopener"&gt;v100.15 sample&lt;/A&gt;,&lt;A href="https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/tree/main/select-features-in-feature-layer" target="_blank" rel="noopener"&gt; v200.0 sample&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;val featureCollectionLayer: FeatureCollectionLayer =
    FeatureCollectionLayer(featureCollection)
featureCollectionLayer.layers.collect { featureLayerList -&amp;gt;
    featureLayerList.forEach { featureLayer -&amp;gt;
        // function used in "Select features in feature layer" sample
        getSelectedFeatureLayer(screenCoordinate, featureLayer)
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a snippet of the function from the ArcGIS Maps SDK Kotlin sample (v200.0):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;/**
 * Displays the number of features selected on the given [screenCoordinate]
 */
private suspend fun getSelectedFeatureLayer(
    screenCoordinate: ScreenCoordinate,
    featureLayer: FeatureLayer
) {
    // clear the previous selection
    featureLayer.clearSelection()
    // set a tolerance for accuracy of returned selections from point tapped
    val tolerance = 25.0
    // create a IdentifyLayerResult using the screen coordinate
    val identifyLayerResult = mapView.identifyLayer(
        layer = featureLayer,
        screenCoordinate = screenCoordinate,
        tolerance = tolerance,
        returnPopupsOnly = false,
        maximumResults = -1
    )
    // handle the result's onSuccess and onFailure
    identifyLayerResult.apply {
        onSuccess { identifyLayerResult -&amp;gt;
            // get the elements in the selection that are features
            val features = identifyLayerResult.geoElements.filterIsInstance&amp;lt;Feature&amp;gt;()
            // add the features to the current feature layer selection
            featureLayer.selectFeatures(features)
            Snackbar.make(mapView, "${features.size} features selected", Snackbar.LENGTH_SHORT).show()
        }
        onFailure {
            val errorMessage = "Select feature failed: " + it.message
            Log.e(localClassName, errorMessage)
            Snackbar.make(mapView, errorMessage, Snackbar.LENGTH_SHORT).show()
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully you find this code snippet helpful for your use case!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Here's a related question regarding the popup component for v200.0:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1289050#M38" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/kotlin-maps-sdk-questions/how-to-show-popup-view-in-kotlin-maps-sdk/m-p/1289050#M38&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Currently, you can create a popup graphic by adding text to a graphic and adding it to the graphics overlay at the tapped location to emulate the popup behavior.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Visit the sample,&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/tree/main/render-multilayer-symbols" target="_blank"&gt;Render multilayer symbols&lt;/A&gt; to checkout how to work with multilayer symbols to add graphics with text and a fill symbol.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Visit the sample,&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/tree/main/style-graphics-with-renderer" target="_blank"&gt;Style graphics with renderer&lt;/A&gt; to checkout how to style graphics to custom shapes/geometries to create your own popup symbol shape.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 22:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/click-on-symbols-to-show-a-small-text-field/m-p/1295550#M60</guid>
      <dc:creator>Shubham_Sharma</dc:creator>
      <dc:date>2023-06-02T22:45:58Z</dc:date>
    </item>
  </channel>
</rss>

