convert longitude To Pixel - Java java.lang

Java examples for java.lang:Math Convert

Description

convert longitude To Pixel

Demo Code


//package com.java2s;

public class Main {
    static private int map_offset = 268435456;
    static private double map_radius = map_offset / Math.PI;

    static public int convertLngToPixel(double lng) {
        return (int) Math.round(map_offset + map_radius * lng * Math.PI
                / 180);//from w  w  w.j a v  a 2 s.  co  m
    }
}

Related Tutorials