Skip to content

Testing: multi-location and shape support #71

Description

@jimsafley

The master branch now lets an item have multiple locations instead of just one, and lets a location be a shape (a polygon, polyline, or rectangle), not only a single marker. The sections below check both, everywhere locations are shown or edited.

The item edit map

Open an item to edit and find the map, which has tools for adding a marker, drawing shapes, and editing or deleting what's on it.

Add a marker, save, and reopen the item; the marker should still be there. Add several markers to one item and save; all of them should come back. Move a marker and save; it should stay where you put it. Delete a marker and save; it should be gone.

Do the same with shapes: a polygon, a polyline, and a rectangle. Give one a label and save; on reopening, the shape should still be there and the label should show when you click it. Also put a mix of markers and shapes on one item to confirm they save together, reshape a shape to confirm the change sticks, and delete a shape to confirm it's removed.

The item page

Open the public page of an item that has locations. Its map should show all of that item's markers and shapes. If a location has a label, clicking it opens a small popup showing that label; locations without a label show no popup.

The Map page

Open the site's Map page. It shows the markers and shapes for the items on the current page.

If the item list is enabled (shown by default), it appears beside the map. An item with more than one location (or a single labeled one) shows its name with its locations listed beneath, each named by its label or a number; an item with a single unlabeled location is just one line.

Click a location in the list to move the map to it and open its popup, showing the item's image, title, and description; clicking a marker or shape on the map does the same. The location you clicked stays marked in the list so you can see which one you're viewing.

The Geolocation plugin's settings include a new option to show or hide this list; turning it off should remove the list and let the map fill the width, and turning it back on should restore it.

As you zoom out, shapes shrink to a single marker, and zooming back in restores them. If clustering is on in the settings, nearby markers and collapsed shapes gather into a numbered circle that separates them when you click it.

Exhibit Builder and Contribution

In the Exhibit Builder plugin, add the Geolocation map layout to an exhibit page and confirm it shows the markers and shapes with working popups.

In the Contribution plugin, turn on "add map to contribution form" in the Geolocation settings, then confirm the public "contribute an item" form shows the same map, and that a contributor can add markers and shapes that save with their submission.

What should still work

Items that already had a location before this update should still show it correctly on every map. Turning clustering on and off in the settings should both work without obvious errors, on an item's page and on the Map page.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions