# Issue with MultipleShapeFileFeatureLayer

**URL:** <https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174>\
**Category:** Services\
**Created:** [October 18, 2012, 8:11am UTC](https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174 "2012-10-18T08:11:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@Dustin](https://community.thinkgeo.com/u/Dustin)\
**Post date:** [October 18, 2012, 8:11am UTC](https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174/1 "2012-10-18T08:11:49Z")

</div>

Hi&nbsp;All,

I&nbsp;am&nbsp;currently&nbsp;running&nbsp;version&nbsp;6.0.0.151&nbsp;and&nbsp;am&nbsp;having&nbsp;a&nbsp;devil&nbsp;of&nbsp;a&nbsp;time&nbsp;with&nbsp;the&nbsp;MultipleShapeFileFeatureLayer&nbsp;layer.&nbsp;Any&nbsp;time&nbsp;I&nbsp;try&nbsp;to&nbsp;draw&nbsp;one&nbsp;(I'm&nbsp;using&nbsp;MapEngine.DrawStaticLayers)&nbsp;I&nbsp;receive&nbsp;an&nbsp;'index&nbsp;out&nbsp;of&nbsp;bounds'&nbsp;exception,&nbsp;whether&nbsp;there's&nbsp;only&nbsp;one&nbsp;file&nbsp;included,&nbsp;or&nbsp;a&nbsp;hundred.&nbsp;I've&nbsp;tried&nbsp;attaching&nbsp;to&nbsp;the&nbsp;DrawingException&nbsp;and&nbsp;DrawnException&nbsp;events,&nbsp;but&nbsp;they&nbsp;don't&nbsp;seem&nbsp;to&nbsp;be&nbsp;being&nbsp;hit.&nbsp;There&nbsp;is&nbsp;nothing&nbsp;fancy&nbsp;in&nbsp;the&nbsp;styling&nbsp;or&nbsp;the&nbsp;way&nbsp;I'm&nbsp;using&nbsp;the&nbsp;layer,&nbsp;either.&nbsp;I&nbsp;can&nbsp;switch&nbsp;it&nbsp;to&nbsp;a&nbsp;ShapeFileFeatureLayer&nbsp;(with&nbsp;only&nbsp;one&nbsp;file,&nbsp;obviously)&nbsp;and&nbsp;everything&nbsp;seems&nbsp;to&nbsp;work&nbsp;fine.&nbsp;Might&nbsp;you&nbsp;be&nbsp;able&nbsp;to&nbsp;give&nbsp;me&nbsp;a&nbsp;bit&nbsp;of&nbsp;insight&nbsp;as&nbsp;to&nbsp;where&nbsp;I'm&nbsp;going&nbsp;wrong?&nbsp;Thanks&nbsp;again!

-Dustin

---

<div class="post-metadata">

**Author:** ![Dustin](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@Dustin](https://community.thinkgeo.com/u/Dustin)\
**Post date:** [October 18, 2012, 9:34am UTC](https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174/2 "2012-10-18T09:34:16Z")

</div>

Also,&nbsp;when&nbsp;I&nbsp;switch&nbsp;back&nbsp;to&nbsp;version&nbsp;5.0.0.55,&nbsp;this&nbsp;worked&nbsp;as&nbsp;expected,&nbsp;though&nbsp;it&nbsp;was&nbsp;significantly&nbsp;slower&nbsp;than&nbsp;v6,&nbsp;so&nbsp;I’d&nbsp;really&nbsp;rather&nbsp;not&nbsp;use&nbsp;it&nbsp;if&nbsp;I&nbsp;don’t&nbsp;have&nbsp;to.

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [October 23, 2012, 2:00am UTC](https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174/3 "2012-10-23T02:00:22Z")

</div>

&nbsp;

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [October 23, 2012, 2:03am UTC](https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174/4 "2012-10-23T02:03:06Z")

</div>

Hi&nbsp;Dustin,

We&nbsp;wrote&nbsp;a&nbsp;sample&nbsp;to&nbsp;recreate&nbsp;your&nbsp;scenario&nbsp;but&nbsp;there&nbsp;is&nbsp;no&nbsp;exception,&nbsp;attached&nbsp;is&nbsp;the&nbsp;sample,&nbsp;please&nbsp;get&nbsp;it&nbsp;and&nbsp;have&nbsp;a&nbsp;try.

Regards,

Edgar

[Post10778.zip](https://community.thinkgeo.com/uploads/default/original/2X/e/e63a79643db90eebacacf24ba07af92c981c2b99.zip) (11 KB)

---

<div class="post-metadata">

**Author:** ![Dustin](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@Dustin](https://community.thinkgeo.com/u/Dustin)\
**Post date:** [October 23, 2012, 8:34am UTC](https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174/5 "2012-10-23T08:34:17Z")

</div>

Hi&nbsp;Edgar,  
  
Your&nbsp;sample&nbsp;did&nbsp;indeed&nbsp;work,&nbsp;and&nbsp;it&nbsp;led&nbsp;me&nbsp;to&nbsp;figure&nbsp;out&nbsp;what&nbsp;is&nbsp;going&nbsp;on.&nbsp;If&nbsp;you&nbsp;create&nbsp;the&nbsp;MultipleShapeFileFeatureLayer&nbsp;first&nbsp;and&nbsp;add&nbsp;individual&nbsp;shapefile&nbsp;paths&nbsp;to&nbsp;it,&nbsp;then&nbsp;perform&nbsp;the&nbsp;DrawStaticLayers&nbsp;command,&nbsp;that's&nbsp;when&nbsp;the&nbsp;error&nbsp;is&nbsp;thrown.&nbsp;If&nbsp;you&nbsp;group&nbsp;the&nbsp;shapefile&nbsp;paths&nbsp;in&nbsp;a&nbsp;collection&nbsp;and&nbsp;instantiate&nbsp;it&nbsp;with&nbsp;that&nbsp;collection&nbsp;(as&nbsp;you&nbsp;did&nbsp;in&nbsp;the&nbsp;sample)&nbsp;everything&nbsp;seems&nbsp;to&nbsp;work&nbsp;fine.&nbsp;  
  
So,&nbsp;replacing&nbsp;this:  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[code]Collection\<string\>&nbsp;paths&nbsp;=&nbsp;new&nbsp;Collection\<string\>()&nbsp;{&nbsp;  
  
@"..\..\..\SampleData\Data\USStates.shp",\</string\>\</string\>

\<string\>\<string\>@"..\..\..\SampleData\Data\MajorCities.shp"  
  
};  
  
MultipleShapeFileFeatureLayer&nbsp;mFeatureLayer&nbsp;=&nbsp;new&nbsp;MultipleShapeFileFeatureLayer(paths);  
  
  
  
with&nbsp;this  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[code]MultipleShapeFileFeatureLayer&nbsp;mFeatureLayer&nbsp;=&nbsp;new&nbsp;MultipleShapeFileFeatureLayer();  
  
&nbsp;&nbsp;mFeatureLayer.ShapeFiles.Add(@"..\..\..\SampleData\Data\USStates.shp");  
  
&nbsp;&nbsp;mFeatureLayer.ShapeFiles.Add(@"..\..\..\SampleData\Data\MajorCities.shp");  
  
  
  
should&nbsp;break&nbsp;it&nbsp;(unless&nbsp;that's&nbsp;intended&nbsp;behavior,&nbsp;but&nbsp;that&nbsp;seems&nbsp;strange.)&nbsp;Knowing&nbsp;that,&nbsp;I&nbsp;guess&nbsp;I&nbsp;can&nbsp;proceed,&nbsp;though,&nbsp;so&nbsp;thank&nbsp;you&nbsp;very&nbsp;much&nbsp;for&nbsp;your&nbsp;help!\</string\>\</string\>

-Dustin

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [October 28, 2012, 8:55pm UTC](https://community.thinkgeo.com/t/issue-with-multipleshapefilefeaturelayer/7174/6 "2012-10-28T20:55:23Z")

</div>

Dustin,&nbsp;  
&nbsp;&nbsp;  
&nbsp;This&nbsp;is&nbsp;a&nbsp;bug,&nbsp;and&nbsp;we’ve&nbsp;fixed&nbsp;it,&nbsp;please&nbsp;get&nbsp;6.0.169.0&nbsp;or&nbsp;6.0.0.169&nbsp;and&nbsp;have&nbsp;a&nbsp;try.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;Edgar
