omeka-s-modules / Mapping

GNU General Public License v3.0
8 stars 8 forks source link

Testing: "Map by groups" block #124

Open jimsafley opened 2 months ago

jimsafley commented 2 months ago

The map-by-groups-block-plus-optimization branch introduces the "Map by groups" block for site pages. With this block, users can view groups of items on a map, and click on an individual group to view its component items (or, more accurately, its items' features). For example, we have a map that contains item sets. When clicked, an item set will expand to all items that are assigned to that item set.

The module calculates a group's location on the map by collecting all its component features and generating what's called a convex hull around the outermost points. Administrators have the option to render a groups as a polygon (i.e. the convex hull) or as a central point of the polygon.

In addition to testing the new "Map by groups" block, you'll need to test the existing "Map by attachment" and "Map by query" blocks, including their timeline and WMS overlay features. This is due to major refactoring of the block code that I needed to do. After checking out the map-by-groups-block branch you should see no difference in your existing Mapping blocks: same configuration, same behavior, and same output.

To test this block, add the new "Map by groups" block to a page. You should see the normal "Default view" and "WMS overlays" sections and a new "Groups" section that contains the following fields:

Once a user selects a "Group by" the form should expand with fields. The fields that appear depend on what the user selects.

Item sets

Resource classes

Property values (is exactly)

Property values (contains)

Property values (is item with ID)

Properties (has any value)

After you have configured a "Map by groups" block (you should test every combination), view the public page. You should see a map with groups rendered as polygons or points, depending on how you configured it. Verify that each group represents every item in the group. Click on a group and verify that the popup content makes sense for the group. Click on the "Show all" button and verify that the map reloads, rendering all component features. This map should behave identically to the existing "Map by" blocks. Click on the "Return to groups" button and verify that the map reloads, rendering the original groups.

allanaaa commented 1 week ago
  1. Clicking on the "View all results" doesn't re-zoom the map to contain them, so that's a bit disorienting.

  2. When you click, the text bars/button appear above and below the map, which means the map moves around on the page. We probably don't want to have a container grow or shrink in height when clicked. Maybe we can overlay the results info on the map in some way - or just reserve empty space for it somewhere.

I wonder if a "Map by groups" block should have some kind of title or text to indicate what's going on inside. So perhaps if there is always a text box indicating the selection of the "Group by" dropdown ("Items grouped by resource class / [property name] / etc" which then changes to the selected grouping on click would solve both problems. I like that you have it styled consistenly with a search result indicator, and I'd keep that if we can.

allanaaa commented 1 week ago
  1. I am unsure how the "Group by property (has any value)" is supposed to work - this is by definition only going to load one group, right?

  2. Setting a block to "Group by property (has any value)" with "Date" and no filters or other settings got me the following error:

Error Call to a member function displayTitle() on null

Details:

Error: Call to a member function displayTitle() on null in /var/www/html/amayer/amayer-s/omeka-s/modules/Mapping/view/common/mapping-popup/property-ex-group.phtml:20 Stack trace:

0 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(519): include()

1 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/Helper/Partial.php(63): Laminas\View\Renderer\PhpRenderer->render(NULL, NULL)

2 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(407): Laminas\View\Helper\Partial->__invoke('common/mapping-...', Array)

3 /var/www/html/amayer/amayer-s/omeka-s/modules/Mapping/view/common/block-layout/mapping-block-groups.phtml(14): Laminas\View\Renderer\PhpRenderer->__call('partial', Array)

4 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(519): include('/var/www/html/a...')

5 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/Helper/Partial.php(63): Laminas\View\Renderer\PhpRenderer->render(NULL, NULL)

6 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(407): Laminas\View\Helper\Partial->__invoke('common/block-la...', Array)

7 /var/www/html/amayer/amayer-s/omeka-s/modules/Mapping/src/Site/BlockLayout/MapGroups.php(112): Laminas\View\Renderer\PhpRenderer->__call('partial', Array)

8 /var/www/html/amayer/amayer-s/omeka-s/application/src/View/Helper/BlockLayout.php(158): Mapping\Site\BlockLayout\MapGroups->render(Object(Laminas\View\Renderer\PhpRenderer), Object(Omeka\Api\Representation\SitePageBlockRepresentation))

9 /var/www/html/amayer/amayer-s/omeka-s/application/src/View/Helper/PageLayout.php(85): Omeka\View\Helper\BlockLayout->render(Object(Omeka\Api\Representation\SitePageBlockRepresentation))

10 /var/www/html/amayer/amayer-s/omeka-s/application/view/omeka/site/page/content.phtml(1): Omeka\View\Helper\PageLayout->render(Object(Omeka\Api\Representation\SitePageRepresentation))

11 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(519): include('/var/www/html/a...')

12 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/View.php(194): Laminas\View\Renderer\PhpRenderer->render(NULL)

13 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/View.php(222): Laminas\View\View->render(Object(Laminas\View\Model\ViewModel))

14 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/View.php(187): Laminas\View\View->renderChildren(Object(Laminas\View\Model\ViewModel))

15 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/View.php(222): Laminas\View\View->render(Object(Laminas\View\Model\ViewModel))

16 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-view/src/View.php(187): Laminas\View\View->renderChildren(Object(Laminas\View\Model\ViewModel))

17 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/View/Http/DefaultRenderingStrategy.php(98): Laminas\View\View->render(Object(Laminas\View\Model\ViewModel))

18 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Laminas\Mvc\MvcEvent))

19 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent))

20 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(360): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\Mvc\MvcEvent))

21 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(341): Laminas\Mvc\Application->completeRequest(Object(Laminas\Mvc\MvcEvent))

22 /var/www/html/amayer/amayer-s/omeka-s/index.php(21): Laminas\Mvc\Application->run()

23 {main}

jimsafley commented 4 days ago
  1. Clicking on the "View all results" doesn't re-zoom the map to contain them, so that's a bit disorienting.

Strange. It should set a map view that contains all the features. Do you see a JS error in the console after clicking "View all results"?

  1. When you click, the text bars/button appear above and below the map, which means the map moves around on the page. We probably don't want to have a container grow or shrink in height when clicked. Maybe we can overlay the results info on the map in some way - or just reserve empty space for it somewhere.

We can't sacrifice the space in the map itself, but reserving empty space might be a good idea. @kimisgold What are your thoughts?

  1. I am unsure how the "Group by property (has any value)" is supposed to work - this is by definition only going to load one group, right?

It has as many groups as there are properties you set (that have any value).

  1. Setting a block to "Group by property (has any value)" with "Date" and no filters or other settings got me the following error:

Glad you caught that. It should be fixed now.

kimisgold commented 3 days ago

I do like the idea of reserving space. We could provide options for a horizontal bar across the top or a panel to the right or left.

Screenshot 2024-11-19 at 3 25 42 PM image
jimsafley commented 1 day ago

I do like the idea of reserving space. We could provide options for a horizontal bar across the top or a panel to the right or left.

I think we should provide only a horizontal bar across the top, at least for now.

kimisgold commented 21 hours ago

The changes are in. Right now, it's hard to get around that top bar appearing and changing the block height after a group is selected. I'd like to float the idea of an additional input in that same area upon load: a select dropdown where the user can choose from the groups available. This might be especially handy if there are polygon overlays that overlap each other.

jimsafley commented 19 hours ago

I'd like to float the idea of an additional input in that same area upon load: a select dropdown where the user can choose from the groups available.

Do you mean above the groups map, above the group items map, or both? At any rate, I see the usefulness of it, but it'll have to wait for a future release.

kimisgold commented 16 hours ago

Above the groups map. It'll help with overlapping group polygons as well as maintaining a consistent height for the block since I envision it sitting in the same space as the group items controls.