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.

Re: How to tell if a latitude-longitude coordinate is on the map view?

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;
}
Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!