# What would cause layers to not be displayed?

**URL:** <https://community.thinkgeo.com/t/what-would-cause-layers-to-not-be-displayed/1387>\
**Category:** WinForms\
**Created:** [August 11, 2010, 1:23pm UTC](https://community.thinkgeo.com/t/what-would-cause-layers-to-not-be-displayed/1387 "2010-08-11T13:23:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul2](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/paul2/32/24982_2.png) [@Paul2](https://community.thinkgeo.com/u/Paul2)\
**Post date:** [August 11, 2010, 1:23pm UTC](https://community.thinkgeo.com/t/what-would-cause-layers-to-not-be-displayed/1387/1 "2010-08-11T13:23:31Z")

</div>

Hello,

We're&nbsp;still&nbsp;trying&nbsp;to&nbsp;get&nbsp;some&nbsp;basic&nbsp;maps&nbsp;showing&nbsp;in&nbsp;our&nbsp;application.&nbsp;I&nbsp;frequently&nbsp;come&nbsp;up&nbsp;against&nbsp;an&nbsp;issue&nbsp;(caused&nbsp;by&nbsp;me)&nbsp;where&nbsp;layers&nbsp;stop&nbsp;rendering&nbsp;and&nbsp;all&nbsp;that&nbsp;is&nbsp;displayed&nbsp;is&nbsp;a&nbsp;big&nbsp;white&nbsp;box.

Can&nbsp;you&nbsp;give&nbsp;some&nbsp;pointers&nbsp;on&nbsp;what&nbsp;would&nbsp;prevent&nbsp;a&nbsp;layer&nbsp;from&nbsp;being&nbsp;drawn?&nbsp;Just&nbsp;some&nbsp;troubleshooting&nbsp;tips&nbsp;would&nbsp;be&nbsp;great.

As&nbsp;an&nbsp;example,&nbsp;here's&nbsp;the&nbsp;code&nbsp;I'm&nbsp;using&nbsp;right&nbsp;now&nbsp;to&nbsp;add&nbsp;two&nbsp;layers,&nbsp;but&nbsp;neither&nbsp;are&nbsp;being&nbsp;drawn.&nbsp;I've&nbsp;tried&nbsp;to&nbsp;roll&nbsp;it&nbsp;back&nbsp;to&nbsp;basic&nbsp;styles,&nbsp;but&nbsp;I&nbsp;still&nbsp;get&nbsp;the&nbsp;white&nbsp;box.

`        For Each layerFile As LayerDataFile In layerFiles            Dim l = New ShapeFileFeatureLayer(Path.Combine(layerFiles.BasePath, layerFile.Path))            l.Name = layerFile.Name            l.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Water1            'l.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.InternationalBorder1            l.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20            'For Each lzl As LayerZoomLevel In layerFile.ZoomLevels            '    Dim z = GetZoomLevel(l, lzl.FromLevel)            '    z.DefaultAreaStyle = AreaStyles.Water1            '    'ApplyLineStyle(z, lzl.LineStyleConfiguration)            '    'ApplyAreaStyle(z, lzl.AreaStyleConfiguration)            '    z.ApplyUntilZoomLevel = lzl.ToLevel            'Next            Me.StaticOverlay.Layers.Add(layerFile.Name, l)        Next`

&nbsp;Thanks!

pk

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [August 11, 2010, 1:55pm UTC](https://community.thinkgeo.com/t/what-would-cause-layers-to-not-be-displayed/1387/2 "2010-08-11T13:55:48Z")

</div>

I&nbsp;only&nbsp;see&nbsp;a&nbsp;portion&nbsp;of&nbsp;your&nbsp;code&nbsp;and&nbsp;I&nbsp;don’t&nbsp;have&nbsp;the&nbsp;layers,&nbsp;so&nbsp;we&nbsp;have&nbsp;few&nbsp;clues&nbsp;to&nbsp;determine&nbsp;what&nbsp;could&nbsp;be&nbsp;wrong.&nbsp;But&nbsp;based&nbsp;on&nbsp;my&nbsp;experience&nbsp;with&nbsp;similar&nbsp;problems,&nbsp;I&nbsp;would&nbsp;give&nbsp;you&nbsp;the&nbsp;following&nbsp;pointers:&nbsp;  
&nbsp;&nbsp;  
&nbsp;-&nbsp;I&nbsp;don’t&nbsp;see&nbsp;in&nbsp;your&nbsp;code&nbsp;where&nbsp;you&nbsp;set&nbsp;the&nbsp;map&nbsp;unit.&nbsp;I&nbsp;remind&nbsp;you&nbsp;that&nbsp;this&nbsp;is&nbsp;very&nbsp;important&nbsp;that&nbsp;the&nbsp;map&nbsp;unit&nbsp;of&nbsp;map&nbsp;matches&nbsp;the&nbsp;map&nbsp;unit&nbsp;your&nbsp;layers&nbsp;are.&nbsp;If&nbsp;for&nbsp;example,&nbsp;your&nbsp;layers&nbsp;are&nbsp;in&nbsp;decimal&nbsp;degrees,&nbsp;the&nbsp;map&nbsp;unit&nbsp;needs&nbsp;to&nbsp;be&nbsp;set&nbsp;to&nbsp;decimal&nbsp;degrees.&nbsp;If&nbsp;your&nbsp;layers&nbsp;are&nbsp;in&nbsp;meter,&nbsp;the&nbsp;map&nbsp;unit&nbsp;needs&nbsp;to&nbsp;be&nbsp;in&nbsp;meter.&nbsp;  
&nbsp;&nbsp;  
&nbsp;-Make&nbsp;sure&nbsp;that&nbsp;all&nbsp;your&nbsp;layers&nbsp;are&nbsp;in&nbsp;the&nbsp;same&nbsp;projection.&nbsp;If&nbsp;for&nbsp;example,&nbsp;you&nbsp;have&nbsp;one&nbsp;layer&nbsp;in&nbsp;Geodetic&nbsp;WGS84&nbsp;(Lat/Long)&nbsp;and&nbsp;another&nbsp;one&nbsp;in&nbsp;UTM,&nbsp;the&nbsp;layers&nbsp;are&nbsp;going&nbsp;to&nbsp;be&nbsp;in&nbsp;completely&nbsp;different&nbsp;coocrdinates&nbsp;system&nbsp;and&nbsp;if&nbsp;you&nbsp;add&nbsp;them&nbsp;together&nbsp;as&nbsp;is,&nbsp;it&nbsp;will&nbsp;have&nbsp;some&nbsp;undesired&nbsp;results.&nbsp;&nbsp;Reprojection&nbsp;operations&nbsp;are&nbsp;necessary&nbsp;and&nbsp;we&nbsp;can&nbsp;help&nbsp;you&nbsp;on&nbsp;that&nbsp;if&nbsp;this&nbsp;is&nbsp;your&nbsp;case.&nbsp;  
&nbsp;&nbsp;  
&nbsp;-You&nbsp;need&nbsp;to&nbsp;set&nbsp;the&nbsp;Style&nbsp;of&nbsp;the&nbsp;layer&nbsp;according&nbsp;to&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;layer.&nbsp;If&nbsp;the&nbsp;layer&nbsp;is&nbsp;point&nbsp;based,&nbsp;you&nbsp;need&nbsp;a&nbsp;PointStyle.&nbsp;If&nbsp;the&nbsp;layer&nbsp;is&nbsp;line&nbsp;based,&nbsp;you&nbsp;need&nbsp;a&nbsp;LineStyle.&nbsp;If&nbsp;your&nbsp;layer&nbsp;is&nbsp;polygon&nbsp;based,&nbsp;you&nbsp;need&nbsp;an&nbsp;AreaStyle.&nbsp;I&nbsp;see&nbsp;in&nbsp;your&nbsp;code,&nbsp;that&nbsp;you&nbsp;loop&nbsp;thru&nbsp;your&nbsp;layers&nbsp;but&nbsp;you&nbsp;do&nbsp;not&nbsp;check&nbsp;for&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;layer&nbsp;to&nbsp;set&nbsp;the&nbsp;appropriate&nbsp;style.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;If&nbsp;you&nbsp;don’t&nbsp;know&nbsp;anything&nbsp;about&nbsp;your&nbsp;layers,&nbsp;I&nbsp;would&nbsp;open&nbsp;up&nbsp;in&nbsp;our&nbsp;Map&nbsp;Explorer&nbsp;one&nbsp;layer&nbsp;at&nbsp;a&nbsp;time&nbsp;to&nbsp;view&nbsp;it&nbsp;and&nbsp;see&nbsp;by&nbsp;your&nbsp;self&nbsp;what&nbsp;type&nbsp;of&nbsp;layer&nbsp;it&nbsp;is.&nbsp;You&nbsp;can&nbsp;also&nbsp;build&nbsp;the&nbsp;spatial&nbsp;index&nbsp;for&nbsp;better&nbsp;performance.&nbsp;At&nbsp;the&nbsp;mouse&nbsp;move,&nbsp;you&nbsp;will&nbsp;see&nbsp;the&nbsp;world&nbsp;coordinates&nbsp;and&nbsp;it&nbsp;will&nbsp;give&nbsp;you&nbsp;an&nbsp;idea&nbsp;of&nbsp;what&nbsp;unit&nbsp;it&nbsp;is&nbsp;in.&nbsp;If&nbsp;the&nbsp;values&nbsp;are&nbsp;like&nbsp;-98.6788;&nbsp;35.7896,&nbsp;then&nbsp;it&nbsp;is&nbsp;in&nbsp;decimal&nbsp;degrees.&nbsp;If&nbsp;the&nbsp;values&nbsp;are&nbsp;much&nbsp;bigger,&nbsp;then&nbsp;the&nbsp;unit&nbsp;is&nbsp;in&nbsp;meter&nbsp;or&nbsp;feet.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;I&nbsp;hope&nbsp;that&nbsp;gives&nbsp;you&nbsp;some&nbsp;clues&nbsp;on&nbsp;how&nbsp;to&nbsp;correct&nbsp;your&nbsp;code&nbsp;so&nbsp;that&nbsp;your&nbsp;layers&nbsp;display&nbsp;correctly.

---

<div class="post-metadata">

**Author:** ![Paul2](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/paul2/32/24982_2.png) [@Paul2](https://community.thinkgeo.com/u/Paul2)\
**Post date:** [August 11, 2010, 2:26pm UTC](https://community.thinkgeo.com/t/what-would-cause-layers-to-not-be-displayed/1387/3 "2010-08-11T14:26:24Z")

</div>

Thanks&nbsp;for&nbsp;the&nbsp;quick&nbsp;response,&nbsp;Val.&nbsp;I&nbsp;just&nbsp;removed&nbsp;the&nbsp;dynamic&nbsp;layer&nbsp;file&nbsp;code&nbsp;and&nbsp;replaced&nbsp;it&nbsp;with&nbsp;this:&nbsp;  
  
  
  
`Me.MapUnit = GeographyUnit.DecimalDegreeMe.Overlays.Add("StaticOverlay", Me.StaticOverlay)Dim l As New ShapeFileFeatureLayer("c:\_projects\worldmapkit\world\physical\ocean.shp")l.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Water1l.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20Me.StaticOverlay.Layers.Add("Ocean", l)Me.Refresh()`&nbsp;  
  
  
  
I&nbsp;still&nbsp;just&nbsp;get&nbsp;a&nbsp;blank&nbsp;white&nbsp;control.&nbsp;If&nbsp;I&nbsp;add&nbsp;a&nbsp;ScaleAdornmentLayer,&nbsp;that&nbsp;does&nbsp;display&nbsp;correctly.&nbsp;  
  
  
  
I'll&nbsp;play&nbsp;with&nbsp;the&nbsp;Map&nbsp;Explorer&nbsp;to&nbsp;see&nbsp;if&nbsp;it&nbsp;helps.&nbsp;  
  
  
  
pk

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [August 11, 2010, 9:53pm UTC](https://community.thinkgeo.com/t/what-would-cause-layers-to-not-be-displayed/1387/4 "2010-08-11T21:53:43Z")

</div>

This&nbsp;is&nbsp;strange&nbsp;that&nbsp;the&nbsp;ScaleBarAdornmentLayer&nbsp;makes&nbsp;the&nbsp;layer&nbsp;display&nbsp;correctly.&nbsp;  
&nbsp;Also,&nbsp;make&nbsp;sure&nbsp;that&nbsp;you&nbsp;have&nbsp;the&nbsp;CurrentExtent&nbsp;of&nbsp;the&nbsp;map&nbsp;set&nbsp;correctly.&nbsp;Let&nbsp;us&nbsp;know&nbsp;if&nbsp;playing&nbsp;with&nbsp;Map&nbsp;Suite&nbsp;Explorer&nbsp;helps.
