1

I have an attachment in ArcMap attribute table and would like to show the image attachment in the popup when a feature layer element is clicked but the code I tried to show the attachment but this fails

popupTemplate.content = [{type: "attachments"}]
2

It fails either because it can't find the popupTemplate in your feature layer. so you have to init the popupTemplate this way :

layer.popupTemplate = {content: [{type: "attachments"}]};

or because of the typo in your content. You have written tpye instead of type

  • The "type" error was a typo on my side, but I will try to include your snippet and see – kabuto178 Mar 15 '17 at 13:57
  • What if there are multiple attachments for the layer but I only wish to pull the attachment for the selected feature item – kabuto178 Mar 15 '17 at 16:53
  • this popuptemplate applied to a layer, defines what will be shown when a feature is clicked on. – LMokrane Mar 15 '17 at 17:00
  • Was wondering about a situation where there are multiple attachments to a layer. – kabuto178 Mar 15 '17 at 20:58
  • A layer can have multiple features. A feature can have multiple attachments. This popup will display the attachments of the feature you clicked on – LMokrane Mar 15 '17 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.