<?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: Graphics not shown on map when adding feature reduction to graphic overlay in Swift Maps SDK Questions</title>
    <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1510021#M337</link>
    <description>&lt;P&gt;Do you have a target date for that release?&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2024 13:44:27 GMT</pubDate>
    <dc:creator>JacobCurrier</dc:creator>
    <dc:date>2024-07-25T13:44:27Z</dc:date>
    <item>
      <title>Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1488547#M299</link>
      <description>&lt;P&gt;I'm currently migrating from 100.15.x to 200.4 and am having trouble with clustering graphics. I have a dynamic graphic overlay using a unique value renderer that has 1 field name, entirely comprised of graphics with point geometry. I've tried to create a ClusteringFeatureReduction with a simple renderer and simple marker symbol to add to the overlay but after adding it all of the graphics no longer appear. I've tried tweaking radius, maxSymbolSize, minSymbolSize, maxScale, but nothing seems to have an effect. I believe I've gone through all of the feature reduction for graphic overlays documentation and&amp;nbsp;(feature layer clustering) samples but can't seem to get it to work. Is there anything else that I need to consider? Help will be greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 22:04:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1488547#M299</guid>
      <dc:creator>JacobCurrier</dc:creator>
      <dc:date>2024-06-10T22:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1488572#M300</link>
      <description>&lt;P&gt;Hi Jacob, thanks for reporting this issue. I'll check with our team to see if this is a bug.&lt;BR /&gt;Meanwhile, can you try adding the&amp;nbsp;&lt;SPAN&gt;ClusteringFeatureReduction after the map is loaded, to see if it helps?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Below is a code snippet for testing purposes.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;import SwiftUI
import ArcGIS

struct ContentView: View {
    @State private var map: Map = {
        let map = Map(basemapStyle: .arcGISLightGray)
        map.initialViewpoint = Viewpoint(
            center: Point(x: -117.17, y: 34.17, spatialReference: .wgs84),
            scale: 1e5
        )
        return map
    }()
    
    @State private var graphicsOverlay: GraphicsOverlay = {
        let overlay = GraphicsOverlay()
        overlay.renderingMode = .dynamic
        return overlay
    }()
    
    var body: some View {
        MapView(map: map, graphicsOverlays: [graphicsOverlay])
            .task {
                try? await map.load()
                setupGraphicsOverlay()
                addPointsToOverlay()
            }
    }
    
    private func setupGraphicsOverlay() {
        // Create a unique value renderer
        let symbol = SimpleMarkerSymbol(
            style: .circle,
            color: .blue,
            size: 10
        )
        let uniqueValueRenderer = UniqueValueRenderer(
            fieldNames: ["type"],
            uniqueValues: [
                UniqueValue(
                    description: "Point",
                    label: "Point",
                    symbol: symbol,
                    values: ["Point"]
                )
            ]
        )
        graphicsOverlay.renderer = uniqueValueRenderer
        
        // Set up clustering feature reduction.
        let clusterSymbol = SimpleMarkerSymbol(
            style: .circle,
            color: .red,
            size: 10
        )
        let clusterRenderer = SimpleRenderer(symbol: clusterSymbol)
        let clusteringFeatureReduction = ClusteringFeatureReduction(renderer: clusterRenderer)
        graphicsOverlay.featureReduction = clusteringFeatureReduction
    }
    
    private func addPointsToOverlay() {
        // Coordinates for points near Redlands, CA
        let coordinates = [
            Point(x: -117.17, y: 34.15, spatialReference: .wgs84),
            Point(x: -117.18, y: 34.16, spatialReference: .wgs84),
            Point(x: -117.19, y: 34.17, spatialReference: .wgs84),
            Point(x: -117.20, y: 34.18, spatialReference: .wgs84),
            Point(x: -117.21, y: 34.19, spatialReference: .wgs84),
            Point(x: -117.22, y: 34.20, spatialReference: .wgs84)
        ]
        
        // Add points to the graphics overlay
        for coordinate in coordinates {
            let graphic = Graphic(geometry: coordinate, attributes: ["type": "Point"])
            graphicsOverlay.addGraphic(graphic)
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 10 Jun 2024 23:32:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1488572#M300</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2024-06-10T23:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1489060#M301</link>
      <description>&lt;P&gt;Hello, thank you for the reply. I tried with the above code and I'm still experiencing the same issue. I messed around with this quite a bit today and the only way I was able to get it to work consistently was if I suspended the task for a split second prior to loading the map.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;.task() {
                try? await Task.sleep(nanoseconds: 200_000_000)
                try? await map.load()
                setupGraphicsOverlay()
                addPointsToOverlay()
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 18:53:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1489060#M301</guid>
      <dc:creator>JacobCurrier</dc:creator>
      <dc:date>2024-06-11T18:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1489428#M302</link>
      <description>&lt;P&gt;I've logged an internal issue, sounds like a timing bug &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; . Will keep you posted on the progress…&lt;/P&gt;&lt;P&gt;Thanks for reporting it again!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 20:42:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1489428#M302</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2024-06-11T20:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1506255#M320</link>
      <description>&lt;P&gt;An update: it is still a bug that we are trying to solve - we added more reproducible cases to the internal ticket.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 18:15:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1506255#M320</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2024-07-17T18:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1509527#M334</link>
      <description>&lt;P&gt;Another update - this issue will be fixed in the upcoming 200.6.0 release.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 19:05:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1509527#M334</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2024-07-24T19:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1510021#M337</link>
      <description>&lt;P&gt;Do you have a target date for that release?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 13:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1510021#M337</guid>
      <dc:creator>JacobCurrier</dc:creator>
      <dc:date>2024-07-25T13:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Graphics not shown on map when adding feature reduction to graphic overlay</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1510166#M339</link>
      <description>&lt;P&gt;Towards the end of November and early December.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 17:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/graphics-not-shown-on-map-when-adding-feature/m-p/1510166#M339</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2024-07-25T17:23:26Z</dc:date>
    </item>
  </channel>
</rss>

