Does KML Placemark support storing custom data? I tried using KmlPlacemark.Attributes[], but it didn't seem to have any effect. What am I doing wrong?
// Create a new KML document.
_kmlDocument = new KmlDocument() { Name = "Vehicle Path" };
// Create a KML dataset using the KML document.
_kmlDataset = new KmlDataset(_kmlDocument);
// Create the KML layer using the KML dataset.
_kmlLayer = new KmlLayer(_kmlDataset);
// Create a KmlGeometry
KmlGeometry kmlGeometry = new KmlGeometry(location, KmlAltitudeMode.Absolute);
// Create a new placemark.
KmlPlacemark kmlPlacemark = new KmlPlacemark(kmlGeometry);
// Add a Attribute
kmlPlacemark.Attributes["speed"] = VehicleSpeed;
// Add the placemark to the KmlDocument.
_kmlDocument?.ChildNodes.Add(kmlPlacemark);
// Save a file
_kmlDocument?.SaveAsAsync("test.kmz");
Solved! Go to Solution.
We're actively working on this, and editing custom data is planned to be available in the next release.
In the current 200.5 release you can access the custom data (read-only) in KmlNode.ExtendedSchemaData and KmlNode.ExtendedNonSchemaData
We're actively working on this, and editing custom data is planned to be available in the next release.
In the current 200.5 release you can access the custom data (read-only) in KmlNode.ExtendedSchemaData and KmlNode.ExtendedNonSchemaData