Topic: How to tell if a latitude-longitude coordinate is on the map view?
Is there a way to determine if a lat/long coordinate is on the currently visible map view?
If so what is it? If not, how can one do that?
Thanks.
You are not logged in. Please login or register.
Infinity Code Forum → Online Maps Help → How to tell if a latitude-longitude coordinate is on the map view?
Is there a way to determine if a lat/long coordinate is on the currently visible map view?
If so what is it? If not, how can one do that?
Thanks.
Hello.
Example:
public static bool InMapView(double longitude, double latitude)
{
double tlx, tly, brx, bry;
OnlineMaps.instance.GetCorners(out tlx, out tly, out brx, out bry);
if (latitude > tly || latitude < bry) return false;
if (tlx > brx)
{
if (longitude < tlx) tlx -= 360;
else brx += 360;
}
return longitude >= tlx && longitude <= brx;
}
Infinity Code Forum → Online Maps Help → How to tell if a latitude-longitude coordinate is on the map view?
Powered by PunBB, supported by Informer Technologies, Inc.