Basic KML Format
KML is a file format used for rendering geographical data. It uses a tag-based structure with nested elements and attributes. KML is based on the XML standard, and all tags of a KML file are case-sensitive.
Currently, the SfMaps control supports the following KML elements:
- Place mark
- Point
- LinearRing
- Polygon
- MultiGeometry
- Region
- Style
- StyleMap
- BalloonStyle
- LineStyle
- PolyStyle
- IconStyle
- ExtendedData
1.1.1 KML Shapes Rendered in ShapeFileLayer
A KML file can be rendered with the help of the ShapeFileLayer in SfMap. The KML file should be added as an Embedded Resource to the application project. The URI of the KML file must be given in the following order:
- Namespace of project
- Folder names
- KmlFileName.kml
<syncfusion:SfMap>
<syncfusion:SfMap.Layers>
<syncfusion:ShapeFileLayer
Uri="KmlImportDemo_WinRT.Assets.KmlFiles.Eu.kml">
</syncfusion:ShapeFileLayer>
</syncfusion:SfMap.Layers>
</syncfusion:SfMap>
KML Shapes Rendered in ShapeFileLayer
1.1.2 KML Shapes Rendered in SubShapeFileLayer
<syncfusion:SfMap>
<syncfusion:SfMap.Layers>
<syncfusion:ShapeFileLayer Uri="KmlImportDemo_WinRT.Assets.ShapeFiles.World.shp">
<syncfusion:ShapeFileLayer.SubShapeFileLayers>
<syncfusion:SubShapeFileLayer Uri="KmlImportDemo_WinRT.Assets.KmlFiles.Eu.kml"/>
</syncfusion:ShapeFileLayer.SubShapeFileLayers>
</syncfusion:ShapeFileLayer>
</syncfusion:SfMap.Layers>
</syncfusion:SfMap>
KML Shapes Rendered in SubShapeFileLayer
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page