Skip to content

Commit

Permalink
fix bbox calculation issue due to recent changes in get_latlon_at wor…
Browse files Browse the repository at this point in the history
…king with scale.
  • Loading branch information
tito committed May 28, 2015
1 parent 5314e73 commit 6545385
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mapview/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,9 @@ def get_bbox(self, margin=0):
"""Returns the bounding box from the bottom/left (lat1, lon1) to
top/right (lat2, lon2).
"""
scale = self._scale
x1, y1 = self.to_local(0 - margin, 0 - margin)
x2, y2 = self.to_local((self.width + margin) / scale,
(self.height + margin) / scale)
x2, y2 = self.to_local((self.width + margin),
(self.height + margin))
c1 = self.get_latlon_at(x1, y1)
c2 = self.get_latlon_at(x2, y2)
return Bbox((c1.lat, c1.lon, c2.lat, c2.lon))
Expand Down

0 comments on commit 6545385

Please sign in to comment.