HOW TO
Reducing the resolution of image attachments is necessary to improve storage efficiency and reduce data usage for an enhanced user experience. This article provides the workflow to resize image attachments using an Arcade expression in the ArcGIS Online Map Viewer pop-ups.
First(Attachments($feature)).ID
Note: Image attachments in non-public layers require an authentication token, which expires over time and may cause images to become inaccessible.
var Part1 = "<URL in step 5>/";
var ObjectID = $feature.OBJECTID;
var Part2 = "/attachments/";
var AttachID = $feature.AttachID;
//include this line for the non-public layer:
//var token = "<tokenID>"
var link = Part1 + ObjectID + Part2 + AttachID
//use this line for the non-public layer:
//var link = Part1 + ObjectID + Part2 + AttachID + token
var imageLink = `<img src = "${link}" width ="%">`
return {
type: "text",
text: imageLink
};
The image below shows the resized image attachment in the Map Viewer pop-up.
Article ID: 000032497
Get help from ArcGIS experts
Download the Esri Support App