mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Added methods to calculate optimal map size given a geo boundary.
- 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]
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package seng302.models.map;
|
||||
|
||||
/**
|
||||
* The Boundary class represents a square territorial bound 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.
|
||||
* 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
|
||||
*/
|
||||
@@ -18,27 +18,27 @@ public class Boundary {
|
||||
this.westLng = westLng;
|
||||
}
|
||||
|
||||
public double getCentreLat() {
|
||||
double getCentreLat() {
|
||||
return (northLat + southLat) / 2;
|
||||
}
|
||||
|
||||
public double getCentreLng() {
|
||||
double getCentreLng() {
|
||||
return (eastLng + westLng) / 2;
|
||||
}
|
||||
|
||||
public double getNorthLat() {
|
||||
double getNorthLat() {
|
||||
return northLat;
|
||||
}
|
||||
|
||||
public double getEastLng() {
|
||||
double getEastLng() {
|
||||
return eastLng;
|
||||
}
|
||||
|
||||
public double getSouthLat() {
|
||||
double getSouthLat() {
|
||||
return southLat;
|
||||
}
|
||||
|
||||
public double getWestLng() {
|
||||
double getWestLng() {
|
||||
return westLng;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user