diff --git a/MAVProxy/modules/mavproxy_map/mp_slipmap_util.py b/MAVProxy/modules/mavproxy_map/mp_slipmap_util.py index 88f7e0e342..aff9d6853e 100644 --- a/MAVProxy/modules/mavproxy_map/mp_slipmap_util.py +++ b/MAVProxy/modules/mavproxy_map/mp_slipmap_util.py @@ -357,11 +357,10 @@ def draw(self, img, pixmapper, bounds): (lat,lon,w,h) = bounds # note that w and h are in degrees spacing = 1000 + lat2 = mp_util.constrain(lat+h*0.5,-85,85) + lon2 = mp_util.wrap_180(lon+w) + dist = mp_util.gps_distance(lat2,lon,lat2,lon2) while True: - start = mp_util.latlon_round((lat,lon), spacing) - lat2 = mp_util.constrain(lat+h*0.5,-85,85) - lon2 = mp_util.wrap_180(lon+w) - dist = mp_util.gps_distance(lat2,lon,lat2,lon2) count = int(dist / spacing) if count < 2: spacing /= 10.0 @@ -372,6 +371,8 @@ def draw(self, img, pixmapper, bounds): count += 10 + start = mp_util.latlon_round((lat,lon), spacing) + for i in range(count): # draw vertical lines of constant longitude pos1 = mp_util.gps_newpos(start[0], start[1], 90, i*spacing)