rcsellman

Issues adding point graphics from FindTask

Discussion created by rcsellman on Jun 4, 2014
I am building an application that has multiple FindTasks within it, each searching a different layer in the same service.  I have no problem adding polygon and line graphics to the map from the FindResult, but for some reason I cannot add points using SimpleMarkerSymbol.  The task appears to be executing as I watch network in Google dev tools (see attached image). 

I am sure I am missing something small.  Any help is very much appreciated!!

Here is the section of the application where I create the 3 symbols and FindTasks:

//create point, line and polygon graphic symbols
   
   var pointSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10,
         new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
         new Color([98, 194, 204]), 2),
         new Color([98, 194, 204, 0.5])
         );
   
   var lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
        new Color([0, 255, 255]), 4
        ); 
   var polygonSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
        new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, 
        new Color([98, 194, 204]), 2), 
        new Color([98, 194, 204, 0.5])
        );
   
   //start does valve search
   
   findValveTask = new FindTask("http://summitgis.summitoh.net:6080/arcgis/rest/services/DOES/MapServer/");
   
   map.on("load", function () {
    findValveParams =  new FindParameters();
    findValveParams.returnGeometry = true;
    findValveParams.layerIds = [0];
    findValveParams.searchFields = ["UNAME"];
    findValveParams.outSpatialReference = map.spatialReference;
   }); 
   
   function doDoesValveFind() {
   findValveParams.searchText = dom.byId("doesValveText").value;
   findValveTask.execute(findValveParams, showResults);
   }
   
   //This function works with an array of FindResult that the task returns and then //create array of attributes
   function showResults(results) {
                map.graphics.clear();
    arrayUtils.map(results, function (result) {
     var graphic = result.feature;
     graphic.setSymbol(pointSymbol);
     map.graphics.add(graphic);
     return result.feature.attributes;  
    });
   }
   
   //end does valve search
   
   //start does sewer line search
   
   findSewerLineTask = new FindTask("http://summitgis.summitoh.net:6080/arcgis/rest/services/DOES/MapServer/");
   
   map.on("load", function () {
    findSewerLineParams =  new FindParameters();
    findSewerLineParams.returnGeometry = true;
    findSewerLineParams.layerIds = [10];
    findSewerLineParams.searchFields = ["PIPEID"];
    findSewerLineParams.outSpatialReference = map.spatialReference;
   }); 
   
   function doDoesSewerLineFind() {
   findSewerLineParams.searchText = dom.byId("doesSewerLineText").value;
   findSewerLineTask.execute(findSewerLineParams, showResults);
   }
   
   //This function works with an array of FindResult that the task returns and then //create array of attributes
   function showResults(results) {
                map.graphics.clear();
    arrayUtils.map(results, function (result) {
     var graphic = result.feature;
     graphic.setSymbol(lineSymbol);
     map.graphics.add(graphic);
     return result.feature.attributes;  
    });
   }
   
   //end does sewer line search
   
   //start does private sewer line search
   
   findPrivateSewerLineTask = new FindTask("http://summitgis.summitoh.net:6080/arcgis/rest/services/DOES/MapServer/");
   
   map.on("load", function () {
    findPrivateSewerLineParams =  new FindParameters();
    findPrivateSewerLineParams.returnGeometry = true;
    findPrivateSewerLineParams.layerIds = [11];
    findPrivateSewerLineParams.searchFields = ["PIPEID"];
    findPrivateSewerLineParams.outSpatialReference = map.spatialReference;
   }); 
   
   function doDoesPrivateSewerLineFind() {
   findPrivateSewerLineParams.searchText = dom.byId("doesPrivateSewerLineText").value;
   findPrivateSewerLineTask.execute(findPrivateSewerLineParams, showResults);
   }
   
   //This function works with an array of FindResult that the task returns and then //create array of attributes
   function showResults(results) {
                map.graphics.clear();
    arrayUtils.map(results, function (result) {
     var graphic = result.feature;
     graphic.setSymbol(lineSymbol);
     map.graphics.add(graphic);
     return result.feature.attributes;  
    });
   }
   
   //end does private sewer line search
   
   //start does district search
   
   findDistrictTask = new FindTask("http://summitgis.summitoh.net:6080/arcgis/rest/services/DOES/MapServer/");
   
   map.on("load", function () {
    findDistrictParams =  new FindParameters();
    findDistrictParams.returnGeometry = true;
    findDistrictParams.layerIds = [12];
    findDistrictParams.searchFields = ["NAME"];
    findDistrictParams.outSpatialReference = map.spatialReference;
   }); 
   
   function doDoesDistrictFind() {
   findDistrictParams.searchText = dom.byId("doesDistrictText").value;
   findDistrictTask.execute(findDistrictParams, showResults);
   }
   
   //This function works with an array of FindResult that the task returns and then //create array of attributes
   function showResults(results) {
                map.graphics.clear();
    arrayUtils.map(results, function (result) {
     var graphic = result.feature;
     graphic.setSymbol(polygonSymbol);
     map.graphics.add(graphic);
     return result.feature.attributes;  
    });
   }
   
   //end does district search

Attachments

Outcomes