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;
}

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 ; }
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
