mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
8f93956ff1
- From zoom level 20 to 1, once find a size that contains the whole boundary, then the size will be used to retrieve map image from google #story[928]
45 lines
898 B
Java
45 lines
898 B
Java
package seng302.models.map;
|
|
|
|
/**
|
|
* The Boundary class represents a rectangle territorial boundary on a map. It
|
|
* contains four extremity double values(N, E, S, W). N and S are represented as
|
|
* latitudes in radians. E and W are represented as longitudes in radians.
|
|
*
|
|
* Created by Haoming on 10/5/17
|
|
*/
|
|
public class Boundary {
|
|
|
|
private double northLat, eastLng, southLat, westLng;
|
|
|
|
public Boundary(double northLat, double eastLng, double southLat, double westLng) {
|
|
this.northLat = northLat;
|
|
this.eastLng = eastLng;
|
|
this.southLat = southLat;
|
|
this.westLng = westLng;
|
|
}
|
|
|
|
double getCentreLat() {
|
|
return (northLat + southLat) / 2;
|
|
}
|
|
|
|
double getCentreLng() {
|
|
return (eastLng + westLng) / 2;
|
|
}
|
|
|
|
double getNorthLat() {
|
|
return northLat;
|
|
}
|
|
|
|
double getEastLng() {
|
|
return eastLng;
|
|
}
|
|
|
|
double getSouthLat() {
|
|
return southLat;
|
|
}
|
|
|
|
double getWestLng() {
|
|
return westLng;
|
|
}
|
|
}
|