On click of button show infowindow

602
1
05-23-2011 04:14 AM
IrisGreen
New Contributor
Hi!

I am new to Flex and was working on sample (info window) given in the esri sample for Flex api.http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=FeatureLayer_Click_OnDemand

I wanted the infowindow to get activated after I click a button and then clicking on the map.

Thanks in advance

Iris
Tags (2)
0 Kudos
1 Reply
JanicePeal
Occasional Contributor
setting the infowindowrenderer inline will kick off the info window, so (using the sample flayer id) you remove

<esri:infoWindowRenderer>
                <fx:Component>
                    <mx:VBox backgroundColor="0xffffff"
                             color="0x444444"
                             label="Parcel {data.PARCELID}">
                        <mx:Label text="Owner: {data.OWNERNME1}"/>
                        <mx:Label text="Address: {data.SITEADDRESS}"/>
                        <mx:Label text="Land Value: {data.LNDVALUE}"/>
                        <mx:Label text="Landuse: {data.USECD}"/>
                    </mx:VBox>
                </fx:Component>
            </esri:infoWindowRenderer> 


from the feature layer (inline), then set a click event for your info button to call a function like this:

private function set infoWindowRenderer(event:MouseEvent):void
{
   flayer.infoWindowRenderer = new ClassFactory(point to an infoWindowRenderer);
}

you can create any custom infoWindow renderer you want in your apps assets or in a separate library and call it by package, for example assets.renderers.infoRend1. 

Does that help?
0 Kudos