Construct a KML document and save it as a KMZ file.

Use case
If you need to create and save data on the fly, you can use KML to create points, lines, and polygons by sketching on the map, customizing the style, and serializing them as KML nodes in a KML Document. Once complete, you can share the KML data with others that are using a KML reading application, such as ArcGIS Earth.
How to use the sample
Tap on the sketch button in the toolbar to add a new KML. Select a type of feature and choose its color or icon. Tap on the map to sketch the KML. Tap the sketch button and tap “Save Sketch” to complete the sketch. Tap the file export button in the toolbar to export the file. Tap the sketch button and the “Clear Saved Sketches” button to clear the current KML document.
How it works
- Create an .
- Create an using the .
- Create an using the and add it to the map’s array.
- Create using .
- Project that to WGS84 using .
- Create an object using that projected .
- Create an using the .
- Add the to the .
- Set the for the .
- When finished with adding nodes to the , save the to a file using the method.
Relevant API
- GeometryEditor
- GeometryEngine
- KMLDataset
- KMLDocument
- KMLGeometry
- KMLLayer
- KMLNode
- KMLPlacemark
- KMLStyle
Tags
Keyhole, KML, KMZ, OGC