pixel To Latitude - Android Map

Android examples for Map:Latitude Longitude

Description

pixel To Latitude

Demo Code


//package com.java2s;

public class Main {
    public static double pxToLat(double pixelY, int zoom) {
        double y = 2 * Math.PI * (1 - pixelY / (128 << zoom));
        double z = Math.pow(Math.E, y);
        double siny = (z - 1) / (z + 1);
        return Math.asin(siny) * 180 / Math.PI;
    }//from ww  w.ja va2s  .  co  m
}

Related Tutorials