Select to view content in your preferred language

Using the pop ups with Rasters in a feature dataset

965
11
06-21-2011 04:03 PM
JoshJones1
Deactivated User
I have a feature class with a separate raster image within a raster data column associated with each record of the feature class.  I am trying to use the popup widget to have it contain the image that is within each record so as a different image will be pulled when each point is clicked upon. 

Is this possible to do this, or does anyone know another way that I would be able to have the popup widget pull a separate image file for each of the points within my map?  I don't mind having them pull from a separate location but I need it to be able to pull a different image for each point.

Any help would be appreciated.


Thanks,

Josh Jones
Tags (2)
0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus
Josh,

   Raster fields are not supported by REST so they are not usable in the Flex API. You can easily have a hyperlink field that is associated with each feature and that would give you the same unique image ability as the Raster field.
0 Kudos
JoshJones1
Deactivated User
Thanks Robert.  I didn't know that about raster fields.

I'm speaking specifically to point data, and I want a different image for each point once clicked upon. If I were to create an "ImageURL" field and insert the hyperlink for each image into the field, how do I then go about making this image pop up in the box when clicked upon?
0 Kudos
JoshJones1
Deactivated User
Thanks Robert.

I was trying to accomplish this task by using the new(er) popup windows that are built into the flexviewer because I have no knowledge or experience using FlexBuilder.  Do you know of any way to allow for the serving of different images associated with each point file while using the popup windows, or will I need to attempt to learn FlexViewer and use the Click_OnDemand widget example you sent to me.

Thanks again Robert.

-Josh Jones
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

   Remember to post Flex Viewer questions to the Flex Viewer Forums

http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

First add an PopUp_yourLayerName.xml to the src/popups by copying one of the existing ones (i.e. PopUp_311.xml).

<?xml version="1.0" ?>
<configuration>
    <title>{field1}</title>
    <fields>
        <field name="field1"/>
        <field name="ImageURL" alias="Hyperlink" visible="false"/>
    </fields>
    <showattachments>true</showattachments>
    <medias>
     <media type="image" imagesource="{ImageURL}"  imagelink="{ImageURL}"/>
    </medias>
</configuration>
Then just add something like this to your main config.xml

<layer label="Your Layer" type="feature" visible="true" alpha="1.0"
                   popupconfig="popups/PopUp_yourLayerName.xml"
                   url="http://yourServer/ArcGIS/rest/services/yourService/MapServer/0"/>
your actual string that is in the ImageURL field needs to have a complete URL (i.e. http://yourServer/images/yourImage.jpg).
0 Kudos
JoshJones1
Deactivated User
Robert,

Sorry about the post location, I'll make sure to post to the correct forum the next time. 


I am still unable to properly configure the popup window.


Here is my popup config file based upon your post:

<?xml version="1.0" ?>
<configuration>
    <title>{name}</title>      
    <fields>
        <field name="name"/>
<field name="image_url" alias="Hyperlink" visible="false"/>
    </fields>
    <showattachments>true</showattachments>
    <medias>
      <media type="image" imagesource="{image_url}"  imagelink="{image_url}"/>
    </medias>
</configuration>


I then tried two different config strategies. 

The first was based upon your post:

<layer label="Sculptures" type="feature" visible="true" alpha="1"
     popupconfig="popups/PopUp_ArtWalk.xml"
                   url="http://140.160.114.190/ArcGIS/rest/services/WWU/ArtWalk5/FeatureServer/0"/>

This resulted in a error window that said "Application Error" with no error code and no explanation.


The second one was based upon another example I found online:


<layer label="Sculptures" type="dynamic" visible="true" alpha="1"
                   url="http://140.160.114.190/ArcGIS/rest/services/WWU/ArtWalk5/MapServer"/>
     <sublayer id="0" popupconfig="popups/PopUp_ArtWalk.xml"/>

This resulted in no error of any kind but there are no popups still.

The links in the field are complete URL's like you said.

If you have any ideas I would greatly appreciate it. 


Thanks.


-Josh Jones
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

   I got this to work.

<layer label="Sculptures" type="dynamic" visible="true" alpha="1"
                   url="http://140.160.114.190/ArcGIS/rest/services/WWU/ArtWalk5/MapServer">
                <sublayer id="0" popupconfig="popups/PopUp_ArtWalk.xml"/>
            </layer>
0 Kudos
JoshJones1
Deactivated User
Robert,


I pasted the code that you posted into my main config file and when I open the page there is still an error window that says "Application Error" with no explanation beneath of it and the popup window still doesn't work.  I can't find a reference to this error anywhere and I am surprised that I am getting this error if the code worked for you. 


I appreciate all of the help that you have been providing me.


-Josh
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

   You need to look for a syntax error in your main config.xml. Open it directly in internet explorer or some xml editor that validates.
0 Kudos