RodMcLeay


How can I determine in code if an icon is visible or not at any time.

I can hide it or show it, and find out its position, but the position is still valid when the icon is hidden.




Re: Icon Hide/Show Status

Derrick


You could try the following:

Get the current mapview (VEMap.GetMapView)
Get the icon's latlong
Compare the latlong to the mapview's topleft and bottomright latlong to see if it's in view.

Code Snippet

view = map.GetMapView();
var topleft = view.TopLeftLatLong;
var bottomright = view.BottomRightLatLong;

var icon = shape.GetIconAnchor();

if(icon.Latitude < topleft.Latitude && icon.Latitude > bottomright.Latitude && icon.Longitude > topleft.Longitude && icon.Longitude < bottomright.Longitude)

{

//icon visible

}else

{

//not visible

}






Re: Icon Hide/Show Status

RodMcLeay

Thanks Derrick, I'll give that a shot.