question: public static int convertLatmToY ( int latm ) { long v = Math . round ( ( Mercator . MAX_Y - Mercator . lat2y ( latm / LATLON_TO_LATLONM ) ) * MAX_AP_UNITS / ( Mercator . MAX_Y * 2 ) ) ; if ( v > MAX_AP_UNITS ) return MAX_AP_UNITS ; if ( v < 0 ) return - 1 ; return ( int ) v ; }
target:  Returns the y position based on latitude. Note that this is based of Mercator which will have infinite number of points approaching +/-90 degrees. So if we are out of range, (beyond the configured min/max latitude), we return -1 and MAX_AP_UNITS based on which direction we are out