Display ArcMap Query Layer

Discussion created by bcalvert on Mar 1, 2012
Latest reply on Mar 1, 2012 by bcalvert
Let me start by noting that I am new to JavaScript and I have been working with the JavaScript API for about 3 weeks now.  I am working with ArcGIS 10 Desktop and ArcGIS 10 Server.  In ArcMap, I have created a Query Layer and it is in a project along with some other shape file data.  I have published the .mxd to our ArcGIS server and the service is working.

In my application I am able to call, render, interact with the data that was a shape file data using the FeatureLayer.  That all works great, but...   I am having problems calling the layer that was created using the Query Layer.  I have tried to access it using the FeatureLayer with out success.  I have included my call below, please advise on how I can call the Query Layer.

  function initSalesPoints() {
   var SalesPointsInfoTemplate = new esri.InfoTemplate();
   SalesPointsInfoTemplate.setTitle("<b>Sale Points</b>");
       SalesPointsInfoTemplate.setContent ("<b>Listing Number</b>  ${Number_Display}<br/>"
              +"<b>Recording Date</b>  ${Selling_Date}<br/>"
              +"<b>Sale Price</b>  ${SellPrice}"
   SalesPointsLayer = new esri.layers.FeatureLayer(gisServer+SalesPointsLayer_ID,{
     mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
     outFields: ["Number_Display", "Selling_Date", "SellPrice", "County"],
     opacity: 1.0,
     visible: false,
     infoTemplate: SalesPointsInfoTemplate

   var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10,
       new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
       new dojo.Color([255,0,0]), 1),
       new dojo.Color([0,255,0,0.25])
   var renderer = new esri.renderer.SimpleRenderer(symbol);
   layerList.push(SalesPointsLayer);  // #4