# Need a bound box for markers in each zoom level

**URL:** <https://community.thinkgeo.com/t/need-a-bound-box-for-markers-in-each-zoom-level/8240>\
**Category:** WPF\
**Created:** [October 18, 2016, 2:57pm UTC](https://community.thinkgeo.com/t/need-a-bound-box-for-markers-in-each-zoom-level/8240 "2016-10-18T14:57:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Liu](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/4bbf92/32.png) [@Eric\_Liu](https://community.thinkgeo.com/u/Eric_Liu)\
**Post date:** [October 18, 2016, 2:57pm UTC](https://community.thinkgeo.com/t/need-a-bound-box-for-markers-in-each-zoom-level/8240/1 "2016-10-18T14:57:11Z")

</div>

I created a class that inherits from Marker and the marker loads with an image file for icon.  
The marker has width and height set to 20.

One of my requirements is to handle the case that markers’ icons are intersect with each other.  
So if there is an efficient way, at each zoom level, I can have a RectangleShape that surrounding the marker?  
The bounding box or Rectangle shape of markers should have four points (in world coordinate and will be updated at each zoom level).

Any suggestion?

Thanks

---

<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:** [October 19, 2016, 3:15am UTC](https://community.thinkgeo.com/t/need-a-bound-box-for-markers-in-each-zoom-level/8240/2 "2016-10-19T03:15:45Z")

</div>

Hi Eric,

If you want to implement that, you should want to call ExtentHelper.GetWorldDistanceBetweenTwoScreenPoints to calculate a value X menas how long the width 10 will be in current extent.

Then use markerPoint.Buffer(X,…) to get the bouding box.

But I think you can directly do something like this:

loop your marker point location, call ExtentHelper.GetScreenDistanceBetweenTwoWorldPoints, if the value less than 28 just ignore that. (28 = sqrt(20x20 + 20x20)).

 ![](https://community.thinkgeo.com/uploads/default/original/3X/e/a/eaf4541470559e1f79bf117a1eb6b95bc95a5574.png)

Wish that’s helpful.

Regards,

Don

---

<div class="post-metadata">

**Author:** ![Eric\_Liu](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/4bbf92/32.png) [@Eric\_Liu](https://community.thinkgeo.com/u/Eric_Liu)\
**Post date:** [October 20, 2016, 2:07pm UTC](https://community.thinkgeo.com/t/need-a-bound-box-for-markers-in-each-zoom-level/8240/3 "2016-10-20T14:07:14Z")

</div>

Don,

Thanks for the information; it is helpful.

Eric

---

<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:** [October 21, 2016, 1:59am UTC](https://community.thinkgeo.com/t/need-a-bound-box-for-markers-in-each-zoom-level/8240/4 "2016-10-21T01:59:47Z")

</div>

Hi Eric,

Any question please let us know.

Regards,

Don
