# Avoiding overlapping features

**URL:** <https://community.thinkgeo.com/t/avoiding-overlapping-features/1448>\
**Category:** WinForms\
**Created:** [October 4, 2010, 10:41pm UTC](https://community.thinkgeo.com/t/avoiding-overlapping-features/1448 "2010-10-04T22:41:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/f0a364/32.png) [@John2](https://community.thinkgeo.com/u/John2)\
**Post date:** [October 4, 2010, 10:41pm UTC](https://community.thinkgeo.com/t/avoiding-overlapping-features/1448/1 "2010-10-04T22:41:00Z")

</div>

&nbsp;Hi,

I&nbsp;am&nbsp;trying&nbsp;to&nbsp;draw&nbsp;a&nbsp;number&nbsp;of&nbsp;images&nbsp;(32x32)&nbsp;onto&nbsp;an&nbsp;InMemortFeatureLayer.&nbsp;I&nbsp;have&nbsp;done&nbsp;this&nbsp;by&nbsp;inheriting&nbsp;my&nbsp;own&nbsp;PointStyle&nbsp;class&nbsp;and&nbsp;overriding&nbsp;the&nbsp;DrawCore.

This&nbsp;works&nbsp;very&nbsp;well,&nbsp;however&nbsp;I&nbsp;sometime&nbsp;need&nbsp;multiple&nbsp;images&nbsp;at&nbsp;the&nbsp;same&nbsp;point.&nbsp;So&nbsp;here&nbsp;is&nbsp;what&nbsp;i&nbsp;want&nbsp;to&nbsp;do.

Draw&nbsp;small&nbsp;dot&nbsp;at&nbsp;the&nbsp;actual&nbsp;X,Y&nbsp;location&nbsp;(i&nbsp;have&nbsp;done&nbsp;this&nbsp;already&nbsp;)

Draw&nbsp;the&nbsp;images&nbsp;but&nbsp;offset&nbsp;them&nbsp;so&nbsp;that&nbsp;the&nbsp;do&nbsp;not&nbsp;overlap

Draw&nbsp;a&nbsp;small&nbsp;line&nbsp;from&nbsp;the&nbsp;where&nbsp;offset&nbsp;image&nbsp;to&nbsp;the&nbsp;small&nbsp;black&nbsp;dot.

&nbsp;

Any&nbsp;thoughts&nbsp;on&nbsp;how&nbsp;this&nbsp;could&nbsp;be&nbsp;done&nbsp;?

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [October 5, 2010, 9:19am UTC](https://community.thinkgeo.com/t/avoiding-overlapping-features/1448/2 "2010-10-05T09:19:43Z")

</div>

&nbsp;

John,  
I&nbsp;think&nbsp;your&nbsp;idea&nbsp;is&nbsp;pretty&nbsp;good,&nbsp;but&nbsp;a&nbsp;little&nbsp;complex&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;draw&nbsp;a&nbsp;small&nbsp;line&nbsp;from&nbsp;the&nbsp;offset&nbsp;image&nbsp;to&nbsp;the&nbsp;black&nbsp;dot.&nbsp;Drawing&nbsp;Line&nbsp;requires&nbsp;the&nbsp;LineStyle,&nbsp;here&nbsp;are&nbsp;some&nbsp;hints:  
1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Drawing&nbsp;black&nbsp;dot&nbsp;is&nbsp;simple&nbsp;and&nbsp;can&nbsp;be&nbsp;implemented&nbsp;by&nbsp;the&nbsp;default&nbsp;PointStyle.  
2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;As&nbsp;we&nbsp;have&nbsp;known,&nbsp;the&nbsp;PointSytle&nbsp;draw&nbsp;the&nbsp;points&nbsp;based&nbsp;on&nbsp;the&nbsp;features,&nbsp;in&nbsp;other&nbsp;words,&nbsp;we&nbsp;need&nbsp;to&nbsp;split&nbsp;the&nbsp;actual&nbsp;point&nbsp;two&nbsp;different&nbsp;points,&nbsp;both&nbsp;of&nbsp;them&nbsp;has&nbsp;an&nbsp;offset&nbsp;to&nbsp;the&nbsp;actual&nbsp;point.&nbsp;To&nbsp;determine&nbsp;the&nbsp;offset,&nbsp;I&nbsp;think&nbsp;we&nbsp;can&nbsp;select&nbsp;a&nbsp;proper&nbsp;screen&nbsp;distance,&nbsp;such&nbsp;as&nbsp;10&nbsp;Pixel,&nbsp;and&nbsp;then&nbsp;convert&nbsp;the&nbsp;10&nbsp;Pixel&nbsp;into&nbsp;world&nbsp;distance&nbsp;based&nbsp;on&nbsp;current&nbsp;extent.&nbsp;Here&nbsp;is&nbsp;the&nbsp;method&nbsp;that&nbsp;can&nbsp;help&nbsp;us:&nbsp;  
ExtentHelper.GetWorldDistanceBetweenTwoScreenPoints  
3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create&nbsp;two&nbsp;offset&nbsp;Line&nbsp;Features&nbsp;and&nbsp;one&nbsp;LineStyle&nbsp;to&nbsp;draw&nbsp;the&nbsp;line&nbsp;that&nbsp;pointer&nbsp;to&nbsp;the&nbsp;black&nbsp;dot.  
&nbsp;  
Hope&nbsp;the&nbsp;above&nbsp;is&nbsp;helpful&nbsp;to&nbsp;you.&nbsp;Thanks,  
&nbsp;  
Johnny  
&nbsp;  
&nbsp;
