samcragg / sharpkml

SharpKML is an implementation of the Open Geospatial Consortium (OGC) KML 2.2 standard developed in C#, able to read/write both KML files and KMZ files.
MIT License
158 stars 51 forks source link

Adding SimpleData Fields? #40

Open avreiche opened 3 years ago

avreiche commented 3 years ago

I'm trying to use sharpkml to add simple data forms to my kml doc.

The setup for the kml Schema and SimpleField name:

<Schema name="MySchema" id="MS01">
    <SimpleField type="string" name="Property">
               <displayName>&lt;b&gt;Property&lt;/b&gt;</displayName>
        </SimpleField>
        <SimpleField type="string" name="State">
               <displayName>&lt;b&gt;State&lt;/b&gt;</displayName>
        </SimpleField>
</Schema>

The reference for it under the placemark:

<ExtendedData>
      <SchemaData schemaUrl="#MS01">
          <SimpleData name="Property">Building 1</SimpleData>
              <SimpleData name="State">AZ</SimpleData>
      </SchemaData>
</ExtendedData>

Any tips on how I could achieve this? Love the tool so far, everything has been incredibly helpful!