Select to view content in your preferred language

How we know a graphic going out of visibility area?

2031
3
Jump to solution
09-10-2014 07:52 PM
JulieBiju
Occasional Contributor

Hi All,

In the webapplication, we have a feature called autorefresh. Autorefresh will giving the live position of vehicle movement within each 1 minute interval

A graphic(ball icon) display is available on the map based on the location of vehicle . Now in each one miniute this graphic is placing to different part of the map . Now my requirement is I want to refresh the map only when the graphic goes out of visible area. each one miniute map refreshing is taking time to load map each time. how we can understand that the graphic is out of mapcontrol area?

0 Kudos
1 Solution

Accepted Solutions
brettangel
Occasional Contributor II

Compare the XY of the vehicle to the current map extent.  If it falls outside of the current map extent zoom to the XY vehicle location.

View solution in original post

0 Kudos
3 Replies
brettangel
Occasional Contributor II

Compare the XY of the vehicle to the current map extent.  If it falls outside of the current map extent zoom to the XY vehicle location.

0 Kudos
JulieBiju
Occasional Contributor

Thank U so much  for your reply. Can u tell me how can I test this ?I tried the way like below but not success

MyMap.Extent.contains(graphic.Geometry) = True

0 Kudos
DominiqueBroux
Esri Frequent Contributor

You can try something like:

if (MyMap.Extent.Intersects(graphic.Geometry..Extent)) { ........

This should work if your graphic coordinates are in the same Spatial Reference as the map.

0 Kudos