map.infoWindow.setFeatures is not a function

2877
3
11-29-2011 12:36 PM
AaronConnolly
Occasional Contributor
I'm using a FeatureLayer and a query task on that FeatureLayer to select features and then show the features in the info window. I've adapted the FeatureLayer Popup sample here to my needs, but don't change anything in the map click event.

For a certain feature layer service that I have, this sample works just fine and I'm able to adapt the infoTemplate to my needs and setFeatures does not throw a script error.

However, if I change the feature layer service URL to a different albeit similar service (think production/development services) map.infoWindow.setFeatures throws an error.

I have searched this form and can't find any instance of this same exception.

What about my "live" FeatureLayerservice would cause this same code to throw an error? What does my live service need to do in order to behave correctly?

Thanks,
- Aaron
0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor
Is the url to your service public? If so can you share?
0 Kudos
JianminYu
New Contributor
map.infoWindow.setFeatures is only callable when you adopt a styled CSS using popup infoWindow, means you must import the popup css, and add the popup in map root dom.

Hope this solved your problem.....
0 Kudos
RobEck
by
New Contributor II
it is very important to do this, like it is in doku:
HTML: 
<link [...] popup.css">

JS:
        var popup= new esri.dijit.Popup(null,dojo.create("div"));
        var map = new esri.Map("mapDiv",{infoWindow:popup  });

without this three lines no setFeatures method. 🙂
0 Kudos