# Displaying kml file

**URL:** <https://community.thinkgeo.com/t/displaying-kml-file/10039>\
**Category:** WebForms\
**Created:** [March 24, 2021, 8:02am UTC](https://community.thinkgeo.com/t/displaying-kml-file/10039 "2021-03-24T08:02:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mouni\_M](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@Mouni\_M](https://community.thinkgeo.com/u/Mouni_M)\
**Post date:** [March 24, 2021, 8:02am UTC](https://community.thinkgeo.com/t/displaying-kml-file/10039/1 "2021-03-24T08:02:39Z")

</div>

Hi,  
I’m trying to display kml file on map but file is not displaying.  
I’ve referred this wiki site.

> **[ThinkGeo Docs](https://docs.thinkgeo.com)**
>
> Documentation for ThinkGeo

Here, I’m attaching my sample code.Please have a look.  
these are kml & supported files  
[App\_Data.zip](https://community.thinkgeo.com/uploads/short-url/fSe194DAwkqIaYDqtMHhTOC82hO.zip) (25.7 KB)  
[Zip.zip](https://community.thinkgeo.com/uploads/short-url/ducmoWx55cXJ2YFBuXa9bB0cjrC.zip) (7.9 KB)

Thanks

---

<div class="post-metadata">

**Author:** ![Frank4](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/frank4/32/25224_2.png) [@Frank4](https://community.thinkgeo.com/u/Frank4)\
**Post date:** [March 24, 2021, 4:08pm UTC](https://community.thinkgeo.com/t/displaying-kml-file/10039/2 "2021-03-24T16:08:58Z")

</div>

Thanks Mouni,  
We rebuild the kml layer in the mapsuite 12. It should be easier to load kml here is the sample code.

```
private void Window_Loaded(object sender, RoutedEventArgs e)
{

    mapView.MapUnit = GeographyUnit.DecimalDegree;

    KmlFeatureLayer layer = new KmlFeatureLayer(System.AppDomain.CurrentDomain.BaseDirectory + @"\App_Data\VMP_16_07.kml");
    string projString = System.IO.File.ReadAllText(System.AppDomain.CurrentDomain.BaseDirectory + @"\App_Data\VMP_16_07.kml.prj");
    ProjectionConverter projectionConverter = new ProjectionConverter(Projection.ConvertWktToProjString(projString), 4326);
    projectionConverter.Open();

    layer.EnableEmbeddedStyle = false;
    layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyle.CreateSimpleLineStyle(GeoColor.FromArgb(255, 169, 195, 221), 2F, GeoColors.Red, 4F, false);
    layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 233, 232, 214), GeoColor.FromArgb(255, 156, 155, 154), 1);
    layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyle.CreateSimplePointStyle(PointSymbolType.Circle, GeoColors.Red, 5);
    layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
    layer.FeatureSource.ProjectionConverter = projectionConverter;
    layer.Open();
    mapView.CurrentExtent = layer.GetBoundingBox();
    LayerOverlay layerOverlay = new LayerOverlay();
    layerOverlay.Layers.Add(layer);
    mapView.Overlays.Add(layerOverlay);
    mapView.Refresh();
}

```

 ![image](https://community.thinkgeo.com/uploads/default/original/3X/a/7/a7af0308a15bef8863190b69b1b3ef2d4f945a05.png)

I also attached you the full project.  
[KmlDemo.zip](https://community.thinkgeo.com/uploads/short-url/9unkFnPG7haLduqfUhPV4PUlCav.zip) (36.2 KB)

Thanks

Frank

---

<div class="post-metadata">

**Author:** ![Mouni\_M](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@Mouni\_M](https://community.thinkgeo.com/u/Mouni_M)\
**Post date:** [March 25, 2021, 8:24am UTC](https://community.thinkgeo.com/t/displaying-kml-file/10039/3 "2021-03-25T08:24:05Z")

</div>

> [@Frank4](#):
>
> ProjectionConverter projectionConverter = new ProjectionConverter(Projection.ConvertWktToProjString(projString), 4326);

Thank you Frank for your reply.  
The code I’ve attached is in MapSuite v7.0. & .NET framework 4.7.2. I’m not using .xml version so I’m not getting how to convert above mentioned two ProjectionConverter lines in my code.Please provide alternative solution to this as soon.
