C1Maps Control Basics > Vector Layer > KML Import/Export |
KML is an XML-based language for geographic visualization and annotation that was originally created for Google Earth. For more information, see https://developers.google.com/kml/documentation.
KML import is performed by KmlReader class that has static methods that create collection of vector objects from the supplied KML source (string or stream). The collection can be easily added to the C1VectorLayer. The DataContext of the imported object is set to the corresponding XElement from the KML source so you can use the original element to perform custom operation during import.
Import limitations:
KML export is performed by KmlWriter class, which has static methods that write the collection of vector objects to the provided stream in KML format.
The KmlWriter.Write() method has parameter saveElementCallback that allows you to perform custom operations during export. The method is called for each element that is saved in KML stream. For example, using the callback method you can add KML custom data to the elements.
Export limitation: