koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
101 stars 32 forks source link

Refactor query.js and handle returnExtentOnly properly. #214

Closed rgwozdz closed 2 years ago

rgwozdz commented 2 years ago

There is a bug in query.js that prevents queries that have returnCountOnly=true and returnExtent=true from rendering the proper results. The specific problem lies here.

  if (options.returnCountOnly && data.count !== undefined) return { count: data.count }

If returnCountOnly=true and returnExtent=true (and data.count is undefined), FeatureServer returns a response without an extent.

This PR fixes that bug, albeit with quite a lot of refactoring I did to try to make sense of existing logic and flows.