AnsweredAssumed Answered

Graphic layer won't show

Question asked by ngalford on May 3, 2012
Latest reply on May 4, 2012 by ngalford
I'm recreating the "multiple graphic layer" example but the graphic layer won't show. I'm using Bing for the basemap and our internal Server Services for the layers Any insight would be great.

Thanks

dojo.require("esri.map");       dojo.require("esri.virtualearth.VETiledLayer");       dojo.require("esri.layers.FeatureLayer");       dojo.require("esri.layers.graphics");       dojo.require("esri.tasks.query");        var map, graphics, BINGMAPS;        function init()        {         var initialExtent = new esri.geometry.Extent({ "xmin": -9414173.061, "ymin": 3995118.342, "xmax": -9398289.375, "ymax": 4014748.679, "spatialReference": { "wkid": 102100} });         map = new esri.Map("map", {extent: initialExtent,wrapAround180: true, logo:false});                  dojo.connect(map, "onLoad", doQueries);         veTileLayer = new esri.virtualearth.VETiledLayer({bingMapsKey: 'AimF6LphvVcbtQZOyiopeyQT8n-QOTukhwoRZwnzKL1MM0_B1Dfc7ppeKmyPByKp',      mapStyle: esri.virtualearth.VETiledLayer.MAP_STYLE_ROAD });         map.addLayer(veTileLayer);       }        function doQueries(map)        {         //Locomotive Query         var locQueryTask = new esri.tasks.QueryTask("http://esoc1.nscorp.com/ArcGISProduction/rest/services/ITGIS/LOCOMOTIVE_LOCATION/MapServer/0");         var locQuery = new esri.tasks.Query();         locQuery.outFields = ["Loc_INIT", "LOC_NUM", "DTM", "LOC_TYPE", "FUEL_LEVEL, ENGINE_ONOFF, ENGINE_TEMP"];         locQuery.returnGeometry = true;         locQueryTask.execute(locQuery, LocSymbology);          //Track Query         var TrackQueryTask = new esri.tasks.QueryTask("http://esoc1.nscorp.com/ArcGISProduction/rest/services/EGIS/ENG_TRACK/MapServer/1");         var TrackQuery = new esri.tasks.Query();         TrackQuery.outFields = ["DIVCODE", "CREATEDATE"];         TrackQuery.returnGeometry = true;         TrackQuery.outSpatialReference = map.spatialReference;         TrackQueryTask.execute(TrackQuery, TrackSymbology);                  //Milepost Query         var MPQueryTask = new esri.tasks.QueryTask("http://esoc1.nscorp.com/ArcGISProduction/rest/services/EGIS/ENG_MPMARK/MapServer/0");         var MPQuery = new esri.tasks.Query();         MPQuery.outFields = [ "MPMARKER", "DIVCODE", "CREATEDATE", "ASSET_PK" ];         MPQuery.returnGeometry = true;         MPQuery.outSpatialReference = map.spatialReference;         MPQueryTask.execute(MPQuery, MPSymbology);                  //Extra Section for another layer to be queried         /*var cityQueryTask = new esri.tasks.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0/");         var cityQuery = new esri.tasks.Query();         cityQuery.outFields = ["*"];         cityQuery.returnGeometry = true;         cityQuery.outSpatialReference = map.spatialReference;         cityQueryTask.execute(cityQuery, addCityFeatureSetToMap);*/       }              function TrackSymbology(featureSet) {         var TrackSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,97,3]), 2);          //Create graphics layer for cities         var TrackLayer = new esri.layers.GraphicsLayer("http://esoc1.nscorp.com/ArcGISProduction/rest/services/EGIS/ENG_TRACK/MapServer/1");         TrackLayer.setInfoTemplate(new esri.InfoTemplate("Track Division: ","${DIVCODE}","${*}"));                  map.addLayer(TrackLayer);         //map.reorderLayer(TrackLayer,1);          //Add cities to the graphics layer         dojo.forEach(featureSet.features, function(feature) {TrackLayer.add(feature.setSymbol(TrackSymbol));         });       }              function LocSymbology(featureSet) {         var locsymbol =  new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, new dojo.Color([255,0,0]), 3);          //Create graphics layer for Locomotive         var locLayer = new esri.layers.GraphicsLayer("http://esoc1.nscorp.com/ArcGISProduction/rest/services/ITGIS/LOCOMOTIVE_LOCATION/MapServer/0");         locLayer.setInfoTemplate(new esri.InfoTemplate("${LOC_INIT}${LOC_NUM}","${*}"));         map.addLayer(locLayer);         //map.reorderLayer(TrackLayer,1);          //Add Locomotive to the graphics layer         dojo.forEach(featureSet.features, function(feature) {           locLayer.add(feature.setSymbol(locsymbol));         });       }       function MPSymbology(featureSet) {         var MPSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, new dojo.Color([0,178,238]), 2);          //Create graphics layer for cities         var MPLayer = new esri.layers.GraphicsLayer("http://esoc1.nscorp.com/ArcGISProduction/rest/services/EGIS/ENG_MPMARK/MapServer/0");         MPLayer.setInfoTemplate(new esri.InfoTemplate("MP Number: ","${MPMARKER}","${*}"));                  map.addLayer(MPLayer);         //map.reorderLayer(MPLayer,1);          //Add cities to the graphics layer         dojo.forEach(featureSet.features, function(feature) {         MPLayer.add(feature.setSymbol(MPSymbol));         });       }        dojo.addOnLoad(init);     </script>    </head>   <body>     <div id="map" style="width:100%; height:100%;">      <a href="http://www.mapsd.nscorp.com"><img src="Images/itgispoweredby.png" alt="View Logo" /></a>      </div>   </body>

Outcomes