TypeError: this.spatialReference is undefined

1599
2
05-28-2014 09:36 AM
MatthewBorr
New Contributor III
I am calling two services, but getting this error in firebug: "TypeError: this.spatialReference is undefined"


 var it = new InfoTemplate();
    it.setTitle("Low Income Housing Information");
    it.setContent("<b>Score:</b>${Score}<br/>" +
                            "<b>Name: </b>${Name}<br/>" +
        "<br><b>Address:</b> ${Address}<br>"  );
                         

  
 var a = new FeatureLayer("http://gis-server.cc.wmich.edu/harcgis/rest/services/hdream/house/MapServer/0",
  { mode: FeatureLayer.MODE_SNAPSHOT,
 infoTemplate: it,
 } );
    
 var b = new FeatureLayer("http://gis-server.cc.wmich.edu/harcgis/rest/services/hdream/kcountyborder/MapServer/1" );
 
  
  

    map.addLayer(a)
   map.addLayer(b)


Puzzled as to what this error is, and how to fix it?
0 Kudos
2 Replies
MatthewBorr
New Contributor III
Also "Unexpected value NaN parsing x attribute." Are these errors related. Is there a problem in the service(s) itself or the code?
0 Kudos
JeffPace
MVP Alum
I have seen this error too.  Frequently is was from trying to use a map right away, instead of waiting for the onload event to fire
0 Kudos