Code example for Pair

0
        double originShift = 2 * Math.PI * 6378137 / 2.0;
        Double mx = lon * originShift / 180.0;
        Double my = Math.log(Math.tan((90 + lat) * Math.PI / 360.0)) / (Math.PI / 180.0);
 
        my = my * originShift / 180.0;
        return new Pair<Double, Double>(mx, my);
    } 
 
    /** 
     * Get bbox parameter from map view 
     * @param mapView 
     * @return 
     */ 
    public static String calculateBBox(MapView mapView) {
        int latitudeSpan = mapView.getLatitudeSpan();
        int longitudeSpan = mapView.getLongitudeSpan();
        int latitudeE6 = mapView.getMapCenter().getLatitudeE6();
        int longitudeE6 = mapView.getMapCenter().getLongitudeE6();
 
        int x1 = latitudeE6 - latitudeSpan / 2;
        int y1 = longitudeE6 - longitudeSpan / 2;