tasking-manager
tasking-manager copied to clipboard
Removing Geojson object while loading project page without toggling on "Show Map" feature.
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
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 - thanks for catching this, please go ahead with your proposal.
Related to https://github.com/hotosm/tasking-manager/pull/6289 - fix tested and approved.