latitude To Pixel - Android Map

Android examples for Map:Latitude Longitude

Description

latitude To Pixel

Demo Code


//package com.java2s;

public class Main {
    public static double latToPx(double lat, int zoom) {
        double siny = Math.sin(lat * Math.PI / 180);
        double y = Math.log((1 + siny) / (1 - siny));
        return (128 << zoom) * (1 - y / (2 * Math.PI));
    }/*from   ww w.  ja  v a  2 s .c  o m*/
}

Related Tutorials