Topic: Verify that the object is out of scope
Hello! Tell me how to check that the object is beyond the scope of the map camera? Using geographic coordinates for this purpose
You are not logged in. Please login or register.
Infinity Code Forum → Online Maps Help → Verify that the object is out of scope
Hello! Tell me how to check that the object is beyond the scope of the map camera? Using geographic coordinates for this purpose
Hello.
Get the coordinates of the corners of the map and compare it with your coordinate.
public static bool InMapView(double lng, double lat)
{
double tlx, tly, brx, bry;
OnlineMaps.instance.GetCorners(out tlx, out tly, out brx, out bry);
if (lat > tly || lat < bry) return false;
if (tlx < brx && (lng < tlx || lng > brx)) return false;
if (tlx > brx && lng < tlx && lng > brx) return false;
return true;
}
Thx!)
Now I used it. Thanks again for the help)
But it's not quite that. Do you have methods to get the camera corners that look at the map? After all, the map of the visibility boundary is wider than that of the camera. I would like to use the visibility of the camera.
Can you help? Thanks for any help)
Convert the geographic coordinate to a screen position, and compare with the screen size.
OnlineMapsControlBase.GetScreenPosition
http://infinity-code.com/doxygen/online … b35214c35b
Thank you so much!
Infinity Code Forum → Online Maps Help → Verify that the object is out of scope
Powered by PunBB, supported by Informer Technologies, Inc.