Select to view content in your preferred language

GraphicsLayer and infoWindowRenderer with events

672
4
06-13-2012 09:01 AM
Jeanlamou
Emerging Contributor
I'm using GraphicsLayer and infoWindowRenderer to display some information on a feature rendered by QueryTask.
It works. However, the user needs to click on the feature to get the information (textual information using TextArea, in LabelDataRenderer, in infoWindowRenderer).

How can I display that information automatically  (without user click)? Any sample?

Thanks,

Jean
Tags (2)
0 Kudos
4 Replies
KenBuja
MVP Esteemed Contributor
Have you seen this sample?
0 Kudos
Jeanlamou
Emerging Contributor
I have. The sample uses MouseEvent. However, I would like to display the information automatically (without a mouse event).

Here is the code  :

<esri:GraphicsLayer id="myGraphicscityName"  graphicProvider="{queryTaskcityName.executeLastResult.features}" >
    <esri:symbol> <esri:SimpleMarkerSymbol id="sms" size="15" color="0xFF0000" style="circle"  /></esri:symbol>
    <esri:infoWindowRenderer>
     <fx:Component>
      <esri:LabelDataRenderer >
       <s:TextArea id = "textcityName" text ="The name of the city : {data.cityNamesAct}" width="100" height="75"/>
      </esri:LabelDataRenderer>
     </fx:Component>
    </esri:infoWindowRenderer>
   
</esri:GraphicsLayer>


The graphic (colored circle) is displayed automatically. But not the LabelDataRenderer with the text (the user has to click on the graphic to display the text).

Jean
0 Kudos
IvanBespalov
Frequent Contributor
A lot of samples with symbols, info windows and its renderers (static, dynamic, mouse over/out/click/userthink popups)
How can I display that information automatically (without user click)?

based on View InfoSymbols sample
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      xmlns:esri="http://www.esri.com/2008/ags"
      xmlns:s="library://ns.adobe.com/flex/spark"
      pageTitle="Basic InfoSymbol example">
 <!--
 Basic example of an infosymbol containing a vbox with an image and a label.
 The image url is read from the attributes of the graphic.
http://resources.arcgis.com/en/help/flex-api/samples/01nq/01nq0000004v000000.htm
 -->
 <fx:Declarations>
  <esri:CompositeSymbol id="compositeSymbol">
   <esri:SimpleMarkerSymbol size="30" color="0xFF0000" style="circle" />
   <esri:SimpleMarkerSymbol size="15" color="0x00FF00" style="triangle" angle="30" />
   <esri:InfoSymbol>
    <esri:infoRenderer>
     <fx:Component>
      <s:DataRenderer>
       <s:layout>
        <s:VerticalLayout/>
       </s:layout>
       <mx:Image source="{data.myImageURL}"/>
      </s:DataRenderer>
     </fx:Component>
    </esri:infoRenderer>
   </esri:InfoSymbol>
   <esri:TextSymbol textAttribute="myTitle" 
        placement="end" 
        yoffset="-20" 
        border="true"
        background="true"/>
  </esri:CompositeSymbol>
 </fx:Declarations>
 
 <esri:Map openHandCursorVisible="false">
  <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
  <esri:GraphicsLayer symbol="{compositeSymbol}">
   <esri:Graphic>
    <esri:geometry>
     <esri:MapPoint x="11945000" y="6074000"/>
    </esri:geometry>
    <esri:attributes>
     <fx:Object>
      <fx:myImageURL>http://training.figleaf.com/images/sec_logo_flex.gif</fx:myImageURL>
      <fx:myTitle>Flex</fx:myTitle>
     </fx:Object>
    </esri:attributes>
   </esri:Graphic>
   <esri:Graphic>
    <esri:geometry>
     <esri:MapPoint x="-7359000" y="2092000"/>
    </esri:geometry>
    <esri:attributes>
     <fx:Object>
      <fx:myImageURL>http://erevanpoker.com/bin_images/no_flash.png</fx:myImageURL>
      <fx:myTitle>Flash</fx:myTitle>
     </fx:Object>
    </esri:attributes>
   </esri:Graphic>
  </esri:GraphicsLayer>
 </esri:Map>
</s:Application>
0 Kudos
Jeanlamou
Emerging Contributor
Thanks for the sample. However, what I'm trying to do is to display a dynamic textarea within a graphiclayer. The content of the textarea is the result of a QueryTask.
Within the esri:GraphicsLayer tag, ther is, besides textarea, a static symbol (red circle).
The static symbol is displayed automatically. The textarea is not (user needs to click).

<esri:GraphicsLayer id="myGraphicscityName" graphicProvider="{queryTaskcityName.executeLastResult.features}" >
<esri:symbol> <esri:SimpleMarkerSymbol id="sms" size="15" color="0xFF0000" style="circle" /></esri:symbol>
<esri:infoWindowRenderer>
<fx:Component>
<esri:LabelDataRenderer >
<s:TextArea id = "textcityName" text ="The name of the city : {data.cityNamesAct}" width="100" height="75"/>
</esri:LabelDataRenderer>
</fx:Component>
</esri:infoWindowRenderer>
</esri:GraphicsLayer>
0 Kudos