OpenWaterFoundation / owf-app-infomapper-ng

Open Water Foundation InfoMapper web application for menu-driven maps and visualizations, using Angular
GNU General Public License v3.0
1 stars 2 forks source link

Add layer search tool #305

Closed smalers closed 3 years ago

smalers commented 3 years ago

The StateMod viewer has a lot of stations and it difficult to find one of interest in order to view a graph. A tool is needed to search the layer attributes for match. See issue #169, which has more general requirements. Getting a search tool working for one layer first will help with a general tool. The following are technical considerations:

  1. Talk to Catherine about what she did for NovaStar. Either the appearance of the layer must be changed, such as for highlights, or a separate temporary layer must be added.
  2. Need to evaluate whether to visually highlight and call it good, or also auto-zoom to the extent of matched features, with a buffer. This is an issue when the map has been zoomed in and need to zoom out to display the features.
  3. Could add to the layer kebob menu. Or, use the data table find feature and have the map synchronize selection somehow?
  4. Should also look at some ArcGIS online maps. I can find examples.
smalers commented 3 years ago

I talked to Catherine. My understanding is that she uses a separate layer to track selected items. So, on the layer side, maybe do the following for design:

  1. Each displayed layer can have a companion "selected features" layer that is only populated if features for the layer are selected. Whether this is an actual data member of layer (derive a new class that extends Leaflet layer?) or parallel data that is manged with layer ID needs to be determined. All features in the selected features layer would be read only and for display only.
  2. Can the data table find tool be used to narrow down the search and then add a button or kebob menu with "Select on Map"? That seems like an option rather than reinventing search functionality. Of course, additional search tools may be added in the future such as finding features within a radius around a point, so need to keep in mind how that might be done.
  3. Once the selected features layer is constructed, show on the map immediately before the layer that it is associated. Use a symbol like a red ring. See issue #169 for original thoughts and NovaStar search tool. Enter "carr" or "powers" to see result. For now figure out some hard-coded symbol that works. We might need to configure and can add that later if necessary.
  4. Might need "Show on map" and "Show on map and zoom" options?
  5. Need a way to clear selections, maybe a "Clear selections" item in the layer kebob menu?
  6. Selections could be done on multiple layers so maybe need a "Clear selections" at the map level, such as kebob menu to keep consistent.
  7. If a global search across the map is needed, things will be more complicated but maybe that feature won't be needed for awhile.
Nightsphere commented 3 years ago

The new branch has been merged with the updates for the layer search tool. The only layers that are currently supported are points, built-in images, and images. Searching will commence on pressing the enter key in the search bar. Deleting everything in the search bar will automatically toggle off all highlights on the map, as will closing the data table dialog. Highlighting is not yet implemented for lines or polygons yet.

Zoom to the entire layer, and zooming to selected features of the layer for point, built-in images and images has also been pushed. Clicking on the kebab menu in the lower right of the dialog will and selecting Zoom to Feature(s) will do the trick. Again, lines and polygons have not been updated to the zooming function as of yet.

smalers commented 3 years ago

The main issue I see is that if the data table is used for search, it is kind of big and not resizable. A typical use case is to use the table to search and then zoom to the features. Then I want to close the data table to have the map not be obscured. But then the selections go away. It may also be useful to have selections from multiple layers at the same time. So, I am thinking that automatically clearing selections when the data table closes is actually bad. What about adding "Clear selections" kebab menu on the layer? It could be added similar on the map, but at the moment there is no kebab menu on the map.

Being able to resize the dialog would help, or maybe get into the habit of sliding to the bottom? Or, if there was a way to minimize the dialog and have it "dock" in the window, using the window manager as if a virtual desktop?

smalers commented 3 years ago

More feedback based on latest version:

  1. The selected triangle symbol did not seem to align wrll and was hard to see in the StateMod viewer. This may need to be refined. I agree that if the marker is a shape that trying to show a border is probably OK. There may be integer math for small symbols that requires adding more buffer to make sure the edge shows up.
  2. Maybe the legend should show the selected symbol next to the normal symbol and a note like "(2 selected)". This could work for single symbol. However, for category and graduated symbol, what then? add a symbol at the top of the list?
  3. The layer data table seems to have more border at the bottom. The dialogs generally need to be as compact as possible while not looking cramped. Look at GitHub and other sites to see button sizes, font sizes, and borders/buffers.
  4. The [StateMod viewer]() has an issue that the order of line layers is wrong. The Instream Flow Reaches should be drawn below the Stream Reaches layer. See the image below.
  5. If you don't know to press Enter to cause the filter to occur, you could be confused. Maybe need a tooltip or Info popup explaining that. If a dialog, it would be modal.
  6. Select checkboxes are now enabled. What do those apply to? Does download do the whole table or only selected? What else might checkboxes be used for? Copy/paste? They do make it easier to work with data than trying to highlight cells.
  7. Might want to disable menus or not show if they are not relevant. For example, don't show "Zoom to Feature(s)" for layer types that do not support that.
  8. Zoom to Features causes USGS topo map to go beyond what it can handle and the background turns grey. We might need to add a property for background layers for maximum zoom so that tools like zoom to feature work well. Let's discuss.

image

Nightsphere commented 3 years ago

A new push has been done with fixes/updates to issues 3 and 7 from the above message.

I also forgot that there are 6 dialogs, not 5 as previously thought. The one I forgot is a documentation markdown dialog, created when there is an info button on the layer. Before this push, the dialog could be resized to any dimension, and the upper close button positioning did not work well.

A maximum and minimum height and width has been added with this push, and the dialog now works as well as the 4 other dialogs. So now, 5 out of 6 dialogs can now be resized, with the exception of the time series graph dialog mentioned in an earlier comment. I'll attempt to work on the other feedback points

smalers commented 3 years ago

I added zoomLevelMax property to the layer in the GeoProcessor GeoMapProject documentation and published to OWF AWS cloud.

smalers commented 3 years ago

Also, is it possible to disable the "Clear selections" layer kebab menu if no features are selected?

smalers commented 3 years ago

The use of words matched and selected for layer data table is confusing. Consider making the following changes:

  1. Since the checkbox is not yet enabled, the filter match is the same as selected. Therefore the label could be 3 selected and change the kebab menu to Zoom to selected features.
  2. If checkboxes are enabled, can change to 3 matched, 1 selected and Zoom to selected features will still make sense.
  3. If that is not enough, we can reconsider.
  4. Maybe disable the zoom menu item if the number selected is the same as the total, but maybe it is ok as long as in that case the total number and number selected are the same so user knows.
  5. Clearly need to make the connection that using zoom to selected features will cause a select on the map so strategic use of the word select is important.
  6. Zooming to features when no filter zooms but does not select on the map. Given what I have said above, we need to figure out the behavior. Maybe "matched" is OK but the menu needs to say "Zoom to and select features" since that is what causes the actual select? Then a second menu could just be "Zoom to features".
  7. Let's discuss before anything is done.
smalers commented 3 years ago

I suggest changing the filter text to: Filter all columns using the filter string. Press Enter to execute the filter. or maybe Filter all columns using the filter string. Press Enter to execute the filter and show on map.

This will suffice rather than a tooltip or help.

Also, change so that show on map has a larger buffer. If only one point is found it zooms in too far and there is not enough context to know where you are. Maybe if one point always have a buffer of a mile on each side? A good test is Bonanza City on the municipalities map.

smalers commented 3 years ago

After thinking about it some more, how about this for the label. In this example, the filter has been used and results in 50 rows shown.

110 rows, 50 rows from filter, 50 rows selected

If the filter is not used, then the text would say:

110 rows, 110 rows from filter, 110 rows selected

The above will work without the checkboxes. Then the kebab menu can say Zoom to selected features.

If the checkboxes are implemented, the same label can be used and an additional menu Zoom to filter results can be added. Using the checkboxes will be an additional level of selection.

If the checkboxes are easy to enable, then do it and all of the above makes sense, right?

Nightsphere commented 3 years ago

The language has been updated to

110 rows, 110 rows selected from filter

The implementation of the check boxes presented too many issues to be looked into right now, and it's not a high priority, so the filter and selected options were combined so the other buttons and text options still made sense.

Nightsphere commented 3 years ago

The core functionality of this issue has been completed. Any other issues can be opened up to work on more granular issues in the future. Closing this issue.