# Loading External Shape File into Think Geo

**URL:** <https://community.thinkgeo.com/t/loading-external-shape-file-into-think-geo/7975>\
**Category:** WinForms\
**Created:** [April 26, 2016, 7:48pm UTC](https://community.thinkgeo.com/t/loading-external-shape-file-into-think-geo/7975 "2016-04-26T19:48:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saeer\_Butt](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/9de053/32.png) [@Saeer\_Butt](https://community.thinkgeo.com/u/Saeer_Butt)\
**Post date:** [April 26, 2016, 7:48pm UTC](https://community.thinkgeo.com/t/loading-external-shape-file-into-think-geo/7975/1 "2016-04-26T19:48:19Z")

</div>

I am trying to load external shape file on Map control.  
I have defined 2 overlays

1. BaseMapLayersOverlay (loading WorldMapKitRenderLayer in this Overlay)
2. CustomMapLayersOverlay (loading custom shape file layer into this overlay)

Once BaseMapLayersOverlay is loaded, ThinkGeo Base Map is loading fine , however when I try to add custom layer, the base Map is not getting displayed, but only new layer is getting displayed.

The extents for BaseMap and Custom Layer belong to same town and should be same.  
Need the custom shape layer to be shown on top of the map, so user can relate the points to actual address.

Following code is used to load custom layer

#region Add Custom Layer  
private void AddCustomLayer()  
{

```
        string shapeLocation = @"Layer\GeoWaterHydrant.shp";
        ShapeFileFeatureLayer.BuildIndexFile(shapeLocation, BuildIndexMode.Rebuild);
        ShapeFileFeatureLayer shapeLayer = new ShapeFileFeatureLayer(shapeLocation);
        shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Highway1;
        shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
        shapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1;

        shapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        Proj4Projection proj4Projection = new Proj4Projection();
        proj4Projection.InternalProjectionParametersString = "+proj=tmerc +lat_0=0 +lon_0=117 +k=0.9996 +x_0=500000 +y_0=10000000 +a=6377397.155 +b=6356078.963 +towgs84=-404.78,685.68,45.47,0,0,0,0 +units=m +no_defs no_defs";

        proj4Projection.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); //Geodetic (Longitude/Latitude)

        proj4Projection.Open();

        shapeLayer.FeatureSource.Projection = proj4Projection;
        shapeLayer.Open();

        LayerOverlay overlay = (LayerOverlay)Map1.Overlays["CustomMapLayersOverlay"];
        overlay.Layers.Add(shapeLayer);
        
        Map1.CurrentExtent = shapeLayer.GetBoundingBox();

        Map1.Refresh();
    }
    #endregion
```

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [April 27, 2016, 5:50am UTC](https://community.thinkgeo.com/t/loading-external-shape-file-into-think-geo/7975/2 "2016-04-27T05:50:19Z")

</div>

Hi Saeer,

Please see the ticket you created.

Thanks,  
Peter
