# Hiding features on Feature/InMemoryFeatureLayers

**URL:** <https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806>\
**Category:** WPF\
**Created:** [September 14, 2010, 2:35pm UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806 "2010-09-14T14:35:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anil2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@Anil2](https://community.thinkgeo.com/u/Anil2)\
**Post date:** [September 14, 2010, 2:35pm UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806/1 "2010-09-14T14:35:56Z")

</div>

I&nbsp;am&nbsp;looking&nbsp;if&nbsp;there&nbsp;is&nbsp;a&nbsp;&nbsp;the&nbsp;better&nbsp;methodology&nbsp;to&nbsp;hide&nbsp;(and&nbsp;show)&nbsp;features&nbsp;on&nbsp;layer.

Methodology&nbsp;Steps:

1)&nbsp;Use&nbsp;FeatureLayer:FeatureIdsToExclude&nbsp;list&nbsp;to&nbsp;indicate&nbsp;list&nbsp;of&nbsp;&nbsp;features&nbsp;to&nbsp;hide&nbsp;(or&nbsp;remove&nbsp;from&nbsp;it&nbsp;to&nbsp;show)

2)&nbsp;Call&nbsp;Refresh&nbsp;method&nbsp;of&nbsp;the&nbsp;Layer'Overlay&nbsp;object&nbsp;or&nbsp;pass&nbsp;in&nbsp;Overlay&nbsp;to&nbsp;Refresh&nbsp;method&nbsp;of&nbsp;the&nbsp;Map&nbsp;

Is&nbsp;there&nbsp;any&nbsp;faster&nbsp;&nbsp;methodology&nbsp;when&nbsp;there&nbsp;are&nbsp;3000+&nbsp;features&nbsp;and&nbsp;I&nbsp;wan&nbsp;to&nbsp;hide&nbsp;only&nbsp;one&nbsp;or&nbsp;&nbsp;(n-1)&nbsp;ie&nbsp;2999?

Note:&nbsp;Feature&nbsp;could&nbsp;be&nbsp;PointShape&nbsp;or&nbsp;LineShape.

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 14, 2010, 9:43pm UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806/2 "2010-09-14T21:43:51Z")

</div>

Anil,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;Can&nbsp;you&nbsp;explain&nbsp;what&nbsp;you&nbsp;mean&nbsp;by&nbsp;faster?&nbsp;&nbsp;Do&nbsp;you&nbsp;mean&nbsp;that&nbsp;it&nbsp;takes&nbsp;to&nbsp;long&nbsp;to&nbsp;do&nbsp;the&nbsp;refresh?&nbsp;&nbsp;Do&nbsp;you&nbsp;mean&nbsp;the&nbsp;collection&nbsp;of&nbsp;items&nbsp;to&nbsp;exclude&nbsp;is&nbsp;hard&nbsp;to&nbsp;clunky&nbsp;to&nbsp;deal&nbsp;with?&nbsp;&nbsp;Can&nbsp;you&nbsp;give&nbsp;me&nbsp;a&nbsp;scenario?&nbsp;&nbsp;Can&nbsp;you&nbsp;give&nbsp;me&nbsp;the&nbsp;perfect&nbsp;API&nbsp;you&nbsp;would&nbsp;want&nbsp;to&nbsp;do&nbsp;what&nbsp;you&nbsp;need?&nbsp;&nbsp;If&nbsp;you&nbsp;provided&nbsp;that&nbsp;we&nbsp;can&nbsp;back&nbsp;into&nbsp;how&nbsp;to&nbsp;accomplish&nbsp;it.&nbsp;&nbsp;Once&nbsp;I&nbsp;know&nbsp;what&nbsp;you&nbsp;mean&nbsp;exactly&nbsp;I&nbsp;am&nbsp;sure&nbsp;we&nbsp;can&nbsp;do&nbsp;something&nbsp;for&nbsp;you.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![Anil2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@Anil2](https://community.thinkgeo.com/u/Anil2)\
**Post date:** [September 15, 2010, 12:41pm UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806/3 "2010-09-15T12:41:56Z")

</div>

Hi&nbsp;David,

Here&nbsp;are&nbsp;answers&nbsp;to&nbsp;your&nbsp;questions.

Q1)&nbsp;Can&nbsp;you&nbsp;explain&nbsp;what&nbsp;you&nbsp;mean&nbsp;by&nbsp;faster?

Anil&nbsp;-&nbsp;I&nbsp;feel&nbsp;that&nbsp;selective&nbsp;hiding&nbsp;(or&nbsp;showing)&nbsp;of&nbsp;features&nbsp;should&nbsp;be&nbsp;instantaneous&nbsp;(Ideally&nbsp;less&nbsp;than&nbsp;0.05&nbsp;sec)&nbsp;for&nbsp;better&nbsp;user&nbsp;experience.

Q2)&nbsp;Do&nbsp;you&nbsp;mean&nbsp;that&nbsp;it&nbsp;takes&nbsp;to&nbsp;long&nbsp;to&nbsp;do&nbsp;the&nbsp;refresh?

Anil&nbsp;-&nbsp;Yes.&nbsp;When&nbsp;the&nbsp;number&nbsp;of&nbsp;features&nbsp;increase&nbsp;refreshing&nbsp;takes&nbsp;time.&nbsp;It&nbsp;typically&nbsp;takes&nbsp;1-2&nbsp;seconds&nbsp;when&nbsp;I&nbsp;have&nbsp;1000+&nbsp;points&nbsp;and&nbsp;a&nbsp;typical&nbsp;human&nbsp;eye&nbsp;can&nbsp;see&nbsp;it&nbsp;drawing&nbsp;when&nbsp;invoking&nbsp;Refresh&nbsp;on&nbsp;the&nbsp;overlay!!!&nbsp;

Q3)&nbsp;Do&nbsp;you&nbsp;mean&nbsp;the&nbsp;collection&nbsp;of&nbsp;items&nbsp;to&nbsp;exclude&nbsp;is&nbsp;hard&nbsp;to&nbsp;clunky&nbsp;to&nbsp;deal&nbsp;with?&nbsp;Can&nbsp;you&nbsp;give&nbsp;me&nbsp;a&nbsp;scenario?

Anil&nbsp;-\>No.

Q4)&nbsp;Can&nbsp;you&nbsp;give&nbsp;me&nbsp;the&nbsp;perfect&nbsp;API&nbsp;you&nbsp;would&nbsp;want&nbsp;to&nbsp;do&nbsp;what&nbsp;you&nbsp;need?&nbsp;If&nbsp;you&nbsp;provided&nbsp;that&nbsp;we&nbsp;can&nbsp;back&nbsp;into&nbsp;how&nbsp;to&nbsp;accomplish&nbsp;it.&nbsp;Once&nbsp;I&nbsp;know&nbsp;what&nbsp;you&nbsp;mean&nbsp;exactly&nbsp;I&nbsp;am&nbsp;sure&nbsp;we&nbsp;can&nbsp;do&nbsp;something&nbsp;for&nbsp;you.

Anil&nbsp;-\>Later.

Regards,

Anil

&nbsp;

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 15, 2010, 8:26pm UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806/4 "2010-09-15T20:26:23Z")

</div>

Anil,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;I&nbsp;think&nbsp;I&nbsp;understand&nbsp;your&nbsp;issue&nbsp;now.&nbsp;&nbsp;I&nbsp;want&nbsp;to&nbsp;verify&nbsp;though&nbsp;that&nbsp;you&nbsp;are&nbsp;using&nbsp;the&nbsp;InMemoryFeatureLayer.&nbsp;&nbsp;The&nbsp;reason&nbsp;I&nbsp;ask&nbsp;is&nbsp;that&nbsp;the&nbsp;if&nbsp;this&nbsp;is&nbsp;a&nbsp;ShapeFileFeatureLayer&nbsp;the&nbsp;fix&nbsp;or&nbsp;adjustment&nbsp;might&nbsp;be&nbsp;different.&nbsp;&nbsp;I&nbsp;also&nbsp;want&nbsp;to&nbsp;verify&nbsp;that&nbsp;if&nbsp;you&nbsp;are&nbsp;using&nbsp;the&nbsp;InMemeoryFeatureLayer&nbsp;and&nbsp;you&nbsp;add&nbsp;the&nbsp;features&nbsp;through&nbsp;the&nbsp;InternalFeatures&nbsp;collection&nbsp;that&nbsp;you&nbsp;are&nbsp;calling&nbsp;the&nbsp;BuildIndex&nbsp;method&nbsp;once&nbsp;you&nbsp;add&nbsp;all&nbsp;of&nbsp;your&nbsp;feature&nbsp;and&nbsp;before&nbsp;you&nbsp;display&nbsp;the&nbsp;layer.&nbsp;&nbsp;The&nbsp;BuildIndex&nbsp;builds&nbsp;an&nbsp;R-Tree&nbsp;spatial&nbsp;index&nbsp;to&nbsp;speed&nbsp;up&nbsp;retrieving&nbsp;the&nbsp;related&nbsp;records&nbsp;in&nbsp;the&nbsp;bounding&nbsp;box.&nbsp;&nbsp;We&nbsp;will&nbsp;look&nbsp;at&nbsp;the&nbsp;internals&nbsp;of&nbsp;the&nbsp;exclusion&nbsp;collection&nbsp;and&nbsp;see&nbsp;what&nbsp;we&nbsp;find.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![Anil2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@Anil2](https://community.thinkgeo.com/u/Anil2)\
**Post date:** [September 16, 2010, 12:09pm UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806/5 "2010-09-16T12:09:41Z")

</div>

Hi&nbsp;David,

I&nbsp;am&nbsp;using&nbsp;InMemoryFeatureLayer.

I&nbsp;used&nbsp;BuildIndex()&nbsp;and&nbsp;it&nbsp;does&nbsp;speed&nbsp;up&nbsp;queries.

I&nbsp;ran&nbsp;into&nbsp;some&nbsp;problems&nbsp;for&nbsp;which&nbsp;I&nbsp;had&nbsp;opened&nbsp;a&nbsp;support&nbsp;ticket&nbsp;2&nbsp;days&nbsp;ago.

Regards,

Anil

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 16, 2010, 10:23pm UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806/6 "2010-09-16T22:23:54Z")

</div>

Anil,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;I&nbsp;will&nbsp;see&nbsp;where&nbsp;the&nbsp;ticket&nbsp;is&nbsp;and&nbsp;see&nbsp;if&nbsp;I&nbsp;can&nbsp;help.&nbsp;&nbsp;We&nbsp;have&nbsp;had&nbsp;allot&nbsp;of&nbsp;tickets&nbsp;lately&nbsp;so&nbsp;we&nbsp;are&nbsp;a&nbsp;little&nbsp;behind.&nbsp;&nbsp;We&nbsp;usually&nbsp;get&nbsp;caught&nbsp;up&nbsp;quickly&nbsp;though.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [September 21, 2010, 12:49am UTC](https://community.thinkgeo.com/t/hiding-features-on-feature-inmemoryfeaturelayers/2806/7 "2010-09-21T00:49:17Z")

</div>

Hi&nbsp;Anil,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;this&nbsp;ticket&nbsp;is&nbsp;fixed.&nbsp;Please&nbsp;confirm&nbsp;with&nbsp;us&nbsp;that&nbsp;if&nbsp;you&nbsp;still&nbsp;has&nbsp;the&nbsp;issue.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Howard
