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 GeometryEditor().start(withType: Geometry.Type) but I can't seem to find a way to get a Geometry.Type from anything.
The issue here is that we can't get the type from anything to start a new geometry editing session.
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?
Solved! Go to Solution.
It's a good question. The answer is to use the Swift metatype. That looks like this:
`Point.self`, `Polyline.self`, `Polygon.self`, etc:
geometryEditor.start(withType: Polyline.self)
We have a very nice sample that shows how to work with the GeometryEditor. Please take a look at it as well for more information. Try cloning the samples repo, build and use the samples app, and dig into the code.
Also, note that a related question was answered here.
It's a good question. The answer is to use the Swift metatype. That looks like this:
`Point.self`, `Polyline.self`, `Polygon.self`, etc:
geometryEditor.start(withType: Polyline.self)
We have a very nice sample that shows how to work with the GeometryEditor. Please take a look at it as well for more information. Try cloning the samples repo, build and use the samples app, and dig into the code.
Also, note that a related question was answered here.