Skip to content

Add polygon, polyline, and rectangle support#67

Open
jimsafley wants to merge 9 commits intofeature/multi-locationfrom
feature/shape-support
Open

Add polygon, polyline, and rectangle support#67
jimsafley wants to merge 9 commits intofeature/multi-locationfrom
feature/shape-support

Conversation

@jimsafley
Copy link
Copy Markdown
Member

@jimsafley jimsafley commented May 7, 2026

Extends location support beyond point markers to include polygons, polylines, and rectangles. Shapes can be drawn, edited, labeled, and deleted on the item edit map, and render natively on browse, item show, and exhibit maps. Existing point locations and the geographic radius search are unaffected.

This release also redesigns map popups to match Omeka S Mapping style, and replaces the term "balloon" with "popup" throughout.

jimsafley added 6 commits May 6, 2026 23:51
Stores all location types as GeoJSON in a new geometry_json column,
with latitude and longitude computed from it for backward-compatible
address search. Enables the Leaflet.draw shape tools on the edit form,
adds Leaflet.deflate to collapse small shapes at low zoom, and updates
the browse map, item show page, exhibit layout, and static site export
to render shapes alongside point markers.
'Balloon' is legacy terminology; 'popup' is the standard term used
throughout the mapping library. Also switches CSS class names from
underscores to hyphens to match standard convention.
Add a gray full-bleed header (label or item title) to browse, item
show, and exhibit popups. Browse popup order: header → thumbnail →
title link → snippet. Exhibit popup: header → attachment body →
title link. Scope CSS with :has() to avoid affecting edit-form popups.
Remove theme-inherited dotted border-bottom from popup links.
Store the bounding box center as latitude/longitude on shape
_locationData so that _mapForm has coordinates to seed the initial
map view when re-rendering after a failed save. Previously, shapes
had no lat/lng in _locationData, causing the map to center at 0°N 0°E.
@jimsafley jimsafley requested a review from zerocrates May 7, 2026 21:10
@zerocrates zerocrates changed the base branch from master to feature/multi-location May 8, 2026 15:13
@zerocrates
Copy link
Copy Markdown
Member

I changed the base so this will be easier to look at in the interface.

jimsafley added 3 commits May 8, 2026 12:30
Simplify the listener that calls popup.update() after images load,
removing the dependency on Leaflet's private _panAnim API. Move it
from addMarker into addLayerFromGeometry so shapes get the same
treatment as markers.
Moves SR announcement logic from addMarker into
addLayerFromGeometry so it covers both markers and shapes.
Shapes now announce title, bounding box center coordinates,
and open/close status, consistent with markers.
The previous check accepted values like {"type":"Point"} (no coordinates)
or {"type":"LineString","coordinates":[]} which would cause PHP warnings
in beforeSave() and could crash the edit form when loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants