BiologicalRecordsCentre / SPRING

Repository for tracking issues for the SPRING (EU Pollinator Monitoring) project
GNU General Public License v3.0
0 stars 0 forks source link

Pan trap species and bycatch data entry page - map to show pan trap location #84

Closed DavidRoy closed 2 years ago

DavidRoy commented 2 years ago

e.g. https://pollinator-monitoring.net/species-data-entry?sample_id=19993923&implicit=f

Also for bycatch data entry page

Currently the map shows the map square location, not the location of the pan trap.

Would be better for the map to show the pan trap location

andrewvanbreda commented 2 years ago

Hi @DavidRoy ,

What has happened here is that the 1km square is saved as the actual location for the sample, and the pan trap itself is just a grid reference (it isn't an indicia location record). Indicia's standard functionality is to zoom to the position of the sample location, not the given grid reference point for the sample. This probably makes sense as most of the time the grid reference would fall within the location. However in our case, the situation is further confused because the 1km squares are just lat/lon points with no boundary geom. This means on the map we end up with two separate points displayed. One for the centre of the square, one for the pan-trap grid reference. Both are displayed, but sometimes the pan-trap point is appearing off-map because we are zoomed too far into the square point.

There are two ways I can think to handle this.

  1. Try to change Indicia, add an option to Indicia to allow us to choose whether the location or the precise grid reference is zoomed to. This is more involved, but might be the preferable solution if you think that might be generally useful for you across projects.

  2. Or a simpler workaround which may or may not be acceptable is to limit the zooming of the map on that screen when it loads so it doesn't zoom so far in, that the pan trap grid point is appearing off edge of the map.

DavidRoy commented 2 years ago

Thanks @andrewvanbreda. Option 2 is a good option. I don't think option 1 is a priority currently but could you raise an issue to capture this requirement. In the appropriate repo

JimBacon commented 2 years ago

Just chipping in a random thought. If the location is really a 1km square, why doesn't it have a boundary geom? If it did, you would presumably see the square with the position of the sample showing within it as normal.

DavidRoy commented 2 years ago

That would work in the UK where we have the 1km boundaries. For the Europe work, the sites are not always a 1km and we do not have the boundary geoms?

andrewvanbreda commented 2 years ago

Hi @DavidRoy The add bycatch and add species data pages now use the Indicia map @maxZoom=15 option, so you should be able to see the pan trap now. Close issue if happy, or comment further.

DavidRoy commented 2 years ago

Looks good