Skip to content

Commit

Permalink
Rename 'use_util' to 'as_vector' and update tooltip for feature colle…
Browse files Browse the repository at this point in the history
…ction form
  • Loading branch information
alukach committed Feb 13, 2025
1 parent bb046af commit ca7d52c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions ee_plugin/ui/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@ def add_feature_collection_form(
"e.g. <code>USGS/WBD/2017/HUC06</code>",
]
),
toolTip="This is a tooltip!",
whatsThis='This is "WhatsThis"! <a href="http://google.com">Link</a>',
),
QtWidgets.QLineEdit(objectName="feature_collection_id"),
QtWidgets.QLineEdit(
objectName="feature_collection_id",
whatsThis=(
"Attempt to retain the layer as a vector layer, running "
"the risk of encountering Earth Engine API limitations if "
"the layer is large. Otherwise, the layer will be added as "
"a WMS raster layer."
),
),
),
(
"Retain as a vector layer",
QtWidgets.QCheckBox(objectName="use_util"),
QtWidgets.QCheckBox(objectName="as_vector"),
),
],
),
Expand Down Expand Up @@ -121,7 +127,7 @@ def add_feature_collection(
end_date: Optional[str],
extent: Optional[tuple[float, float, float, float]],
viz_color_hex: str,
use_util: bool,
as_vector: bool,
):
"""
Loads and optionally filters a FeatureCollection, then adds it to the map.
Expand Down Expand Up @@ -152,7 +158,7 @@ def add_feature_collection(

# 6. Add to map
layer_name = f"FC: {feature_collection_id}"
if use_util:
if as_vector:
try:
utils.add_ee_vector_layer(fc, layer_name)
except ee.ee_exception.EEException as e:
Expand Down
2 changes: 1 addition & 1 deletion test/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_add_feature_collection_form(qgis_iface, form_input, expected_form_outpu
"end_date": None,
"extent": None,
"viz_color_hex": "#000000",
"use_util": False,
"as_vector": False,
}

callback.assert_called_once_with(**{**default_outputs, **expected_form_output})

0 comments on commit ca7d52c

Please sign in to comment.