Created
October 18, 2010 07:59
-
-
Save galex/631894 to your computer and use it in GitHub Desktop.
geographical point
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.agherschon.moveinbxl.maps; | |
/** | |
* Represents a geographical point. | |
* As it is used with Google Maps, it has two more getters, which returns the values in x^E6. | |
* @author Alexandre Gherschon | |
*/ | |
public class Point { | |
private double latitude ; | |
private double longitude; | |
public Point(double latitude, double longitude) { | |
super(); | |
this.latitude = latitude; | |
this.longitude = longitude; | |
} | |
public void setLongitude(double longitude) { | |
this.longitude = longitude; | |
} | |
public double getLongitude() { | |
return longitude; | |
} | |
public void setLatitude(double latitude) { | |
this.latitude = latitude; | |
} | |
public double getLatitude() { | |
return latitude; | |
} | |
/** | |
* Google Maps API likes to get the latitude in x^E6 | |
* @return latitude^E6 | |
*/ | |
public double getLatitudeE6() { | |
return (latitude * 1000000) ; | |
} | |
/** | |
* Google Maps API likes to get the longitude in x^E6 | |
* @return longitude^E6 | |
*/ | |
public double getLongitudeE6() { | |
return (longitude * 1000000) ; | |
} | |
public String toString(){ | |
return this.getLatitude() + " , " + this.getLongitude(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment