Select to view content in your preferred language

Multiple infowindow in arcgis map

3612
8
Jump to solution
07-09-2014 09:57 PM
SamarthGupta
Deactivated User

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?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
SamarthGupta
Deactivated User

Hi Robert,

Thanks for your help..

I just added these lines to my code and it worked fine.

Untitled.png

View solution in original post

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

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

SamarthGupta
Deactivated User

Robert,

How, can i create custom infosymbol in action script.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Sam,

   I provided a sample link in my last post.

0 Kudos
SamarthGupta
Deactivated User

I need to make a custom info symbol in action script with coding. I understood what you gave me in last reply

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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

SamarthGupta
Deactivated User

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.

Untitled.png

Also, i am attaching the code what i have done

Untitled1.png

0 Kudos
SamarthGupta
Deactivated User

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

0 Kudos
SamarthGupta
Deactivated User

Hi Robert,

Thanks for your help..

I just added these lines to my code and it worked fine.

Untitled.png

0 Kudos