GCRC / nunaliit

Nunaliit Atlas Framework
BSD 3-Clause "New" or "Revised" License
46 stars 15 forks source link

Option to populate "Geometry" textarea with current browser location coordinates #930

Open michaelchamu opened 4 years ago

michaelchamu commented 4 years ago

Hi, Would it be possible or worthwhile to add an extra button on the geometry editing toolbar which can allow users to autofill the geometry text area with the browser coordinates?

I am imagining a use case where contributors to an atlas are not exactly capable of drawing a feature using the available options i.e. point, line, polygon etc due to either screen real estate (making a submission via mobile) or lower understanding of how to pick the correct location point for their submission.

ahayes commented 4 years ago

Hi Michael. I think that would be a nice feature to add. We would probably include an extra button on the geometry editing toolbar to auto-fill the current location. It has not been a priority for us though because when we or our project partners are collecting information in the field, there is a preference for a focused data collection mobile app. We developed our Nunaliit Android project for this purpose. It is still not where I would like it for a 1.0 release, but it is functional for creating and synchronizing documents and uploading new multimedia attachments. It is able to fill in the current location when a document schema specifies the inclusion of a geometry attribute type.

ahayes commented 4 years ago

Just one other note that to dig into this, it would be worth looking at the javascript code for the gazetteer button on the editing toolbar. It implements the button, does a bunch more different stuff to obtain location information, and then populates the document with the geometry before the user saves.

I imagine asking the browser for its coordinates will be a much simpler task than what the gazetteer is doing to present a UI, query a server, etc. We also embed extra gazetteer info into the document that would not be necessary in this case. But presenting a button that kicks off your code, and returning coordinates and populating the document would look very similar.

I have tagged this request with the 2.3.0 milestone in the hopes that we can get to it in the future. We don't have the developer time to take this on ourselves right now but would welcome a pull request.