Esri/arcgis-rest-js

decorate feature service attachment responses w/ full urls?

Aperta

#371 aperta il 19 ott 2018

 (4 commenti) (0 reazioni) (0 assegnatari)TypeScript (126 fork)auto 404
good first issue

Metriche repository

Star
 (389 stelle)
Metriche merge PR
 (Merge medio 11g 4h) (5 PR mergiate in 30 g)

Descrizione

@jPurush was going to add this code that we use in the Hub to Hub.js:

https://github.com/Esri/hub.js/blob/2ada2dfe36253e3fa5b75d4993ff28c41198d45f/packages/events/src/get.ts#L45-L60

I wonder if instead of adding it there if rest-js should be decorating the getAttachments() responses w/ the full url similar to the the suggestion for thumbnail urls #323?

As w/ that issue, I'm a bit wary of appending the token. Also it looks like the ?v= parameter is not necessarily supported by the API, but is something we added in the Hub for cache busting. Not sure if we should add that in all cases.

Alternatively, we could provide a getAttachmentUrl(featureServiceUrl: string, attachmentId: number, authentication?: IAuthenticationManager) util fn and let people .map() over the attachment infos to get the URLs themselves?

Guida contributor