Skip to content

Commit

Permalink
gui: restrict north/south to 90/-90 and west/east to -180/180 (#1881)
Browse files Browse the repository at this point in the history
* gui: restrict north/south to 90/-90 and west/east to -180/180

* Adjust the region extent only for LL locations

* Black formatted
  • Loading branch information
HuidaeCho committed Jun 3, 2023
1 parent 19ab2f3 commit ffb6e51
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gui/wxpython/core/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ def _fitAspect(self, region, size):
region["west"] = center - delta + region["west"]
region["e-w resol"] = region["n-s resol"]

if region["proj"] == 3: # LL locations
region["east"] = min(region["east"], 180.0)
region["west"] = max(region["west"], -180.0)

else:
delta = region["e-w resol"] * size["rows"] / 2

Expand All @@ -262,6 +266,10 @@ def _fitAspect(self, region, size):
region["south"] = center - delta + region["south"]
region["n-s resol"] = region["e-w resol"]

if region["proj"] == 3: # LL locations
region["north"] = min(region["north"], 90.0)
region["south"] = max(region["south"], -90.0)

def Abort(self):
"""Abort rendering process"""
Debug.msg(1, "RenderWMSMgr({0}).Abort()".format(self.layer))
Expand Down

0 comments on commit ffb6e51

Please sign in to comment.