<?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 GeometryEditor().start(withType: Geometry.Type) isn't working as expected in Swift Maps SDK Questions</title>
    <link>https://community.esri.com/t5/swift-maps-sdk-questions/geometryeditor-start-withtype-geometry-type-isn-t/m-p/1287226#M69</link>
    <description>&lt;P&gt;In the beta version of the SDK we used: GeometryEditor().start(creationMode: .polyline) which did work as expected, pretty easy to use and now after release we have&amp;nbsp;GeometryEditor().start(withType: Geometry.Type) but I can't seem to find a way to get a Geometry.Type from anything.&lt;/P&gt;&lt;P&gt;The issue here is that we can't get the type from anything to start a new geometry editing session.&lt;/P&gt;&lt;P&gt;I have tried: Polyline, Polyline.Type, .polyline and more but not getting me anywhere, what should I use as Geometry.Type? And what is the best practice to create a new Geometry while letting the user edit the geometry?&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 13:41:30 GMT</pubDate>
    <dc:creator>Torgeir</dc:creator>
    <dc:date>2023-05-09T13:41:30Z</dc:date>
    <item>
      <title>GeometryEditor().start(withType: Geometry.Type) isn't working as expected</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/geometryeditor-start-withtype-geometry-type-isn-t/m-p/1287226#M69</link>
      <description>&lt;P&gt;In the beta version of the SDK we used: GeometryEditor().start(creationMode: .polyline) which did work as expected, pretty easy to use and now after release we have&amp;nbsp;GeometryEditor().start(withType: Geometry.Type) but I can't seem to find a way to get a Geometry.Type from anything.&lt;/P&gt;&lt;P&gt;The issue here is that we can't get the type from anything to start a new geometry editing session.&lt;/P&gt;&lt;P&gt;I have tried: Polyline, Polyline.Type, .polyline and more but not getting me anywhere, what should I use as Geometry.Type? And what is the best practice to create a new Geometry while letting the user edit the geometry?&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 13:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/geometryeditor-start-withtype-geometry-type-isn-t/m-p/1287226#M69</guid>
      <dc:creator>Torgeir</dc:creator>
      <dc:date>2023-05-09T13:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEditor().start(withType: Geometry.Type) isn't working as expected</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/geometryeditor-start-withtype-geometry-type-isn-t/m-p/1287249#M70</link>
      <description>&lt;P&gt;It's a good question. The answer is to use the &lt;A href="https://docs.swift.org/swift-book/documentation/the-swift-programming-language/types/#Metatype-Type" target="_self"&gt;Swift metatype&lt;/A&gt;. &amp;nbsp;That looks like this:&lt;/P&gt;&lt;P&gt;`Point.self`, `Polyline.self`, `Polygon.self`, etc:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;geometryEditor.start(withType: Polyline.self)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a &lt;A href="https://github.com/Esri/arcgis-maps-sdk-swift-samples/tree/main/Shared/Samples/Sketch%20on%20map" target="_self"&gt;very nice sample&lt;/A&gt; that shows &lt;A href="https://github.com/Esri/arcgis-maps-sdk-swift-samples/blob/main/Shared/Samples/Sketch%20on%20map/SketchOnMapView.swift#L68" target="_self"&gt;how to work with the GeometryEditor&lt;/A&gt;. Please take a look at it as well for more information. &amp;nbsp;Try cloning the &lt;A href="https://github.com/Esri/arcgis-maps-sdk-swift-samples" target="_self"&gt;samples repo,&lt;/A&gt;&amp;nbsp;build and use the samples app, and dig into the code.&lt;/P&gt;&lt;P&gt;Also, note that a related question was answered &lt;A href="https://community.esri.com/t5/swift-maps-sdk-questions/what-happened-to-the-geometrytype-enum-in-200-0/m-p/1275951/highlight/true#M52" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 15:13:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/geometryeditor-start-withtype-geometry-type-isn-t/m-p/1287249#M70</guid>
      <dc:creator>rolson_esri</dc:creator>
      <dc:date>2023-05-09T15:13:10Z</dc:date>
    </item>
  </channel>
</rss>

