hajkmap / Hajk

A modern, full-featured OpenLayers based map viewer and editor
MIT License
122 stars 46 forks source link

Activating the Collector #988

Closed jacobwod closed 2 years ago

jacobwod commented 2 years ago

It seems to be difficult to configure the Collector plugin to show anything but an empty page.

According to the documentation this should give a toolbar: <div type="toolbar"></div>. But all you get is this error: Skärmavbild 2022-01-26 kl  11 13 50

It seems like something's going on (I need to investigate further, this is just a quick note so I don't forget it), since changing type to something else then "toolbar"does actually load the plugin (but without the toolbar, of course): Skärmavbild 2022-01-26 kl  11 14 58

Anybody had any success with this plugin, perhaps @hitomin21 @ingvar-uddevalla @jesade-vbg @persoderstrom?

ingvar-uddevalla commented 2 years ago

I have recently succeded to get Collector ('Tyck Till') to work all the way in Hajk 3.8 and Hajk 3.9rc1. The webform of the tool has to look like this:

Skärmbild 2022-03-22 162607

The used WFST-service must have those fields checked as 'editable'. The WFST-service in its turn must have correct permissions set for both the table and its sequence in the PostGIS-database. Belowscreendumps of how it looks in Hajk 3.9rc1

Skärmbild 2022-03-22 162355

Skärmbild 2022-03-22 164051

jacobwod commented 2 years ago

Thanks @ingvar-uddevalla, that's great info. Can you provide a screenshot from your database table too, so I can see the data types for the columns? I suspect that we have trouble with datatypes other than string, so it would be interesting to see your table's structure. Thanks.

ingvar-uddevalla commented 2 years ago

op_test_synpunkt_p I hope this will help you @jacobwod. This shows the "create script" for the table and its sequence.

ingvar-uddevalla commented 2 years ago

@jacobwod . For me the problem with empty pages when the Collector-tool is activated occurs when the EDITOR-tool is NOT activated. (Tested in v3.9.0). By some reason the collector won't work if the current WFST-service isn't activated from the editor. THe screendump below shows the the code in CollectorModel.js where the error occurs: Skärmbild 2022-04-05 082047 So a "bad" solution is to have both the Collector and Editors tools activated in the map (using the same WFST-service). (However the "opposite" depandency - the Editor-tool itself - isn't depended on the Collector-tool)

jacobwod commented 2 years ago

Thank you @ingvar-uddevalla for this report!

jacobwod commented 2 years ago

I have finally had some time to take a look at it this morning. I found out that:

With Edit: Skärmavbild 2022-04-26 kl  09 33 06

Without Edit: Skärmavbild 2022-04-26 kl  09 32 45

I'll see if I can find a quick-fix for b).

jacobwod commented 2 years ago

Alright, it's fixed and pushed! Turns out it was the washing mechanism in new backend: if Edit wasn't active, we assumed there's no need of the WFS-T layers. That is obviously wrong and fixed as of https://github.com/hajkmap/Hajk/commit/818b9f1e2c6694848bfffa034be62723d6affb54, coming up in 3.10 too.