ThinkGeo.com    |     Documentation    |     Premium Support

Need a bound box for markers in each zoom level

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

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)).

Wish that’s helpful.

Regards,

Don

Don,

Thanks for the information; it is helpful.

Eric

Hi Eric,

Any question please let us know.

Regards,

Don