diff --git a/ground_station/resources/core/mapping.py b/ground_station/resources/core/mapping.py index 0ea8f62..a17bbd9 100644 --- a/ground_station/resources/core/mapping.py +++ b/ground_station/resources/core/mapping.py @@ -124,9 +124,8 @@ class GMapsStitcher(object): def _pixels_to_lat(self, iterator, lat_pixels): # Magic Lines - degree = self._pixels_to_degrees((iterator - self.num_tiles / 2) * _TILESIZE, self.zoom) - temp = math.atan(math.exp(((lat_pixels + degree) - _EARTHPIX))/ _PIXRAD) - return math.degrees(math.pi / 2 - 2 * temp) + return math.degrees(math.pi / 2 - 2 * math.atan( + math.exp(((lat_pixels + self._pixels_to_degrees((iterator - self.num_tiles / 2) * _TILESIZE, self.zoom)) - _EARTHPIX) / _PIXRAD))) def fetch_tiles(self): # cap floats to precision amount diff --git a/ground_station/resources/core/mappingtest.py b/ground_station/resources/core/mappingtest.py index 12ad56c..8d1b16e 100644 --- a/ground_station/resources/core/mappingtest.py +++ b/ground_station/resources/core/mappingtest.py @@ -1,5 +1,5 @@ import mapping -obj = mapping.GMapsStitcher(10000, 10000, 44.57078, -123.275998, 21, 'terrain', 200) +obj = mapping.GMapsStitcher(1, 1, 44.57078, -123.275998, 18, 'terrain', None, 20) obj.fetch_tiles() \ No newline at end of file