Hi evryone,
I want to show multiple info windows on arcgis map in my flex mobile application. I have various latitude and longitude to display info window.
Here's the code of what i am trying to do
if(filterXML.information.gram_panchayat != "error")
{
var testPoint:MapPoint;
for each(table2 in filterXML.information)
{
testPoint = new MapPoint(table2.lat, table2.lng);
var ptGraphic:Graphic = new Graphic(null, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 5, 0x0000FF));
ptGraphic.geometry = testPoint;
myGraphicsLayer.add(ptGraphic);
lblPop.text = table2.total;
map.infoWindow.label = table2.gram_panchayat;
//map.infoWindow.closeButtonVisible = false;
map.infoWindow.show(testPoint);
}
}
This is the code display multi info windows, but it display only one info window which comes last in the XML list.
How, can i do it?
Solved! Go to Solution.
Hi Robert,
Thanks for your help..
I just added these lines to my code and it worked fine.
Sam,
The maps info window is a singleton object and thus you can only have one.You could try using the infoSymbol for your symbology instead of SimpleMarkerSymbol. You can find a sample of that here
Robert,
How, can i create custom infosymbol in action script.
Sam,
I provided a sample link in my last post.
I need to make a custom info symbol in action script with coding. I understood what you gave me in last reply
Sam,
It looks like in your workflow if the filterXML gram_panchayat is not an error then you want to create a graphic and display an info window. So there is no need to create the InfoSymbol in as3 inside your loop. You should create and define the InfoSymbol in mxml and then just set the graphics symbol to this InfoSymbol in your loop. If you want your InfoSymbol to look a certain way then you can look at this sample
Hi Robert,
I did as you mentioned. But, i am not able to pass the mapPoint to the infosymbol and without it i am getting the result as attached.
Also, i am attaching the code what i have done
Now, how can i add x and y co-ordinates to it?
"Alert.show();" written in the code gives me the x and y to plot the blue points on the map and i have to use the same x and y co-ordinates to display these infosymbols
Hi Robert,
Thanks for your help..
I just added these lines to my code and it worked fine.