# Click event in point shape

**URL:** <https://community.thinkgeo.com/t/click-event-in-point-shape/5707>\
**Category:** WebForms\
**Created:** [February 22, 2011, 6:33am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707 "2011-02-22T06:33:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thiago](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/ec9cab/32.png) [@Thiago](https://community.thinkgeo.com/u/Thiago)\
**Post date:** [February 22, 2011, 6:33am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/1 "2011-02-22T06:33:12Z")

</div>

I&nbsp;need&nbsp;a&nbsp;way&nbsp;to&nbsp;capture&nbsp;click&nbsp;events&nbsp;on&nbsp;a&nbsp;PointShape&nbsp;HighlightFeature.&nbsp;&nbsp;So&nbsp;far&nbsp;I&nbsp;tryed&nbsp;adapting&nbsp;the&nbsp;HelloWorld&nbsp;code&nbsp;so&nbsp;now&nbsp;it&nbsp;looks&nbsp;like&nbsp;this:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Feature&nbsp;feature&nbsp;=&nbsp;new&nbsp;Feature(new&nbsp;PointShape(-40.121,&nbsp;-20.44));  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.HighlightOverlay.HighlightStyle&nbsp;=&nbsp;Map1.HighlightOverlay.Style;  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.HighlightOverlay.Features.Add("feature",&nbsp;feature);  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.HighlightOverlay.Click&nbsp;+=&nbsp;new&nbsp;EventHandler\<HighlightFeatureOverlayClickEventArgs\>(EventLayer\_Click);

but&nbsp;the&nbsp;execution&nbsp;don't&nbsp;go&nbsp;nowhere&nbsp;near&nbsp;the&nbsp;EventLayer\_Click&nbsp;function.&nbsp;&nbsp;That&nbsp;means&nbsp;the&nbsp;click&nbsp;events&nbsp;aren't&nbsp;being&nbsp;captured.

Also&nbsp;I'd&nbsp;like&nbsp;to&nbsp;know&nbsp;where&nbsp;there&nbsp;is&nbsp;some&nbsp;clear&nbsp;info&nbsp;on&nbsp;event&nbsp;handling&nbsp;(which&nbsp;handlers&nbsp;belong&nbsp;to&nbsp;which&nbsp;objects).&nbsp;&nbsp;Seems&nbsp;quite&nbsp;complicated.  
  
&nbsp;

---

<div class="post-metadata">

**Author:** ![Thiago](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/ec9cab/32.png) [@Thiago](https://community.thinkgeo.com/u/Thiago)\
**Post date:** [February 22, 2011, 10:15am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/2 "2011-02-22T10:15:09Z")

</div>

I’m&nbsp;sorry&nbsp;the&nbsp;actual&nbsp;code&nbsp;is:&nbsp;  
&nbsp;&nbsp;  
&nbsp;`                Feature feature = new Feature(new PointShape(-40.121, -20.44));                Map1.HighlightOverlay.HighlightStyle = Map1.HighlightOverlay.Style;                Map1.HighlightOverlay.Features.Add(“feature”, feature);                Map1.HighlightOverlay.Click += new EventHandler<HighlightFeatureOverlayClickEventArgs>(EventLayer_Click); `&nbsp;  
&nbsp;&nbsp;  
&nbsp;So,&nbsp;do&nbsp;you&nbsp;know&nbsp;a&nbsp;way&nbsp;to&nbsp;handle&nbsp;click&nbsp;events&nbsp;when&nbsp;I&nbsp;click&nbsp;a&nbsp;PointShape?&nbsp;&nbsp;Is&nbsp;that&nbsp;even&nbsp;possible?

---

<div class="post-metadata">

**Author:** ![Thiago](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/ec9cab/32.png) [@Thiago](https://community.thinkgeo.com/u/Thiago)\
**Post date:** [February 22, 2011, 10:50am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/3 "2011-02-22T10:50:43Z")

</div>

I&nbsp;just&nbsp;found&nbsp;something&nbsp;else&nbsp;out.&nbsp;&nbsp;If&nbsp;I&nbsp;add&nbsp;a&nbsp;RectangleShape&nbsp;too,&nbsp;clicking&nbsp;events&nbsp;work&nbsp;both&nbsp;on&nbsp;the&nbsp;point&nbsp;and&nbsp;on&nbsp;the&nbsp;rectangle&nbsp;but&nbsp;if&nbsp;I&nbsp;only&nbsp;add&nbsp;a&nbsp;point&nbsp;it&nbsp;doesn't.&nbsp;  
  
  
  
With&nbsp;RectangleShape&nbsp;it&nbsp;aways&nbsp;works.&nbsp;&nbsp;What's&nbsp;the&nbsp;problem&nbsp;with&nbsp;PointShape?&nbsp;&nbsp;should&nbsp;I&nbsp;do&nbsp;something&nbsp;else?

---

<div class="post-metadata">

**Author:** ![Chris3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/65b543/32.png) [@Chris3](https://community.thinkgeo.com/u/Chris3)\
**Post date:** [February 22, 2011, 2:21pm UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/4 "2011-02-22T14:21:54Z")

</div>

I&nbsp;am&nbsp;having&nbsp;a&nbsp;similar&nbsp;problem&nbsp;with&nbsp;selecting&nbsp;point&nbsp;shapes,&nbsp;however&nbsp;my&nbsp;point&nbsp;shapes&nbsp;are&nbsp;loaded&nbsp;from&nbsp;the&nbsp;capital.shp&nbsp;file&nbsp;that&nbsp;comes&nbsp;with&nbsp;the&nbsp;software.&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;`    protected void Page_Load(object sender, EventArgs e)    {        if (!IsPostBack)        {            Map1.MapUnit = GeographyUnit.Meter;            WorldMapKitWmsWebOverlay worldMapKitOverlay = new WorldMapKitWmsWebOverlay("WorldMapKitOverlay");            Map1.CustomOverlays.Add(worldMapKitOverlay);              GoogleOverlay google2 = new GoogleOverlay("Google Map - Satellite");            google2.IsBaseOverlay = true;            google2.GoogleMapType = GoogleMapType.Satellite;            google2.IsVisibleInOverlaySwitcher = true;            google2.JavaScriptLibraryUri = new Uri("maps.google.com/maps/api/js?sensor=false&key=ABQIAAAAwUVrNSiu8pgbfv7gPho0_xSX6kVpdh7m28mTRWGCCVFRikBZwxT61ZFYI9M3hUSZXGfuAkPdoubmkQ");            Map1.CustomOverlays.Add(google2);            ManagedProj4Projection mproj4Projection = new ManagedProj4Projection();            mproj4Projection.InternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(4326);            mproj4Projection.ExternalProjectionParameters = ManagedProj4Projection.GetGoogleMapParameters();            ShapeFileFeatureLayer capitalLayer2 = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Evaluation Edition 4.5\Samples\CSharp Samples\SampleData\World\capital.shp");            // We can customize our own Style. Here we passed in a color and a size.            capitalLayer2.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.StandardColors.White, 7, GeoColor.StandardColors.Brown);            // The Style we set here is available from ZoomLevel01 to ZoomLevel05. That means if we zoom in a bit more, the appearance we set here will not be visible anymore.            capitalLayer2.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level05;            capitalLayer2.ZoomLevelSet.ZoomLevel06.DefaultPointStyle = PointStyles.Capital3;            // The Style we set here is available from ZoomLevel06 to ZoomLevel20. That means if we zoom out a bit more, the appearance we set here will not be visible any more.            capitalLayer2.ZoomLevelSet.ZoomLevel06.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;            capitalLayer2.FeatureSource.Projection = mproj4Projection;                            LayerOverlay loCapitolLayer = new LayerOverlay("CapitolOverlay", false, TileType.SingleTile);            loCapitolLayer.Layers.Add("capitalLayer2", capitalLayer2);            //loCapitolLayer.Layers.Add(capitalLabelLayer2);            Map1.CustomOverlays.Add(loCapitolLayer);        }    }    protected void Map1_Click(object sender, MapClickedEventArgs e)    {        LayerOverlay staticOverlay = (LayerOverlay)Map1.CustomOverlays["CapitolOverlay"];        ShapeFileFeatureLayer shapeFileLayer = (ShapeFileFeatureLayer)(staticOverlay.Layers["capitalLayer2"]);        shapeFileLayer.Open();        Collection<Feature> selectedFeatures = shapeFileLayer.QueryTools.GetFeaturesContaining(e.Position, new string[] { "CITY_NAME", "ADMIN_NAME" });        shapeFileLayer.Close();        if (selectedFeatures.Count > 0)            lblOutput.Text = "" + new StringBuilder().AppendFormat("CITY_NAME: {0}; ADMIN_NAME: {1}",                selectedFeatures[0].ColumnValues["CITY_NAME"],                selectedFeatures[0].ColumnValues["ADMIN_NAME"]).ToString();    } `

---

<div class="post-metadata">

**Author:** ![Thiago](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/ec9cab/32.png) [@Thiago](https://community.thinkgeo.com/u/Thiago)\
**Post date:** [February 22, 2011, 2:23pm UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/5 "2011-02-22T14:23:48Z")

</div>

Just&nbsp;for&nbsp;the&nbsp;record&nbsp;I’m&nbsp;using&nbsp;the&nbsp;“Map&nbsp;Suite&nbsp;Web&nbsp;Evaluation&nbsp;Edition&nbsp;4.5”&nbsp;to&nbsp;find&nbsp;out&nbsp;if&nbsp;it&nbsp;serves&nbsp;my&nbsp;company&nbsp;needs&nbsp;so&nbsp;we&nbsp;can&nbsp;license&nbsp;or&nbsp;not&nbsp;and&nbsp;so&nbsp;far&nbsp;it&nbsp;kind&nbsp;of&nbsp;doesn’t.&nbsp;&nbsp;Let&nbsp;me&nbsp;describe&nbsp;in&nbsp;detail&nbsp;what&nbsp;I’m&nbsp;trying&nbsp;to&nbsp;do:&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;show&nbsp;a&nbsp;bunch&nbsp;of&nbsp;points&nbsp;spread&nbsp;across&nbsp;the&nbsp;map&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;when&nbsp;one&nbsp;of&nbsp;this&nbsp;points&nbsp;is&nbsp;clicked,&nbsp;should&nbsp;have&nbsp;his&nbsp;associated&nbsp;position&nbsp;stored&nbsp;in&nbsp;a&nbsp;array&nbsp;of&nbsp;sorts&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;with&nbsp;some&nbsp;of&nbsp;these&nbsp;positions&nbsp;stored&nbsp;in&nbsp;a&nbsp;array,&nbsp;calculate&nbsp;the&nbsp;distance&nbsp;of&nbsp;the&nbsp;created&nbsp;path&nbsp;  
&nbsp;&nbsp;  
&nbsp;That&nbsp;means,&nbsp;I&nbsp;would&nbsp;be&nbsp;important&nbsp;to&nbsp;print&nbsp;some&nbsp;points&nbsp;across&nbsp;a&nbsp;map&nbsp;using&nbsp;PointShape&nbsp;or&nbsp;a&nbsp;Marker&nbsp;or&nbsp;whatever&nbsp;so&nbsp;the&nbsp;user&nbsp;could&nbsp;select&nbsp;some&nbsp;of&nbsp;them&nbsp;to&nbsp;create&nbsp;a&nbsp;path&nbsp;and&nbsp;see&nbsp;the&nbsp;calculated&nbsp;distance.&nbsp;&nbsp;Looking&nbsp;throught&nbsp;your&nbsp;forums&nbsp;it&nbsp;seems&nbsp;that&nbsp;it’s&nbsp;only&nbsp;possible&nbsp;to&nbsp;get&nbsp;a&nbsp;clicked&nbsp;marker&nbsp;by&nbsp;looking&nbsp;for&nbsp;the&nbsp;nearest&nbsp;objects&nbsp;of&nbsp;some&nbsp;point:&nbsp;  
&nbsp;[gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/7791/afv/topic/Default.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/7791/afv/topic/Default.aspx)&nbsp;  
&nbsp;&nbsp;  
&nbsp;Would&nbsp;you&nbsp;mind&nbsp;showing&nbsp;me&nbsp;some&nbsp;code&nbsp;on&nbsp;how&nbsp;to&nbsp;do&nbsp;that&nbsp;the&nbsp;right&nbsp;way&nbsp;using&nbsp;PointShapes&nbsp;or&nbsp;Markers&nbsp;or&nbsp;whatever&nbsp;is&nbsp;best&nbsp;in&nbsp;this&nbsp;cenario?&nbsp;Or&nbsp;maybe&nbsp;point&nbsp;me&nbsp;to&nbsp;a&nbsp;good&nbsp;example&nbsp;on&nbsp;your&nbsp;pages&nbsp;or&nbsp;something,&nbsp;because&nbsp;I&nbsp;really&nbsp;can’t&nbsp;find&nbsp;then&nbsp;if&nbsp;they&nbsp;exists.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;in&nbsp;advance.&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [February 23, 2011, 3:59am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/6 "2011-02-23T03:59:49Z")

</div>

Thiago,&nbsp;  
  
  
  
We&nbsp;confirmed&nbsp;it&nbsp;is&nbsp;a&nbsp;bug&nbsp;(Point&nbsp;can't&nbsp;be&nbsp;selected&nbsp;when&nbsp;there&nbsp;is&nbsp;only&nbsp;one&nbsp;in&nbsp;the&nbsp;highlightOverlay)&nbsp;in&nbsp;WebEditon&nbsp;4.5.0.0,&nbsp;we&nbsp;have&nbsp;fixed&nbsp;it&nbsp;and&nbsp;you&nbsp;can&nbsp;get&nbsp;the&nbsp;latest&nbsp;Evalution&nbsp;WebEdition&nbsp;(4.5.115.0&nbsp;or&nbsp;later)&nbsp;to&nbsp;have&nbsp;another&nbsp;try.&nbsp;  
  
  
  
Chris,&nbsp;  
  
  
  
In&nbsp;your&nbsp;"Map1\_Click"&nbsp;method,&nbsp;you&nbsp;should&nbsp;use&nbsp;the&nbsp;following&nbsp;code&nbsp;to&nbsp;get&nbsp;the&nbsp;features&nbsp;near&nbsp;the&nbsp;point&nbsp;you&nbsp;clicked.&nbsp;  
  
` Collection<feature> selectedFeatures = shapeFileLayer.QueryTools.GetFeaturesNearestTo(e.Position, GeographyUnit.DecimalDegree, 1, new string[] { "CITY_NAME", "ADMIN_NAME" }); `

Thanks,

Ivan

---

<div class="post-metadata">

**Author:** ![Thiago](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/ec9cab/32.png) [@Thiago](https://community.thinkgeo.com/u/Thiago)\
**Post date:** [February 23, 2011, 8:11am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/7 "2011-02-23T08:11:17Z")

</div>

Nice&nbsp;answer&nbsp;but&nbsp;your&nbsp;code&nbsp;is&nbsp;only&nbsp;good&nbsp;for&nbsp;getting&nbsp;streets&nbsp;and&nbsp;city&nbsp;names&nbsp;like&nbsp;the&nbsp;other&nbsp;guy&nbsp;needed.&nbsp;&nbsp;I&nbsp;want&nbsp;to&nbsp;return&nbsp;markers&nbsp;I&nbsp;create&nbsp;and&nbsp;draw&nbsp;myself.&nbsp;&nbsp;If&nbsp;I&nbsp;wanted&nbsp;to&nbsp;get&nbsp;these&nbsp;kind&nbsp;of&nbsp;map&nbsp;elements&nbsp;there&nbsp;is&nbsp;plenty&nbsp;of&nbsp;examples&nbsp;not&nbsp;only&nbsp;on&nbsp;your&nbsp;samples&nbsp;but&nbsp;also&nbsp;on&nbsp;your&nbsp;foruns.&nbsp;  
  
Let&nbsp;me&nbsp;try&nbsp;to&nbsp;explain&nbsp;again:&nbsp;&nbsp;fist&nbsp;step&nbsp;I&nbsp;create&nbsp;a&nbsp;lot&nbsp;of&nbsp;markers,&nbsp;each&nbsp;with&nbsp;its&nbsp;own&nbsp;position&nbsp;on&nbsp;the&nbsp;map,&nbsp;on&nbsp;a&nbsp;marker&nbsp;overlay.&nbsp;&nbsp;This&nbsp;is&nbsp;a&nbsp;snipet&nbsp;from&nbsp;my&nbsp;code&nbsp;where&nbsp;platLocs&nbsp;is&nbsp;a&nbsp;[n,2]&nbsp;array&nbsp;of&nbsp;positions&nbsp;using&nbsp;DecimalDegree&nbsp;unit:&nbsp;  
  
&nbsp;

for&nbsp;(int&nbsp;c&nbsp;=&nbsp;0;&nbsp;c&nbsp;\<&nbsp;platLocs.GetLength(0);&nbsp;c++)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{

&nbsp;&nbsp;&nbsp;double&nbsp;fact&nbsp;=&nbsp;0.05;

&nbsp;&nbsp;&nbsp;lotsOfFeatures[c]&nbsp;=&nbsp;new&nbsp;Feature(platLocs[c,0],&nbsp;platLocs[c,1]);

&nbsp;&nbsp;&nbsp;markerOverlay.Features.Add("lots"&nbsp;+&nbsp;c,&nbsp;lotsOfFeatures[c]);

}

markerOverlay.Click&nbsp;+=&nbsp;new&nbsp;EventHandler\<markeroverlayclickeventargs\>(markerOverlay\_Click);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</markeroverlayclickeventargs\>

\<markeroverlayclickeventargs\>Map1.CustomOverlays.Add(markerOverlay);&nbsp;&nbsp;  
  
\</markeroverlayclickeventargs\>

\<markeroverlayclickeventargs\>As&nbsp;you&nbsp;can&nbsp;see&nbsp;after&nbsp;I&nbsp;added&nbsp;all&nbsp;markers&nbsp;to&nbsp;the&nbsp;overlay&nbsp;I&nbsp;create&nbsp;a&nbsp;event&nbsp;handling&nbsp;for&nbsp;this&nbsp;overlay&nbsp;then&nbsp;I&nbsp;add&nbsp;this&nbsp;overlay&nbsp;to&nbsp;the&nbsp;Map1&nbsp;object.&nbsp;&nbsp;So&nbsp;far&nbsp;so&nbsp;good,&nbsp;every&nbsp;marker&nbsp;show&nbsp;up&nbsp;on&nbsp;the&nbsp;map&nbsp;and&nbsp;all.&nbsp;&nbsp;The&nbsp;problem&nbsp;is,&nbsp;when&nbsp;I&nbsp;click&nbsp;one&nbsp;of&nbsp;this&nbsp;markers&nbsp;I&nbsp;wanted&nbsp;to&nbsp;get&nbsp;the&nbsp;position&nbsp;it's&nbsp;on,&nbsp;but&nbsp;inside&nbsp;"markerOverlay\_Click"&nbsp;function&nbsp;I&nbsp;have&nbsp;no&nbsp;way&nbsp;of&nbsp;getting&nbsp;it.&nbsp;  
  
Now&nbsp;I&nbsp;just&nbsp;tried&nbsp;to&nbsp;use&nbsp;your&nbsp;little&nbsp;function&nbsp;up&nbsp;there.&nbsp;&nbsp;The&nbsp;idea&nbsp;I&nbsp;had&nbsp;was&nbsp;to&nbsp;create&nbsp;a&nbsp;event&nbsp;handler&nbsp;for&nbsp;the&nbsp;Map1&nbsp;object,&nbsp;then&nbsp;from&nbsp;inside&nbsp;"Map1\_Click"&nbsp;function&nbsp;I&nbsp;would&nbsp;be&nbsp;able&nbsp;to&nbsp;retrieve&nbsp;the&nbsp;markerOverlay&nbsp;object&nbsp;and&nbsp;the&nbsp;clicked&nbsp;position&nbsp;and&nbsp;maybe&nbsp;use&nbsp;the&nbsp;"GetFeaturesNearestTo"&nbsp;function&nbsp;from&nbsp;markerOverlay&nbsp;to&nbsp;retrieve&nbsp;the&nbsp;right&nbsp;marker,&nbsp;&nbsp;except&nbsp;InMemoryMarkerOverlay&nbsp;have&nbsp;no&nbsp;"GetFeaturesNearestTo"&nbsp;function&nbsp;right?&nbsp;  
  
Using&nbsp;the&nbsp;HighlightOverlay&nbsp;member&nbsp;of&nbsp;Map1&nbsp;seems&nbsp;like&nbsp;a&nbsp;option&nbsp;but&nbsp;can&nbsp;I&nbsp;get&nbsp;the&nbsp;exact&nbsp;position&nbsp;of&nbsp;the&nbsp;PointShape&nbsp;Feature&nbsp;from&nbsp;inside&nbsp;a&nbsp;click&nbsp;event?&nbsp;  
  
  
  
Do&nbsp;you&nbsp;understand&nbsp;what&nbsp;I'm&nbsp;trying&nbsp;to&nbsp;do&nbsp;here?&nbsp;Is&nbsp;it&nbsp;possible&nbsp;with&nbsp;your&nbsp;suite&nbsp;to&nbsp;do&nbsp;something&nbsp;like&nbsp;that&nbsp;at&nbsp;all?&nbsp;  
  
If&nbsp;I'm&nbsp;not&nbsp;giving&nbsp;you&nbsp;enough&nbsp;info&nbsp;about&nbsp;what&nbsp;I'm&nbsp;trying&nbsp;to&nbsp;do&nbsp;just&nbsp;ask&nbsp;me.&nbsp;  
  
  
  
Thanks&nbsp;in&nbsp;advance.\</markeroverlayclickeventargs\>

---

<div class="post-metadata">

**Author:** ![Thiago](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/ec9cab/32.png) [@Thiago](https://community.thinkgeo.com/u/Thiago)\
**Post date:** [February 23, 2011, 8:51am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/8 "2011-02-23T08:51:53Z")

</div>

I&nbsp;think&nbsp;I&nbsp;found&nbsp;a&nbsp;way&nbsp;to&nbsp;at&nbsp;least&nbsp;retrieve&nbsp;the&nbsp;position&nbsp;of&nbsp;a&nbsp;clicked&nbsp;PointShape&nbsp;on&nbsp;the&nbsp;map.&nbsp;&nbsp;From&nbsp;inside&nbsp;the&nbsp;HighlightOverlay&nbsp;click&nbsp;event:&nbsp;  
&nbsp;&nbsp;  
&nbsp;`             PointShape platPoint = null;            if (e.ClickedFeature.GetWellKnownText().Contains(“POINT”))            {                platPoint = new PointShape(e.ClickedFeature.GetWellKnownText());            }            else            {                platPoint = e.Location;            }`&nbsp;  
&nbsp;&nbsp;  
&nbsp;Still&nbsp;this&nbsp;way&nbsp;I&nbsp;don’t&nbsp;have&nbsp;the&nbsp;own&nbsp;PointShape&nbsp;object.&nbsp;&nbsp;I&nbsp;can&nbsp;only&nbsp;rebuild&nbsp;it&nbsp;so&nbsp;I&nbsp;can&nbsp;get&nbsp;its&nbsp;position.&nbsp;&nbsp;That&nbsp;means&nbsp;I&nbsp;can’t,&nbsp;for&nbsp;example,&nbsp;change&nbsp;its&nbsp;color&nbsp;from&nbsp;inside&nbsp;the&nbsp;event&nbsp;handler&nbsp;function&nbsp;right?&nbsp;

---

<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:** [February 23, 2011, 11:25am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/9 "2011-02-23T11:25:21Z")

</div>

Thiago,&nbsp;Chris,

&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;point&nbsp;out&nbsp;a&nbsp;couple&nbsp;of&nbsp;Code&nbsp;Community&nbsp;web&nbsp;projects&nbsp;that&nbsp;deal&nbsp;with&nbsp;clicking&nbsp;on&nbsp;features&nbsp;and&nbsp;identifying&nbsp;them.&nbsp;Those&nbsp;projects&nbsp;show&nbsp;how&nbsp;to&nbsp;implement&nbsp;that&nbsp;so&nbsp;that&nbsp;it&nbsp;is&nbsp;intuitive&nbsp;for&nbsp;the&nbsp;user.&nbsp;Please,&nbsp;see&nbsp;those&nbsp;projects&nbsp;_Get&nbsp;Features&nbsp;Clicked&nbsp;On&nbsp;(Web)_&nbsp;and&nbsp;_Get&nbsp;Features&nbsp;Clicked&nbsp;On&nbsp;(Web)&nbsp;2_.&nbsp;They&nbsp;show&nbsp;how&nbsp;to&nbsp;do&nbsp;that&nbsp;with&nbsp;different&nbsp;types&nbsp;of&nbsp;layers&nbsp;(point,&nbsp;line&nbsp;and&nbsp;polygon&nbsp;based).&nbsp;I&nbsp;think&nbsp;you&nbsp;will&nbsp;get&nbsp;inspired.

[wiki.thinkgeo.com/wiki/Map\_Suite\_We...n.28Web.29](http://wiki.thinkgeo.com/wiki/Map_Suite_Web_Edition_Spatial_Functions_Samples#Get_Feature_Clicked_On.28Web.29)

[wiki.thinkgeo.com/wiki/Map\_Suite\_We....28Web.292](http://wiki.thinkgeo.com/wiki/Map_Suite_Web_Edition_Spatial_Functions_Samples#Get_Feature_Clicked_On.28Web.292)

&nbsp;Also,&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;add&nbsp;that&nbsp;it&nbsp;always&nbsp;important&nbsp;to&nbsp;take&nbsp;into&nbsp;account&nbsp;in&nbsp;what&nbsp;Map&nbsp;Unit&nbsp;your&nbsp;map&nbsp;is&nbsp;because&nbsp;this&nbsp;is&nbsp;used&nbsp;as&nbsp;a&nbsp;parameter&nbsp;in&nbsp;the&nbsp;geometric&nbsp;functions&nbsp;underneath.

---

<div class="post-metadata">

**Author:** ![vivek3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/b782af/32.png) [@vivek3](https://community.thinkgeo.com/u/vivek3)\
**Post date:** [March 13, 2012, 5:41am UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/10 "2012-03-13T05:41:12Z")

</div>

hi,&nbsp;  
&nbsp;i&nbsp;have&nbsp;drawn&nbsp;the&nbsp;shapes&nbsp;on&nbsp;map(like&nbsp;circle&nbsp;,rectangle&nbsp;polygon)&nbsp;now&nbsp;i&nbsp;want&nbsp;to&nbsp;get&nbsp;the&nbsp;markers&nbsp;within&nbsp;that&nbsp;&nbsp;shapes(circle&nbsp;etc)&nbsp;  
&nbsp;&nbsp;  
&nbsp;plz&nbsp;help&nbsp;how&nbsp;to&nbsp;get&nbsp;the&nbsp;markers&nbsp;and&nbsp;related&nbsp;data&nbsp;wthin&nbsp;the&nbsp;shape&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;  
&nbsp;vivek

---

<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:** [March 19, 2012, 3:28pm UTC](https://community.thinkgeo.com/t/click-event-in-point-shape/5707/11 "2012-03-19T15:28:32Z")

</div>

Vivek,

&nbsp;You&nbsp;have&nbsp;to&nbsp;understand&nbsp;that&nbsp;Markers&nbsp;are&nbsp;use&nbsp;to&nbsp;represent&nbsp;points&nbsp;only.&nbsp;So,&nbsp;if&nbsp;you&nbsp;have&nbsp;a&nbsp;circle,&nbsp;a&nbsp;rectangle&nbsp;or&nbsp;a&nbsp;polygon,&nbsp;Marker&nbsp;is&nbsp;not&nbsp;the&nbsp;appropriate&nbsp;style.&nbsp;What&nbsp;you&nbsp;could&nbsp;do&nbsp;though,&nbsp;for&nbsp;example,&nbsp;you&nbsp;could&nbsp;get&nbsp;the&nbsp;center&nbsp;point&nbsp;of&nbsp;the&nbsp;shape&nbsp;and&nbsp;use&nbsp;a&nbsp;Marker&nbsp;to&nbsp;represent&nbsp;it&nbsp;as&nbsp;you&nbsp;can&nbsp;see&nbsp;in&nbsp;the&nbsp;code&nbsp;below.&nbsp;I&nbsp;don't&nbsp;know&nbsp;if&nbsp;this&nbsp;is&nbsp;what&nbsp;you&nbsp;want&nbsp;to&nbsp;do&nbsp;but&nbsp;I&nbsp;am&nbsp;giving&nbsp;you&nbsp;some&nbsp;ideas.

&nbsp;

`  SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay("MarkerOverlay");    markerOverlay.DragMode = MarkerDragMode.Drag;    markerOverlay.Markers.Add(new Marker(polygonShape.GetCenterPoint(), new WebImage(21, 25, -10.5f, -25f)));              Map1.CustomOverlays.Add(markerOverlay);`
