Select to view content in your preferred language

How do I auto-size an infoWindow?

1169
4
06-22-2010 03:54 AM
AndrewClark
Deactivated User
Hopefully someone out there as this one sused. if so, please tell me how?!!?!
0 Kudos
4 Replies
HallbjornViktorsson
Emerging Contributor
Not sure if your still looking for this but this might at lest help other that are in your shoes if you found the answer

dojo.connect(map,"onLoad", function(map) {map.infoWindow.resize(250, 100);} );

map.infoWindow.resize(250,100); <- Her you can determine the size of your info box, Hope this helps.
0 Kudos
AndrewClark
Deactivated User
Not quite what I was looking for but I found a solution;

Basically, I set the content of the infowindow and measured the outer-most tag (in my case a table), then used these measurements with some padding to account for the rest of the dialog, to set the size of the infowindow. It also helped converting spaces in text to " "'s.
0 Kudos
cosophy
Emerging Contributor
Not quite what I was looking for but I found a solution;

Basically, I set the content of the infowindow and measured the outer-most tag (in my case a table), then used these measurements with some padding to account for the rest of the dialog, to set the size of the infowindow. It also helped converting spaces in text to " "'s.


I�??ve been looking for it too!
I just want to dynamically set the size of the infowindow based on its content data size, but i do not quite understand your solution, could you give some sample code ?
0 Kudos
RaviKonaparthi
Deactivated User
Hi,

If you content is dynamic, then use dojo.coords() function to get the dimensions of the table(dynamic content) and accordingly resize the infowindow so that the content will adjust as per the content.

Regards,
Ravi.
0 Kudos