Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have multiple feature layers on the map, and I wish to display a different sized infoWindow for each layer.

As far as I can tell, the map has one infoWindow, which can be resized using:

map.infoWindow.resize(width,height)

Each feature layer then provides the infoTemplate which contains the Title and Content, but no sizing information (right?).

How can I show a large infoWindow when clicking on FeatureLayer1, and a small infoWindow when clicking on FeatureLayer2?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Actually I think I figured it out.

Override the standard featureLayer onClick behaviour using:

dojo.connect(featureLayer1, "onClick", function () {
  map.infoWindow.resize(width1,height1)
});

dojo.connect(featureLayer2, "onClick", function () {
  map.infoWindow.resize(width2,height2)
});
share|improve this answer
    
That should do it! Good work Steve. –  Derek Swingley Feb 15 '12 at 18:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.