Select to view content in your preferred language

infowindowrenderes for dynamic services

896
2
Jump to solution
07-27-2013 11:16 AM
BruceRalston
Emerging Contributor
Hello,
I have a dynamic service with three layers and I would like to use a custom info window for each layer. I have declared the info window renders in the MXML and used an identify task to return the features.  However, the info window that displays is the default window.  Here is the mxml declaration:

<esri:ArcGISDynamicMapServiceLayer id="legLayers" url="http://myurl/arcgis/rest/services/legislative25/MapServer/">
<esri:layerInfoWindowRenderers>
<esri:LayerInfoWindowRenderer >
  <esri:infoWindowRenderer>
      <fx:Component>
   <esri:LabelDataRenderer label="State House">
    <s:VGroup paddingBottom="5"
      paddingLeft="5"
      paddingRight="5"
      paddingTop="5">
                <s:Label text="District: {data.DISTRICT}"/>
                <s:Label text="Representative: {data.NAME}"/>
                <s:Label text="Email: {data.Email}"/>
                <s:Label text="Affiliation: {data.Party}"/>
    </s:VGroup>
   </esri:LabelDataRenderer>
     </fx:Component>
     </esri:infoWindowRenderer>
  ... SIMILAR SECTIONS FOR THE NEXT TWO LAYERS
</esri:ArcGISDynamicMapServiceLayer>

And the code for displaying the identify results

private function myResultFunction(results:Array, token:Object = null):void
{
    if (results && results.length > 0){
var list:ArrayList = new ArrayList();   
        for (var i:int = 0; i < results.length; i++){
  var result:IdentifyResult = results;     
  list.addItem(result.feature);     
}
contentNavigator.dataProvider = list;
myMap.infoWindowContent = contentNavigator;
myMap.infoWindow.show(clickLocation);
     }
     myMap.defaultGraphicsLayer.clear();
}
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DasaPaddock
Esri Regular Contributor
When you set layerInfoWindowRenderers, you don't need to show the InfoWindow yourself or use the IdentifyTask.

You do need to set the layerId on the LayerInfoWindowRenderer.

See:
https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/layers/supportClasses/LayerInfoWind...

View solution in original post

0 Kudos
2 Replies
DasaPaddock
Esri Regular Contributor
When you set layerInfoWindowRenderers, you don't need to show the InfoWindow yourself or use the IdentifyTask.

You do need to set the layerId on the LayerInfoWindowRenderer.

See:
https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/layers/supportClasses/LayerInfoWind...
0 Kudos
BruceRalston
Emerging Contributor
THANK YOU!!  Worked like a charm.
0 Kudos