koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
659 stars 127 forks source link

Is there a way to turn off pagination via resultOffset, resultRecordCount? #357

Closed simon-fisher closed 4 years ago

simon-fisher commented 4 years ago

Is there a way to turn off pagination via resultOffset, resultRecordCount at the Koop filter so I can pass through and implement in my own provider?

rgwozdz commented 4 years ago

Hello @simon-fisher - yes there is a way. Implement in your own provider and then add a filtersApplied object to your geojson in the getData method:

// get geojson from remote API...

// implement your own pagination

// Inform Koop that you have already applied pagination
geojson.filtersApplied = {
  offset: true,
  limit: true
}

// pass geojson to callback

filtersApplied is somewhat documented in FeatureServer but we'll add it to the main docs soon.

rgwozdz commented 4 years ago

Yes, absolutely. Though I had assumed he was authoring a new provider which always does the pagination itself. In a case like that, it seems like you would want to do the filtering and filtersApplied setting in the same place, rather than leave setting “filterApplied” to the registration options. I’m working up the docs for the “before” and “after” functions – that should help people decide the best option.

Rich Gwozdz | Software Engineer Esri rgwozdz@esri.com

From: Haoliang Yu notifications@github.com Reply-To: koopjs/koop reply@reply.github.com Date: Tuesday, February 11, 2020 at 7:01 AM To: koopjs/koop koop@noreply.github.com Cc: Rich Gwozdz RGwozdz@esri.com, Mention mention@noreply.github.com Subject: Re: [koopjs/koop] Is there a way to turn off pagination via resultOffset, resultRecordCount? (#357)

@rgwozdzhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_rgwozdz&d=DwMCaQ&c=n6-cguzQvX_tUIrZOS_4Og&r=SdwfK2jZeSAp47WvxlIkow&m=MYZrYbqE5I-EF37i58gfCDngeJKWqaOSW8Khc8h8wBc&s=BiVejHqbekmqpb_qQoa-eodOPSUapuOaq5eMvY4-9V8&e= Is it possible to use the "after" function to add the filter setting for existing providers?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_koopjs_koop_issues_357-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DABBKWKAH7LSPUH5DMUMAM33RCK4STA5CNFSM4KTBTHVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELMXQCQ-23issuecomment-2D584677386&d=DwMCaQ&c=n6-cguzQvX_tUIrZOS_4Og&r=SdwfK2jZeSAp47WvxlIkow&m=MYZrYbqE5I-EF37i58gfCDngeJKWqaOSW8Khc8h8wBc&s=0efKZ5gUXb8QRs2F2U724j41SFfJLW1ZSrLywvRkitM&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABBKWKHPBUSIY6V5HZQA72LRCK4STANCNFSM4KTBTHVA&d=DwMCaQ&c=n6-cguzQvX_tUIrZOS_4Og&r=SdwfK2jZeSAp47WvxlIkow&m=MYZrYbqE5I-EF37i58gfCDngeJKWqaOSW8Khc8h8wBc&s=CJmO7DbluiYkebVsbBwmfXK8f3tWsKiunPL0wn3652I&e=.