Select to view content in your preferred language

Anybody knows how to show the full-size attached image after clicking on the image attachment thumbnail in a popup?

888
3
04-04-2018 04:17 PM
VincentNg1
Occasional Contributor

Hi All,

We are currently developing an App which can show popups with feature attributes including image attachments when clicking on the features. The attachments are shown as thumbnails in the popup. Does anybody know how we could get an enlarged (e.g. full-size) image popped up when we click on the thumbnails of the image attachments? Any help would be greatly appreciated.

0 Kudos
3 Replies
MarkDostal
Esri Regular Contributor

Thank you for your question!  Are you using the SDK's `AGSPopupsViewController` class to display your popups?  If so, that will handle displaying full-size images from the attachments.  You can look at the following sample for an example of how to use `AGSPopupsViewController`:

arcgis-runtime-samples-ios/EditFeaturesOnlineViewController.swift at master · Esri/arcgis-runtime-sa... 

You can also download the sample application from the App Store or download the GitHub repo and build/run it locally to see how it works.

If you are writing you're own popup viewer, you can either fetch and load the attachments using the `AGSArcGISFeature.fetchAttachmentsWithCompletion` method or use the `AGSPopupAttachmentManager` and `AGSPopupAttachment` classes to handle a lot of the work for you.  Once you have the attachment image you would display that in a new `UIImageView`.

Let me know if that doesn't answer your question or you need more info,

Mark

VincentNg1
Occasional Contributor

Hi Mark,

Thank you for your quick response! Yes, I am using the SDK's `AGSPopupsViewController` class and your suggestion helped a lot. Now I am able to display full-size images when clicking on the thumbnails of images in the popups.

Thanks a lot!

0 Kudos
MarkDostal
Esri Regular Contributor

Excellent, glad you got it working!  If you have any more questions, please let me know.

Mark

0 Kudos