getodk / getodk/web-forms

Geolocation breaks when crossing longitude 180

Open
#873 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
38
Forks
22
PR merge metrics
No merged PRs in 30d

Description

### Expected Behaviour

It should be possible to create a shape that crosses over 180° longitude. Or if not, at least don't let me drag a point so that it breaks the UI.

### Observed Behaviour

A few bugs...
1. If you drag a point of a geoshape over the 180° then it wraps around to other side of the map (which is good) but then becomes uneditable.
2. If you use geofence on this shape then it produces unexpected results, because the point you moved is now at a negative longitude, not a positive one, so the geofence algorithm inverts the shape. For example, imagine you had a triangle in the shape of an arrow head pointing the the right and had a point inside the geofence. Now if you drag the third point over the 180° line then it "flips" the arrow to point to the left, and the point is no longer inside the geofence. This is unexpected.
3. If you drag a geopoint over, then it wraps to the other side of the map. If you drag it over the 180° a second time it disappears altogether.
4. It's quite difficult to move a point near the 180° line because the map doesn't all you to scroll past the 180° line so certain places are always stuck in the corner. #mapswithoutnz

Image

### Reproduction Steps

Form (XML or XLSX file): Any geoshape map

Steps:
1. Create a shape
2. Drag one of the points off to the right until it pops out of the left hand side
3. Try and select and move the point again

### Screenshots or Videos

### Environment

- Browser version: Firefox
- OS: Linux
- Web Forms version: 1.0.2

### Additional Context

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with any geoshape map by dragging a point across longitude 180°, then test selecting it again and using geofence behavior. Trace the geoshape map interaction and geofence handling; done means points remain editable, repeated crossings do not make them disappear, and shapes retain the expected geometry.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.