# Click handler for highlight layer

**URL:** <https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924>\
**Category:** WebForms\
**Created:** [September 5, 2011, 4:46pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924 "2011-09-05T16:46:21Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 5, 2011, 4:46pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/1 "2011-09-05T16:46:21Z")

</div>

I&nbsp;am&nbsp;new&nbsp;to&nbsp;this&nbsp;tool&nbsp;and&nbsp;could&nbsp;really&nbsp;use&nbsp;your&nbsp;help.&nbsp;Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;time.

I&nbsp;have&nbsp;a&nbsp;simple&nbsp;highlight&nbsp;layer&nbsp;that&nbsp;is&nbsp;created&nbsp;as&nbsp;such:&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BaseStatesLayer.Open()  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.HighlightOverlay.HighlightStyle&nbsp;=&nbsp;New&nbsp;FeatureOverlayStyle(GeoColor.GeographicColors.Forest,&nbsp;GeoColor.StandardColors.LightYellow,&nbsp;2)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;Each&nbsp;feature&nbsp;As&nbsp;Feature&nbsp;In&nbsp;BaseStatesLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.NoColumns)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.HighlightOverlay.Features.Add(feature.Id,&nbsp;feature)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Removed&nbsp;next&nbsp;line&nbsp;as&nbsp;it&nbsp;doesn't&nbsp;do&nbsp;not&nbsp;operate&nbsp;as&nbsp;expected--&nbsp;throws&nbsp;a&nbsp;json&nbsp;error  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Map1.HighlightOverlay.OnClientClick&nbsp;=&nbsp;"function(map){alert('Client&nbsp;Click.');}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Removed&nbsp;next&nbsp;line&nbsp;as&nbsp;it&nbsp;cannot&nbsp;locate&nbsp;asp.net&nbsp;function&nbsp;HighlightOverlay\_Click&nbsp;and&nbsp;asks&nbsp;to&nbsp;"raise&nbsp;event"?  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Map1.HighlightOverlay.Click&nbsp;+=&nbsp;new&nbsp;EventHandler(HighlightOverlay\_Click);  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BaseStatesLayer.Close()

When&nbsp;I&nbsp;click&nbsp;on&nbsp;the&nbsp;highlight,&nbsp;nothing&nbsp;happens.&nbsp;The&nbsp;function&nbsp;Map1\_Click&nbsp;only&nbsp;fires&nbsp;when&nbsp;the&nbsp;highlight&nbsp;is&nbsp;not&nbsp;active.&nbsp;  
  
  
  
Is&nbsp;there&nbsp;a&nbsp;simple&nbsp;way&nbsp;to&nbsp;interesect&nbsp;the&nbsp;click?&nbsp;I've&nbsp;read&nbsp;through&nbsp;the&nbsp;forums&nbsp;that&nbsp;a&nbsp;client&nbsp;side&nbsp;postback&nbsp;is&nbsp;an&nbsp;option,&nbsp;but&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;how&nbsp;to&nbsp;execute&nbsp;this.  
  
  
  
  
  
Thank&nbsp;you&nbsp;again.

&nbsp;

Peter&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 12:03pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/2 "2011-09-06T12:03:21Z")

</div>

Still&nbsp;trying&nbsp;to&nbsp;suss&nbsp;this&nbsp;out.&nbsp;I&nbsp;took&nbsp;this&nbsp;code&nbsp;sample&nbsp;from&nbsp;the&nbsp;  
  
"Add&nbsp;a&nbsp;click&nbsp;event&nbsp;to&nbsp;an&nbsp;HighlightOverlay"&nbsp;sample&nbsp;included&nbsp;with&nbsp;the&nbsp;product.

When&nbsp;I&nbsp;do&nbsp;this:&nbsp;  
  
  
  
-----------------------------------------------  
  
...&nbsp;...&nbsp;...

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BaseStatesLayer.Open()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.HighlightOverlay.HighlightStyle&nbsp;=&nbsp;New&nbsp;FeatureOverlayStyle(GeoColor.GeographicColors.Forest,&nbsp;GeoColor.StandardColors.LightYellow,&nbsp;2)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;Each&nbsp;feature&nbsp;As&nbsp;Feature&nbsp;In&nbsp;BaseStatesLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.NoColumns)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.HighlightOverlay.Features.Add(feature.Id,&nbsp;feature)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AddHandler&nbsp;Map1.HighlightOverlay.Click,&nbsp;AddressOf&nbsp;EventLayer\_Click  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BaseStatesLayer.Close()

...&nbsp;...&nbsp;...

&nbsp;&nbsp;&nbsp;&nbsp;Protected&nbsp;Sub&nbsp;EventLayer\_Click(ByVal&nbsp;sender&nbsp;As&nbsp;Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;MapClickedEventArgs)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;a  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;5  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;Sub

-----------------------------------------------  
  
&nbsp;

I&nbsp;get&nbsp;this&nbsp;error:&nbsp;&nbsp;  
  
  
  
Default.aspx.vb(88)&nbsp;:&nbsp;error&nbsp;BC31143:&nbsp;Method&nbsp;'Protected&nbsp;Sub&nbsp;&nbsp;EventLayer\_Click(sender&nbsp;As&nbsp;Object,&nbsp;e&nbsp;As&nbsp;&nbsp;ThinkGeo.MapSuite.WebEdition.MapClickedEventArgs)'&nbsp;does&nbsp;not&nbsp;have&nbsp;a&nbsp;&nbsp;signature&nbsp;compatible&nbsp;with&nbsp;delegate&nbsp;'Delegate&nbsp;Sub&nbsp;EventHandler(Of&nbsp;&nbsp;ThinkGeo.MapSuite.WebEdition.HighlightFeatureOverlayClickEventArgs)(sender&nbsp;&nbsp;As&nbsp;Object,&nbsp;e&nbsp;As&nbsp;&nbsp;ThinkGeo.MapSuite.WebEdition.HighlightFeatureOverlayClickEventArgs)'.

Please&nbsp;advise.&nbsp;Thank&nbsp;you.

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 12:28pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/3 "2011-09-06T12:28:26Z")

</div>

Got&nbsp;it...&nbsp;I&nbsp;think...&nbsp;  
  
  
  
I&nbsp;need&nbsp;more&nbsp;experimentation&nbsp;but&nbsp;I&nbsp;am&nbsp;a&nbsp;step&nbsp;closer.&nbsp;The&nbsp;problem&nbsp;is&nbsp;that&nbsp;in&nbsp;the&nbsp;sample,&nbsp;the&nbsp;click&nbsp;handler&nbsp;appears&nbsp;incorrect.&nbsp;It&nbsp;should&nbsp;be:&nbsp;

...&nbsp;...&nbsp;...

Protected&nbsp;Sub&nbsp;EventLayer\_Click(ByVal&nbsp;sender&nbsp;As&nbsp;Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;HighlightFeatureOverlayClickEventArgs)

...&nbsp;...&nbsp;...

&nbsp;

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 12:37pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/4 "2011-09-06T12:37:47Z")

</div>

So&nbsp;close...&nbsp;  
  
  
  
Now&nbsp;I&nbsp;have&nbsp;the&nbsp;issue:  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shapeFileLayer.Open()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;selectedFeatures&nbsp;As&nbsp;Collection(Of&nbsp;Feature)&nbsp;=&nbsp;shapeFileLayer.QueryTools.GetFeaturesContaining(e.Position,&nbsp;New&nbsp;String(0)&nbsp;{"STATE\_NAME"})  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shapeFileLayer.Close()  
  
  
  
  
  
  
  
'Position'&nbsp;is&nbsp;not&nbsp;a&nbsp;member&nbsp;of&nbsp;'ThinkGeo.MapSuite.WebEdition.HighlightFeatureOverlayClickEventArgs'

&nbsp;

It&nbsp;IS&nbsp;A&nbsp;MEMBER&nbsp;of&nbsp;'MapClickedEventArgs'&nbsp;which&nbsp;is&nbsp;how&nbsp;the&nbsp;project&nbsp;was&nbsp;wroking&nbsp;prior&nbsp;to&nbsp;adding&nbsp;the&nbsp;highlight&nbsp;layer.&nbsp;

&nbsp;

&nbsp;

Help&nbsp;(please)

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 1:27pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/5 "2011-09-06T13:27:33Z")

</div>

I&nbsp;have&nbsp;the&nbsp;feature&nbsp;id&nbsp;using&nbsp;this&nbsp;method…&nbsp;is&nbsp;there&nbsp;a&nbsp;workaround&nbsp;where&nbsp;I&nbsp;could&nbsp;use&nbsp;the&nbsp;QueryTools&nbsp;against&nbsp;this&nbsp;id…?&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;really&nbsp;simply&nbsp;wish&nbsp;that&nbsp;there&nbsp;was&nbsp;a&nbsp;a&nbsp;method&nbsp;to&nbsp;stop&nbsp;intersecting&nbsp;the&nbsp;click&nbsp;at&nbsp;the&nbsp;highlight&nbsp;layer&nbsp;and&nbsp;have&nbsp;it&nbsp;pass&nbsp;through&nbsp;the&nbsp;base.&nbsp;This&nbsp;was&nbsp;my&nbsp;original&nbsp;goal,&nbsp;but&nbsp;I&nbsp;keep&nbsp;doing&nbsp;work&nbsp;arounds…&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;anyone?

---

<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 6, 2011, 2:37pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/6 "2011-09-06T14:37:55Z")

</div>

Hi&nbsp;Peter,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;I&nbsp;have&nbsp;some&nbsp;confused&nbsp;about&nbsp;your&nbsp;scenario.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Do&nbsp;you&nbsp;want&nbsp;to&nbsp;high&nbsp;light&nbsp;clicked&nbsp;shapes&nbsp;in&nbsp;map?&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;so,&nbsp;I&nbsp;think&nbsp;we&nbsp;have&nbsp;a&nbsp;sample&nbsp;for&nbsp;that.&nbsp;  
&nbsp;&nbsp;  
&nbsp;It’s&nbsp;“Find&nbsp;the&nbsp;Feature&nbsp;the&nbsp;User&nbsp;Clicked”,&nbsp;you&nbsp;can&nbsp;view&nbsp;its&nbsp;code&nbsp;in&nbsp;HowDoISamples&nbsp;project&nbsp;or&nbsp;[websamples.thinkgeo.com](http://websamples.thinkgeo.com).&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 2:52pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/7 "2011-09-06T14:52:55Z")

</div>

Okay--&nbsp;let&nbsp;me&nbsp;simplify:&nbsp;  
  
  
  
I&nbsp;have&nbsp;a&nbsp;hover&nbsp;state&nbsp;set&nbsp;using&nbsp;the&nbsp;highlight&nbsp;layer.&nbsp;All's&nbsp;good.&nbsp;My&nbsp;problem&nbsp;was&nbsp;that&nbsp;when&nbsp;it's&nbsp;clicked,&nbsp;it&nbsp;does&nbsp;not&nbsp;confer&nbsp;the&nbsp;same&nbsp;information&nbsp;as&nbsp;when&nbsp;a&nbsp;base&nbsp;layer&nbsp;is&nbsp;clicked.&nbsp;  
  
  
  
HighlightFeatureOverlayClickEventArgs&nbsp;vs.&nbsp;MapClickedEventArgs  
  
  
  
  
  
  
  
Now&nbsp;that&nbsp;I&nbsp;am&nbsp;in&nbsp;the&nbsp;click&nbsp;handler&nbsp;for&nbsp;the&nbsp;HighlightOverlay,&nbsp;I&nbsp;am&nbsp;trying&nbsp;to&nbsp;get&nbsp;information&nbsp;such&nbsp;as&nbsp;e.position:&nbsp;  
  
  
  
...  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shapeFileLayer.Open()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;selectedFeatures&nbsp;As&nbsp;Collection(Of&nbsp;Feature)&nbsp;=&nbsp;shapeFileLayer.QueryTools.GetFeaturesContaining(e.Position,&nbsp;New&nbsp;String(0)&nbsp;{"STATE\_NAME"})  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shapeFileLayer.Close()  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.CurrentExtent&nbsp;=&nbsp;ExtentHelper.GetDrawingExtent(selectedFeatures(0).GetBoundingBox(),&nbsp;CDbl(Map1.WidthInPixels),&nbsp;CDbl(Map1.HeightInPixels))  
  
&nbsp;

....&nbsp;

I&nbsp;apologize.&nbsp;This&nbsp;is&nbsp;kind&nbsp;of&nbsp;a&nbsp;fragmented&nbsp;example.&nbsp;I&nbsp;am&nbsp;right&nbsp;in&nbsp;the&nbsp;middle&nbsp;of&nbsp;debugging.&nbsp;

&nbsp;

My&nbsp;ORIGINAL&nbsp;intent&nbsp;was&nbsp;to&nbsp;ignore&nbsp;the&nbsp;click&nbsp;on&nbsp;the&nbsp;highlight&nbsp;layer&nbsp;and&nbsp;let&nbsp;the&nbsp;Map1\_Click&nbsp;handle&nbsp;the&nbsp;event.&nbsp;All&nbsp;the&nbsp;code&nbsp;was&nbsp;working,&nbsp;but&nbsp;I&nbsp;am&nbsp;attempting&nbsp;to&nbsp;add&nbsp;a&nbsp;hover&nbsp;state&nbsp;to&nbsp;the&nbsp;highlight&nbsp;layer.&nbsp;  
  
  
  
&nbsp;

&nbsp;

---

<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 6, 2011, 3:12pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/8 "2011-09-06T15:12:09Z")

</div>

Hi&nbsp;Peter,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Do&nbsp;you&nbsp;want&nbsp;to&nbsp;get&nbsp;your&nbsp;"STATE\_NAME"&nbsp;value&nbsp;in&nbsp;HighlightFeatureOverlayClickEventArgs?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Do&nbsp;you&nbsp;make&nbsp;sure&nbsp;you&nbsp;add&nbsp;your&nbsp;feature&nbsp;like&nbsp;this:&nbsp;For&nbsp;Each&nbsp;feature&nbsp;As&nbsp;Feature&nbsp;In&nbsp;BaseStatesLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.NoColumns)&nbsp;?&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;so,&nbsp;you&nbsp;cannot&nbsp;get&nbsp;any&nbsp;value&nbsp;because&nbsp;you&nbsp;choose&nbsp;ReturningColumnsType.NoColumns,&nbsp;you&nbsp;need&nbsp;choose&nbsp;ReturningColumnsType.AllColumns&nbsp;there.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Does&nbsp;that&nbsp;your&nbsp;question?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 3:23pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/9 "2011-09-06T15:23:14Z")

</div>

Hi&nbsp;Don,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;help.&nbsp;Close--&nbsp;I&nbsp;got&nbsp;the&nbsp;state&nbsp;name.&nbsp;It&nbsp;was&nbsp;exactly&nbsp;that&nbsp;I&nbsp;was&nbsp;not&nbsp;adding&nbsp;the&nbsp;columns.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Now,&nbsp;I&nbsp;am&nbsp;trying&nbsp;to&nbsp;use:&nbsp;  
&nbsp;&nbsp;  
&nbsp;Map1.CurrentExtent&nbsp;=&nbsp;ExtentHelper.GetDrawingExtent(selectedFeatures(0).GetBoundingBox(),&nbsp;CDbl(Map1.WidthInPixels),&nbsp;CDbl(Map1.HeightInPixels))&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;to&nbsp;zoom&nbsp;in&nbsp;on&nbsp;what&nbsp;was&nbsp;clicked.&nbsp;My&nbsp;problem&nbsp;is&nbsp;that&nbsp;the&nbsp;examples&nbsp;all&nbsp;rely&nbsp;on&nbsp;e.position&nbsp;which&nbsp;is&nbsp;a&nbsp;property&nbsp;of&nbsp;MapClickedEventArgs,&nbsp;but&nbsp;not&nbsp;of&nbsp;HighlightFeatureOverlayClickEventArgs&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;again,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Peter&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 3:35pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/10 "2011-09-06T15:35:53Z")

</div>

Specifically&nbsp;this:&nbsp;

Protected&nbsp;Sub&nbsp;EventLayer\_Click(ByVal&nbsp;myHighlight&nbsp;As&nbsp;Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;HighlightFeatureOverlayClickEventArgs)

Dim&nbsp;shapeFileLayer&nbsp;As&nbsp;ShapeFileFeatureLayer

shapeFileLayer&nbsp;=&nbsp;DirectCast(DirectCast(Map1.CustomOverlays(0),&nbsp;LayerOverlay).Layers("US\_STOverlay"),&nbsp;ShapeFileFeatureLayer)

shapeFileLayer.Open()  
  
  
  
Dim&nbsp;selectedFeatures&nbsp;As&nbsp;Collection(Of&nbsp;Feature)&nbsp;=&nbsp;shapeFileLayer.QueryTools.GetFeaturesContaining(e.Position,&nbsp;New&nbsp;String(0)&nbsp;{"STATE\_NAME"})  
  
  
  
shapeFileLayer.Close()

Map1.CurrentExtent&nbsp;=&nbsp;ExtentHelper.GetDrawingExtent(selectedFeatures(0).GetBoundingBox(),&nbsp;CDbl(Map1.WidthInPixels),&nbsp;CDbl(Map1.HeightInPixels))

End&nbsp;Sub

&nbsp;

My&nbsp;unfortunate&nbsp;experience&nbsp;is&nbsp;that&nbsp;all&nbsp;of&nbsp;the&nbsp;things&nbsp;worked&nbsp;prior&nbsp;to&nbsp;adding&nbsp;the&nbsp;highlight&nbsp;layer....&nbsp;If&nbsp;I&nbsp;can't&nbsp;get&nbsp;this&nbsp;to&nbsp;work,&nbsp;is&nbsp;there&nbsp;a&nbsp;way&nbsp;to&nbsp;get&nbsp;a&nbsp;hover&nbsp;state&nbsp;and&nbsp;just&nbsp;have&nbsp;the&nbsp;click&nbsp;"pass-through"&nbsp;to&nbsp;the&nbsp;original&nbsp;click&nbsp;handler?&nbsp;

&nbsp;

&nbsp;

Thank&nbsp;you.&nbsp;

---

<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 6, 2011, 3:47pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/11 "2011-09-06T15:47:17Z")

</div>

Hi&nbsp;Peter,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;HighlightFeatureOverlayClickEventArgs&nbsp;we&nbsp;have&nbsp;e.Location&nbsp;to&nbsp;get&nbsp;its&nbsp;position.&nbsp;And&nbsp;you&nbsp;can&nbsp;directly&nbsp;get&nbsp;the&nbsp;selected&nbsp;feature&nbsp;by&nbsp;e.ClickedFeature&nbsp;so&nbsp;that&nbsp;you&nbsp;don’t&nbsp;need&nbsp;do&nbsp;spatial&nbsp;query&nbsp;in&nbsp;layer.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;I&nbsp;miss&nbsp;some&nbsp;points&nbsp;you&nbsp;mentioned&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 4:02pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/12 "2011-09-06T16:02:16Z")

</div>

Cool…&nbsp;cool…&nbsp;it’s&nbsp;been&nbsp;making&nbsp;more&nbsp;sense&nbsp;as&nbsp;I&nbsp;use&nbsp;the&nbsp;tool.&nbsp;As&nbsp;I&nbsp;mentioned,&nbsp;I&nbsp;am&nbsp;very&nbsp;new&nbsp;to&nbsp;this&nbsp;tool.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Can&nbsp;you&nbsp;give&nbsp;me&nbsp;a&nbsp;sample&nbsp;of&nbsp;how&nbsp;I&nbsp;could&nbsp;do&nbsp;a&nbsp;zoom&nbsp;around&nbsp;the&nbsp;feature&nbsp;from&nbsp;it’s&nbsp;e.location&nbsp;?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you,&nbsp;again.

---

<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 6, 2011, 4:09pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/13 "2011-09-06T16:09:14Z")

</div>

Peter,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;I&nbsp;think&nbsp;I&nbsp;don’t&nbsp;have&nbsp;time&nbsp;to&nbsp;create&nbsp;a&nbsp;sample&nbsp;for&nbsp;you&nbsp;today,&nbsp;the&nbsp;time&nbsp;is&nbsp;not&nbsp;enough.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;this&nbsp;code&nbsp;should&nbsp;works&nbsp;for&nbsp;you&nbsp;(Please&nbsp;convert&nbsp;from&nbsp;C#&nbsp;to&nbsp;VB):&nbsp;  
&nbsp;&nbsp;  
&nbsp;Map1.CurrentExtent&nbsp;=&nbsp;e.ClickedFeature.GetBoundingBox();&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;you&nbsp;have&nbsp;any&nbsp;more&nbsp;question&nbsp;please&nbsp;let&nbsp;me&nbsp;know,&nbsp;I&nbsp;will&nbsp;reply&nbsp;you&nbsp;tomorrow.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Peter1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter1/32/24994_2.png) [@Peter1](https://community.thinkgeo.com/u/Peter1)\
**Post date:** [September 6, 2011, 4:20pm UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/14 "2011-09-06T16:20:16Z")

</div>

Friend,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;No&nbsp;need&nbsp;for&nbsp;a&nbsp;full&nbsp;"sample"&nbsp;–&nbsp;you&nbsp;gave&nbsp;me&nbsp;EXACTLY&nbsp;what&nbsp;I&nbsp;was&nbsp;looking&nbsp;for.&nbsp;That&nbsp;line&nbsp;of&nbsp;code&nbsp;is&nbsp;gold.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;!!!&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Peter

---

<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 7, 2011, 8:52am UTC](https://community.thinkgeo.com/t/click-handler-for-highlight-layer/5924/15 "2011-09-07T08:52:54Z")

</div>

Peter,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;are&nbsp;welcome,&nbsp;I&nbsp;am&nbsp;glad&nbsp;I&nbsp;can&nbsp;help&nbsp;you.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;other&nbsp;question&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
