tasking-manager icon indicating copy to clipboard operation
tasking-manager copied to clipboard

Removing Geojson object while loading project page without toggling on "Show Map" feature.

Open manjitapandey opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. For projects on explore projects page, the API being fetched is getting geojson object of all projects which is only used when show map is toogled on. Also on each page change on pagination the same geojson object is being fetched again and again. Loading geojson objects on initially and during pagination changes is causing project cards to load slower.

Describe the solution you'd like We can fetch the projects API by omitting the geojson object i.e. "mapResults" by passing omitMapResults=true in query. By omitting the geojson object we save much time in API response and improve loading time. We can only call geojson object on show map toogle.

Additional context Current api call: https://tasking-manager-tm4-production-api.hotosm.org/api/v2/projects/?action=any modified api call: https://tasking-manager-tm4-production-api.hotosm.org/api/v2/projects/?action=any&omitMapResults=true

manjitapandey avatar Jan 23 '24 05:01 manjitapandey

I have implemented this on TM naxa server, it is now much faster with the map toggled off which is default toggled off. Now projects list will appear much faster. Should i do a PR for this fix on TM development ? @ramyaragupathy

varun2948 avatar Feb 14 '24 17:02 varun2948

@varun2948 - thanks for catching this, please go ahead with your proposal.

ramyaragupathy avatar Mar 05 '24 14:03 ramyaragupathy

Related to https://github.com/hotosm/tasking-manager/pull/6289 - fix tested and approved.

ramyaragupathy avatar Mar 21 '24 11:03 ramyaragupathy