Select to view content in your preferred language

How to set time (-Extent) for identify task

978
2
Jump to solution
02-11-2021 01:03 AM
fabianmue
Emerging Contributor

Hi

My team and I are building an Angular application using ArcGIS API for Javascript.

We make identify requests against an ArcGIS Server 10.71.

In version 3 of the API, it was possible to set the time via the "timeExtent" property of the IdentifyParameters.

In version 4 of the API, I cannot find any property in the IdentifyParameters which would allow us to do that.

I have already tried to manually set "time" or "timeExtent" after creating the parameters, but in that case, the request isn't even executed when creating an IdentifyTask and running .execute(parameters) on the task.

I have also tried to set the time via the query property of the RequestOptions (both when creating the task and when executing it), but that does not seem to have any effect.

Is there a way to set the time for an identify request?

Unfortunately, if we don't set the time for the request, we get many results we don't care about. We could of course filter the results after retrieving them, but that way we run into the (configured) maximum of 1000 results per request too quickly.

I'd much rather not create the GET/POST request manually.

Thanks a lot for your help!

0 Kudos
1 Solution

Accepted Solutions
JohnGrayson
Esri Regular Contributor

Have you  tried using a RequestInterceptor (query or before) to see if you can add in the appropriate parameters?

View solution in original post

0 Kudos
2 Replies
JohnGrayson
Esri Regular Contributor

Have you  tried using a RequestInterceptor (query or before) to see if you can add in the appropriate parameters?

0 Kudos
fabianmue
Emerging Contributor

Hi John

Thank you very much for your answer and sorry for not responding sooner, I just found time to try out your suggestion now.

The RequestInterceptor with both the query or the before set appropriatly seems to do the trick.

I still think it would be more convenient (and less confusing), if it was possible to set the time via the IdentifyParameters or via the RequestOptions passed to the task.execute(), but this works as well. Maybe this could be added for a future version.

Regards, Fabian

0 Kudos