How to pass data to GraphicLayer InfoWindow

2121
2
Jump to solution
12-18-2013 09:29 AM
AronHarris
New Contributor II
I am trying to get information from my graphiclayer with out doing a server call. I can do the mouse over with tooltip with no problems.I have a database with lon/lat that draws the points on the map.
----
[Bindable]
public var bridgeList:Object;
private function bridgeResult():void {
              [Embed(source='assets/point.png')]
       var bridgePicClass:Class;
       var bridgePoint:PictureMarkerSymbol = new PictureMarkerSymbol(bridgePicClass);
   for (var i:int; i < this.employeeCollection.length; i++) {
         var bridgeGraphic:Graphic = new Graphic(new WebMercatorMapPoint(employeeCollection.GPSLong, employeeCollection.GPSLat), bridgePoint);
                  bridgeGraphic.toolTip = "Trap Number: "+employeeCollection.GPSLong+"\nTrapper: "+employeeCollection.GPSLat;
         bridgeGraphic.addEventListener(MouseEvent.CLICK, bridgeGraphic_handler);
         bridgePointsLayer.add(bridgeGraphic);
    
     }
    }
---
I was trying to follow the example of GraphicLayer_PopUpRenderer but my info comes up blank. This part of the code I am not sure of:--
   protected function queryTask_executeCompleteHandler(event:QueryEvent):void
{
    if (event.featureSet.features)
  {
    for each(var gra:Graphic in event.featureSet.features)
         {
          gra.addEventListener(MouseEvent.CLICK, selectStateFromList);
   }
    statesGraphicsLayer.graphicProvider = event.featureSet.features;
    statesList.dataProvider = new ArrayList(event.featureSet.features);
    map.extent = GraphicUtil.getGraphicsExtent(event.featureSet.features);
    }
}
--------
I am not sure how to connect the data to it.


Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Frequent Contributor
Aron,

You can attach attributes to a graphic using name-value pairs see:

https://developers.arcgis.com/en/flex/guide/using-graphic.htm

Regards

Anthony

View solution in original post

0 Kudos
2 Replies
AnthonyGiles
Frequent Contributor
Aron,

You can attach attributes to a graphic using name-value pairs see:

https://developers.arcgis.com/en/flex/guide/using-graphic.htm

Regards

Anthony
0 Kudos
AronHarris
New Contributor II
Hey Anthony,
That is what I was missing thanks..
That really helped me out....

Thanks again...
Aron
0 Kudos