getodk / getodk

Wiki and Issues (copied from https://code.google.com/p/opendatakit/)
https://getodk.org/
Apache License 2.0
121 stars 70 forks source link

Getting location by click on a map #827

Closed mitchellsundt closed 9 years ago

mitchellsundt commented 9 years ago

Originally reported on Google Code with ID 826

As requested on the formhub community forum (https://groups.google.com/d/msg/formhub-users/vUM_-W49OgI/fu0V-zLk1zEJ),
I would like to collect location data, but not (or not only) with GPS, but clicking
on an interactive map (google map).
It seems to be impossible now.
(data will be collected in ODK Collect).
Thanks

Reported by montagnersylvain on 2013-05-15 10:21:24

mitchellsundt commented 9 years ago
I wish to provide some clarification on this matter, in order to contextualize.
We wish to collect data of fauna and flora. When the observer collect a specie, it
is not exactly accurate his place, but often a few tens (hundreds) of meters.
So, have a clickable map (satellite view) would be very appropriate to collect the
data.

Reported by montagnersylvain on 2013-05-27 15:58:09

mitchellsundt commented 9 years ago
The core team does not have the resources to implement this. It requires a new widget
written in Java. We would gladly accept a code contribution developed and released
under the Apache2 License.

Google Maps does not currently allow satellite imagery to be accessed off-line (you
need a wireless connection).

However, sometime this summer (according to a presentation at Google I/O 2013), they
will release an updated Android library that will enable the offline access to a map
 Once this Android library is released, it would be feasible to develop this new widget.

One caveat: generating the offline-accessible map data will require Google Maps Enterprise
-- something that may be too costly for most non-profits and NGOs (or perhaps Google
would provide support to them?)?

Reported by mitchellsundt on 2013-06-04 20:08:46

mitchellsundt commented 9 years ago
Thank you for your reply.
In our case (nonprofit organization), we do not have Google Maps Enterprise. However,
our devices are wireless and internet connection (like most Android smartphones nowadays).
So a widget to enable Google Maps online would be fully operational.
It would suffice to this widget to request permission to access the internet.
However, I understand that these developments are complicated, and I unfortunately
do not have the skills to develop this ...
I hope I'm not the only one to identify this need!
Thank you again.

Reported by montagnersylvain on 2013-06-05 07:54:17

mitchellsundt commented 9 years ago
I'm currently doing a patch about this. In fact it's done but I'm still searching how
to submit it (I'm new to all this contribution system). It will come asap. It uses
Google maps api v2 and the android support library v4 (gMaps v2 uses fragments).

Reported by guisalmon on 2013-07-02 11:49:50

mitchellsundt commented 9 years ago
When you fill out a comment on this issue, there is an 'Attach a file' link below the
comment area. If the patch is too large, send it directly to mitchellsundt@gmail.com

Reported by mitchellsundt on 2013-07-02 17:18:17

mitchellsundt commented 9 years ago
Great!
Thank you for the work accomplished! I can not wait to test it!
Sylvain

Reported by montagnersylvain on 2013-07-02 20:14:30

mitchellsundt commented 9 years ago
And here it is.
The map now allows the user to set a custom location : 
If you press a few time on a location on the map, it will place a marker which will
be draggable and stop the location provider updates. If you prefer to wait for the
location updates the marker will be draggable after the accuracy is below a certain
level (defined in GeoPointWidget).

I've changed GeoPointMapActivity.java which now uses the google maps api v2 (com.google.android.gms.maps)
and the android support library v4 (android.support.v4).
GeoPointLayout has been modified too, to integrate the fragment, and I've used some
drawables from android resources.
About the manifest, I forgot to add it to the patch : you will need to add two permissions
(com.google.android.providers.gsf.permission.READ_GSERVICES and org.odk.collect.android.MAPS_RECEIVE,
which you will have to define with protection level signature) and generate an api
key (http://goo.gl/420bY).

Reported by guisalmon on 2013-07-04 09:54:13


mitchellsundt commented 9 years ago
Hi , we have a similar issue, we need to choose  a location on a map (preferably offline)
and then submit those coordinates to ODK along with the other data collected by the
form. I am not technical, I see the thread here and would just ask if this will solve
my problem and some guidance on how to achieve this if possible. 
Thanks
Neal

Reported by nealmoores55 on 2014-01-31 07:22:38

mitchellsundt commented 9 years ago
Please see the 'placement-map' appearance of the geopoint type:
http://opendatakit.org/help/form-design/examples/#geolocation_prompts

This is available on newer phones, requires internet connectivity, and Google Services
to be installed on your phone.

Reported by mitchellsundt on 2014-02-14 23:34:41

mitchellsundt commented 9 years ago
Closing, as I believe this functionality is now available through the placement-map
appearance.

Reported by mitchellsundt on 2014-03-14 00:23:15