Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn on other needed implementations #1865

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 18 additions & 25 deletions mslib/msui/wms_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -1478,27 +1478,24 @@ def append_multiple_images(self, imgs):
"""
images = [x for x in imgs if x]
if images:
# Add border around seperate legends
if len(images) > 1:
images = [ImageOps.expand(x, border=1, fill="black") for x in images]
max_height = int((self.view.fig.get_size_inches() * self.view.fig.get_dpi())[1] * 0.99)
width = max([image.width for image in images])
height = sum([image.height for image in images])
result = Image.new("RGBA", (width, height))
current_height = 0
for i, image in enumerate(images):
result.paste(image, (0, current_height - i))
current_height += image.height

if max_height < result.height:
result.thumbnail((result.width, max_height), Image.ANTIALIAS)
return result

################################################################################

#
# CLASS VSecWMSControlWidget
#
if hasattr(self.view, 'fig') is False:
QtWidgets.QMessageBox.warning(self, self.tr("Web Map Service"), "We have only fig implemented")
else:
# Add border around seperate legends
if len(images) > 1:
images = [ImageOps.expand(x, border=1, fill="black") for x in images]
max_height = int((self.view.fig.get_size_inches() * self.view.fig.get_dpi())[1] * 0.99)
width = max([image.width for image in images])
height = sum([image.height for image in images])
result = Image.new("RGBA", (width, height))
current_height = 0
for i, image in enumerate(images):
result.paste(image, (0, current_height - i))
current_height += image.height

if max_height < result.height:
result.thumbnail((result.width, max_height), Image.ANTIALIAS)
return result


class VSecWMSControlWidget(WMSControlWidget):
Expand Down Expand Up @@ -1579,10 +1576,6 @@ def is_layer_aligned(self, layer):
crss = getattr(layer, "crsOptions", None)
return crss is not None and any(crs.startswith("VERT") for crs in crss)

#
# CLASS HSecWMSControlWidget
#


class HSecWMSControlWidget(WMSControlWidget):
"""Subclass of WMSControlWidget that extends the WMS client to
Expand Down