Select to view content in your preferred language

Map Viewer dynamic image urls do not display as Media in pop-ups

1536
5
Jump to solution
05-13-2022 11:26 AM
BrittanyBurson
Frequent Contributor

Hello, I am exploring a rebuild of one of our public facing apps using one of the newer Instant App templates, to meet a requirement for Google Analytics reporting. I've tried finding an existing post for this issue but no luck.

An important piece in rebuilding the app is displaying multiple images per feature within the pop-up, using dynamic URLs that use a {field_name} or ID to populate the URL.

BrittanyBurson_0-1652465960562.png

It appears I am unable to do this using the New Map Viewer/JS 4.x apps, and instead receive a broken image. 

BrittanyBurson_1-1652466004003.png

Example URL: "https://sample.s3.amazonaws.com/Base_{field_name}.jpg"

When I click on the image to go to it directly in the browser, I can see the {field_name} is not populating in the URL.

An image using a static URL such as "https://www.sandiego.gov/sites/default/files/cosd-logo-initials-full-color-300ppi.jpgworks as expected:

BrittanyBurson_2-1652466122115.png

I do believe this is intended to be a supported feature, as it is mentioned in the documentation and the option is there to include an select a field name: 

BrittanyBurson_3-1652466273165.png

What am I missing... or is this a bug?

 Thank you!

1 Solution

Accepted Solutions
RussRoberts
Esri Notable Contributor

You will need to go to configure fields in Map Viewer and set decimal places to 0 and remove the decimal separator. These are set on the field and are being honored anywhere the field is set for use.

 

RussellRoberts1_0-1652468776135.png

 

 

Then it will work

RussellRoberts1_1-1652468817192.png

 

View solution in original post

5 Replies
RussRoberts
Esri Notable Contributor

You will need to go to configure fields in Map Viewer and set decimal places to 0 and remove the decimal separator. These are set on the field and are being honored anywhere the field is set for use.

 

RussellRoberts1_0-1652468776135.png

 

 

Then it will work

RussellRoberts1_1-1652468817192.png

 

BrittanyBurson
Frequent Contributor

Thank you @RussRoberts that worked and is not something I would have ever thought of... appreciate the quick reply.

RyanBohan
Frequent Contributor

Great to know there is a work around.  I don't recall having to do this in the classic map viewer.

RussRoberts
Esri Notable Contributor

Its the 4.x JSAPI honoring the field formatting set on the field for the popup and the popup media is coming from the popup. The url generated for this numeric field was adding the , and .00 to the URL which would cause a 404 to the image link.  

0 Kudos
YRP_GIS
Occasional Contributor

I'm having a similar issue to this, but when I check the field formatting I do not have the ability to remove significant digits. Is there another work around to get this to work?

JingCao12_0-1689707259052.png

 

0 Kudos