KagisB / Mapon-Prakse-backend-projekts

0 stars 0 forks source link

Divide the large filter() function in mapRoutes.php #9

Closed KagisB closed 2 years ago

KagisB commented 2 years ago

Would be good to divide this function up into smaller functions, to make it easier to understand how the function works. Probably split it into a function, that validates the user data, function, that makes the request for the data, function, that works with the received json response to make it usable for other functions, a function that draws the markers and polylines on the map. And just call them all from the filter function.

KagisB commented 2 years ago

Mostly done, don't have a large filter function anymore, it is divided into smaller functions. Can maybe be divided into even smaller functions, but main idea is complete - no more 100+ line filter function.