# MapTools can not show ontop!

**URL:** <https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937>\
**Category:** WebForms\
**Created:** [September 14, 2011, 3:37am UTC](https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937 "2011-09-14T03:37:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tran](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/dec6dc/32.png) [@Tran](https://community.thinkgeo.com/u/Tran)\
**Post date:** [September 14, 2011, 3:37am UTC](https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937/1 "2011-09-14T03:37:20Z")

</div>

Hi&nbsp;all,

I&nbsp;have&nbsp;a&nbsp;map&nbsp;control,&nbsp;I&nbsp;add&nbsp;some&nbsp;ShapeFileFeatureLayer&nbsp;and&nbsp;then&nbsp;I&nbsp;add&nbsp;MapTool&nbsp;control,&nbsp;but&nbsp;when&nbsp;I&nbsp;show&nbsp;map&nbsp;page,&nbsp;my&nbsp;MapTools&nbsp;don't&nbsp;show!&nbsp;It&nbsp;lies&nbsp;below&nbsp;the&nbsp;image&nbsp;map.&nbsp;Help&nbsp;me,&nbsp;please!

---

<div class="post-metadata">

**Author:** ![Tran](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/dec6dc/32.png) [@Tran](https://community.thinkgeo.com/u/Tran)\
**Post date:** [September 14, 2011, 3:41am UTC](https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937/2 "2011-09-14T03:41:12Z")

</div>

Some&nbsp;code:&nbsp;  
  
  
  
``

``

`
public static void AddBasedMap(Map map) {            map.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"));            map.MapUnit = GeographyUnit.DecimalDegree;                        map.MapTools.MouseCoordinate.Enabled = true;            map.MapTools.MouseMapTool.Enabled = true;            map.MapTools.ScaleLine.Enabled = true;            map.MapTools.PanZoomBar.Enabled = true;            map.MapTools.AnimationPanMapTool.Enabled = true;            map.MapTools.Logo.Enabled = false;            createBasedLayer(map, HttpContext.Current.Server.MapPath("~/MapData/World/cntry02.shp"));            createSeaGridLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/BiendongGrid/GridBiendong_polyline.shp"));            createVNLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_ellipse.shp"));            createVNLineLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_polyline.shp"));            createVNPointLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_point.shp"));            createVNRegionLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_region.shp"));            createVNTextLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_text.shp"));        }

private static void createBasedLayer(Map map, String path) {            ShapeFileFeatureLayer baseLayer = new ShapeFileFeatureLayer(path);            baseLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);            baseLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level10;            map.StaticOverlay.Layers.Add("BaseLayer", baseLayer);        }

 

// ...............

 

`

&nbsp;

---

<div class="post-metadata">

**Author:** ![Tran](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/dec6dc/32.png) [@Tran](https://community.thinkgeo.com/u/Tran)\
**Post date:** [September 14, 2011, 3:46am UTC](https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937/3 "2011-09-14T03:46:09Z")

</div>

`public static void AddBasedMap(Map map) { map.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4")); map.MapUnit = GeographyUnit.DecimalDegree;             map.MapTools.MouseCoordinate.Enabled = true; map.MapTools.MouseMapTool.Enabled = true; map.MapTools.ScaleLine.Enabled = true; map.MapTools.PanZoomBar.Enabled = true; map.MapTools.AnimationPanMapTool.Enabled = true; map.MapTools.Logo.Enabled = false; createBasedLayer(map, HttpContext.Current.Server.MapPath("~/MapData/World/cntry02.shp"));            createSeaGridLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/BiendongGrid/GridBiendong_polyline.shp")); createVNLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_ellipse.shp")); createVNLineLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_polyline.shp")); createVNPointLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_point.shp")); createVNRegionLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_region.shp")); createVNTextLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_text.shp")); }private static void createBasedLayer(Map map, String path) { ShapeFileFeatureLayer baseLayer = new ShapeFileFeatureLayer(path); baseLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1); baseLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level10; map.StaticOverlay.Layers.Add("BaseLayer", baseLayer); } `

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [September 15, 2011, 12:16pm UTC](https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937/4 "2011-09-15T12:16:31Z")

</div>

Hi&nbsp;Tran,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;tested&nbsp;your&nbsp;code&nbsp;but&nbsp;it&nbsp;looks&nbsp;everything&nbsp;goes&nbsp;well&nbsp;here.&nbsp;I&nbsp;think&nbsp;your&nbsp;code&nbsp;don’t&nbsp;have&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;you&nbsp;still&nbsp;have&nbsp;this&nbsp;problem,&nbsp;could&nbsp;you&nbsp;create&nbsp;a&nbsp;simple&nbsp;sample&nbsp;for&nbsp;reproduce&nbsp;that,&nbsp;so&nbsp;that&nbsp;I&nbsp;can&nbsp;help&nbsp;you&nbsp;find&nbsp;the&nbsp;reason?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Here&nbsp;is&nbsp;my&nbsp;test&nbsp;code:&nbsp;  
&nbsp;&nbsp;  
&nbsp;`protected void Page_Load(object sender, EventArgs e)        {            if (!Page.IsPostBack)            {                AddBasedMap(Map1);            }        }        public static void AddBasedMap(Map map)        {            map.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"));            map.MapUnit = GeographyUnit.DecimalDegree;            map.MapTools.MouseCoordinate.Enabled = true;            map.MapTools.MouseMapTool.Enabled = true;            map.MapTools.ScaleLine.Enabled = true;            map.MapTools.PanZoomBar.Enabled = true;            map.MapTools.AnimationPanMapTool.Enabled = true;            map.MapTools.Logo.Enabled = false;            createBasedLayer(map, HttpContext.Current.Server.MapPath("~/SampleData/World/cntry02.shp"));            //createSeaGridLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/BiendongGrid/GridBiendong_polyline.shp"));            //createVNLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_ellipse.shp"));            //createVNLineLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_polyline.shp"));            //createVNPointLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_point.shp"));            //createVNRegionLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_region.shp"));            //createVNTextLayer(map, HttpContext.Current.Server.MapPath("~/MapData/Nen/VietNameShape/Vietnam_text.shp"));        }        private static void createBasedLayer(Map map, String path)        {            ShapeFileFeatureLayer baseLayer = new ShapeFileFeatureLayer(path);            baseLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);            baseLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level10;            map.StaticOverlay.Layers.Add(“BaseLayer”, baseLayer);        }`&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Tran](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/dec6dc/32.png) [@Tran](https://community.thinkgeo.com/u/Tran)\
**Post date:** [September 19, 2011, 11:09pm UTC](https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937/5 "2011-09-19T23:09:42Z")

</div>

I&nbsp;cant&nbsp;create&nbsp;a&nbsp;sample&nbsp;as&nbsp;you&nbsp;say,&nbsp;because&nbsp;my&nbsp;aspx&nbsp;code&nbsp;is&nbsp;very&nbsp;long!&nbsp;But&nbsp;I&nbsp;can&nbsp;supply&nbsp;some&nbsp;error&nbsp;image&nbsp;to&nbsp;you!&nbsp;  
&nbsp;MapTool&nbsp;lies&nbsp;below&nbsp;the&nbsp;image&nbsp;map,&nbsp;and&nbsp;the&nbsp;error&nbsp;only&nbsp;happens&nbsp;on&nbsp;IE,&nbsp;not&nbsp;on&nbsp;Firefox!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Images&nbsp;link:&nbsp;  
&nbsp;[docs.google.com/leaf?id=0B3QAJrjpQxGnOGM1NTliYTQtMTFlZS00ODE1LTk0MDQtMmE4OWY1MGVkZGFh&hl=en\_US](http://docs.google.com/leaf?id=0B3QAJrjpQxGnOGM1NTliYTQtMTFlZS00ODE1LTk0MDQtMmE4OWY1MGVkZGFh&hl=en_US)

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [September 20, 2011, 8:52am UTC](https://community.thinkgeo.com/t/maptools-can-not-show-ontop/5937/6 "2011-09-20T08:52:22Z")

</div>

Hi&nbsp;Tran,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Your&nbsp;link&nbsp;cannot&nbsp;be&nbsp;open.&nbsp;Could&nbsp;you&nbsp;upload&nbsp;your&nbsp;image&nbsp;as&nbsp;attach&nbsp;file&nbsp;in&nbsp;this&nbsp;post?&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;your&nbsp;problem&nbsp;will&nbsp;related&nbsp;with&nbsp;environment&nbsp;or&nbsp;some&nbsp;other&nbsp;code&nbsp;in&nbsp;your&nbsp;project.&nbsp;Because&nbsp;I&nbsp;test&nbsp;the&nbsp;code&nbsp;you&nbsp;provide&nbsp;but&nbsp;everything&nbsp;works&nbsp;well&nbsp;both&nbsp;in&nbsp;IE&nbsp;,FF&nbsp;and&nbsp;Chrome.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
