Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display geopoint location on submission detail page #1791

Closed
spwoodcock opened this issue Sep 17, 2024 · 4 comments
Closed

Display geopoint location on submission detail page #1791

spwoodcock opened this issue Sep 17, 2024 · 4 comments
Assignees
Labels
bug Something isn't working effort:low Likely a few hours frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time

Comments

@spwoodcock
Copy link
Member

spwoodcock commented Sep 17, 2024

Follow on from #1730

Describe the bug

  • When a new feature is submitted as a geopoint, we can view it in the validation table.

    image

  • We don't have an easy way to validate the geometry location though.

  • Normally when a submission is viewed the geometry is loaded in an OpenLayers map, e.g.:

    image

  • However for the submitted geopoint, nothing is loaded:

    image

Solution

  const coordinatesArray: [number, number][] = restSubmissionDetails?.xlocation?.split(';').map(function (
    coord: string,
  ) {
    let coordinate = coord
      .trim()
      .split(' ')
      .slice(0, 2)
      .map((value: string) => {
        return parseFloat(value);
      });
    return [coordinate[1], coordinate[0]];
  });
  • This logic should be skipped if the new_feature_point key is present in the submission json:
{
        ... other fields
        "point": "yes",
	"new_feature_point": {
		"type": "Point",
		"coordinates": [
			0.19569001238613737,
			53.10334032909082,
			0
		],
		"properties": {
			"accuracy": 0
		}
	}
}
  • If present, handle the rendering differently by loading a Point in OpenLayers instead of a Polygon.
@spwoodcock spwoodcock added bug Something isn't working priority:low Backlog of tasks that will be addressed in time frontend Related to frontend code effort:low Likely a few hours labels Sep 17, 2024
@NSUWAL123 NSUWAL123 added the testing:ready Ready for testing label Sep 18, 2024
@manjitapandey
Copy link
Contributor

The geolocation is not visible in case where no location is provided while filling up of the form. This is actually a loophole on form that we allow user to not choose any feature as well as not provide any geolocation.
I believe this can be solved by slightly modifying the current xls form to make either geopoint or feature selection compulsory.

@manjitapandey manjitapandey added testing:fail Failed testing and removed testing:ready Ready for testing labels Sep 23, 2024
@spwoodcock
Copy link
Member Author

spwoodcock commented Sep 23, 2024

This actual issue is solved then right? (if the geometry is provided, then it's visible)

The issue you mentioned is another one that I will address with the XLSForm updates 👍

@NSUWAL123
Copy link
Contributor

Yes if the geometry is provided then it's visible

@spwoodcock
Copy link
Member Author

Fixed the XLSForm issue too by making the fields mandatory 👍

@spwoodcock spwoodcock added testing:ready Ready for testing and removed testing:fail Failed testing labels Sep 23, 2024
@spwoodcock spwoodcock removed the testing:ready Ready for testing label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort:low Likely a few hours frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time
Projects
Development

No branches or pull requests

3 participants