Mapbox styles in Enketo

188 views
Skip to first unread message

Daniel S.

unread,
Apr 18, 2017, 4:15:31 AM4/18/17
to enketo-users
Hi,

I already asked that question in the ONA Community and was advised to ask here (Martijn van de Rijdt) again: Is it possible to integrate custom Basemaps (Mapbox styles) when running Enketo with ONA? We run Github versions of Enketo/ONA on own servers.

Thanks in advance
Daniel

Martijn van de Rijdt

unread,
Apr 18, 2017, 12:38:59 PM4/18/17
to enketo...@googlegroups.com
Hi Daniel,

Good idea. Adding such a feature on per-form basis is possible, and worth considering.

However, you mentioned you are running your own Enketo server, so I wanted to check if the central customization option would work for you: https://github.com/kobotoolbox/enketo-express/blob/master/config/README.md#maps. You can set a particular layer to load as the default by defining this in the XLSForm: https://blog.enketo.org/geo-layers/.

Another approach for per-form customization is what Survey123 is using with ArcGIS maps. Enketo also has support for this (so far unannounced). If this interests you see the documentation here: https://github.com/enketo/enketo-core/tree/master/src/widget/geo-esri. This geo widget is an alternative to the default leaflet geo widget and not yet a complete replacement (does not support geoshape and geotrace yet). You can enable it in Enketo Express (and preferably disable the default geo widget for performance reasons) by changing one line in widgets.js and widgets.scss.

Cheers,
Martijn

--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
Revolutionizing data collection since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

Daniel S.

unread,
Apr 19, 2017, 3:43:12 AM4/19/17
to enketo-users
Hi Martijn,

good to hear you like that idea.

To explain the background: We plan to survey fear points on our campus. Participants are asked to draw a polyline (usual way to campus) and set fearpoints within a specific area. Now, if we were able to mark the boundaries of this area directly on the map, we can spare a halfstep, where we have to explain the boundaries using text and picture. The idea was to create a Mapbox style that does exactly this.

Central custimization: As far as I understand the code (I'm not a programmer) it should be possible to limit the map's displayed area by defining the extent in "tiles": [ "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"?
But would this affect all deployed forms?

Defining in XLSForm: I have not tested this yet, but will very soon. However, in our Enketo version the selector for the three basemaps (as shown in the link) is not available. Do we have to update Enketo or will defining the baselayer in XLSForm work anyhow?

ESRI widget: we often work with lines and polygons, so this is not a solution yet. But thanks for the hint.

Best regards
Daniel

Martijn van de Rijdt

unread,
Apr 21, 2017, 12:23:07 PM4/21/17
to enketo...@googlegroups.com
Hi Daniel,

Limiting the display of the map to certain boundaries would be something very different. That's not a feature I'm very excited about because of how the geo widgets currently work and how much we'd have to change that if the current user location is outside of these boundaries.

Displaying a form-defined custom layer of points, polylines, polygons would be interesting. This could be independent from the map tile layers (e.g. streets, terrain, satellite). Not sure how to implement yet. This would be a lot easier if the OpenRosa server (such as Ona) takes care of serving/routing of this layer based on some ID in the form (basically it would work exactly as in the Esri Geo Widget).

You can add as many base maps as you want in your Enketo Express configuration. See the configuration documentation (link in previous message) on how to do this.

Cheers,
Martijn

--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel S.

unread,
Apr 27, 2017, 10:10:42 AM4/27/17
to enketo-users
Hi Martijn,

generally limiting the displayed map extent was not my approach. I just considered that as a possibility when I read the code and tried to understand it.

What I sought is, just as you said, adding a form-defined layer. In my case a polygon that marks specific boundaries to set geopoints within. But either it has to be implemented in Ona (etc.) or one has to switch to the ESRI widget in Enketo (and wait for geotrace/polygon to be implemented).

I guess you would make a great gift to many ODK/Enketo users by making this possible. Just thinking about giving citizens that fill a form without assistance only the neccessary information they need to survey specific aspects, so they are not distracted by the information-overload OSM can provide in high zoom levels. So many people still have problems with using digital maps in concerns of orientation and finding information they are looking for.

Unfortunaltely there doesn't seem to be a solution for my request by now, but I hope you will go after this idea.

Best regards
Daniel


Reply all
Reply to author
Forward
0 new messages