Select to view content in your preferred language

How to add a small image as an Identify Widget result

1948
3
Jump to solution
11-12-2014 04:16 PM
BarnabyRockwell
Deactivated User

Hi Robert,

Here's a strange one for you.  I have an un-attributed, simple RGB raster image in a published service, and I want a small (~150x150 pixel) image showing an explanation to come up in the ID widget results when any pixel in the published raster is clicked on.  Is this possible?

Best regards,

Barnaby

0 Kudos
1 Solution

Accepted Solutions
BarnabyRockwell
Deactivated User

Robert,

I solved the issue by attributing the raster RGB file, which is in ERDAS Imagine format.  I added a field called "Link" and filled it with the url of the legend image (legend.jpg) for every value in the raster (0-255).  This ID widget XML then does the job.

    <layer>
        <name>RGB raster layer</name>
        <id>41</id>
        <url>https://MyServer/arcgis/rest/services/Service1/MapServer</url>
        <fields>
            <field name="Red" alias="Mineral1 endmember (red)"/>
            <field name="Green" alias="Mineral2 endmember (green)"/>
            <field name="Blue" alias="Mineral3 endmember (blue)"/>
   <field name="Link" alias="" popuponly="true"/>
        </fields>
        <links>
            <link includeinresults="true" field="Link" tooltip="Link to explanation">
                <linksuffix/>
                <iconfield/>
                <iconprefix>https://MyServer/images/legend.jpg</iconprefix>
                <iconsuffix/>
            </link>
        </links>
        <zoomscale>2000</zoomscale>
        <forcescale>true</forcescale>
    </layer>

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Barnaby,

   The only way I can think of is to add some code to specifically look for the identify result with your layers name and then add a link entry to the links property of the IdResult so that the IdResultItemRenderer.mxml will display the image as if it were a link to an image.

0 Kudos
BarnabyRockwell
Deactivated User

Robert,

Interesting idea.  Thanks!

Cheers,

Barnaby

0 Kudos
BarnabyRockwell
Deactivated User

Robert,

I solved the issue by attributing the raster RGB file, which is in ERDAS Imagine format.  I added a field called "Link" and filled it with the url of the legend image (legend.jpg) for every value in the raster (0-255).  This ID widget XML then does the job.

    <layer>
        <name>RGB raster layer</name>
        <id>41</id>
        <url>https://MyServer/arcgis/rest/services/Service1/MapServer</url>
        <fields>
            <field name="Red" alias="Mineral1 endmember (red)"/>
            <field name="Green" alias="Mineral2 endmember (green)"/>
            <field name="Blue" alias="Mineral3 endmember (blue)"/>
   <field name="Link" alias="" popuponly="true"/>
        </fields>
        <links>
            <link includeinresults="true" field="Link" tooltip="Link to explanation">
                <linksuffix/>
                <iconfield/>
                <iconprefix>https://MyServer/images/legend.jpg</iconprefix>
                <iconsuffix/>
            </link>
        </links>
        <zoomscale>2000</zoomscale>
        <forcescale>true</forcescale>
    </layer>
0 Kudos