Select to view content in your preferred language

How to show multiple infowindow at the same time?

766
2
03-09-2011 07:23 PM
jianhuizhou
Emerging Contributor
Hi,everyone

How to show multiple infowindow at the same time?Now if you show the second infowindow the first one will hide.Have any idea to show them at the same time?
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
jianhui,

   The map is only allowed to have one info window (singleton design).
0 Kudos
Hernando_CountyProperty_Apprai
Regular Contributor
Add a new object as type InfoWindow as follows:

[INDENT]var callout:InfoWindow = new InfoWindow(map);[/INDENT]

Then set the properties of the InfoWindow.  In the following example the header of the InfoWindow is "Test" and the content is a TextArea that has the text "This is my test"

[INDENT]callout.label = "Test";
var calloutText:TextArea = new TextArea();
calloutText.editable = false;
calloutText.text = "This is my test";
callout.content = calloutText;[/INDENT]


Now make your new InfoWindow visible and place it where the user clicked:
[INDENT]callout.setVisible(true,false);
var position:MapPoint = event.graphic.geometry as MapPoint;
callout.show(position);
[/INDENT]

Now add it to the map:
[INDENT]map.addChild(callout);[/INDENT]
0 Kudos