Solved! Go to Solution.
<!DOCTYPE html>
<html>
<head>
<title>Create a Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<style>
html, body, #mapDiv{
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="http://js.arcgis.com/3.8/"></script>
<script>
var map;
require(["esri/map","esri/layers/ArcGISDynamicMapServiceLayer","esri/tasks/QueryTask","esri/tasks/query","esri/symbols/SimpleMarkerSymbol","esri/tasks/FeatureSet","dojo/domReady!"],
function(Map,ArcGISDynamicMapServiceLayer,QueryTask,Query, SimpleMarkerSymbol,FeatureSet)
{
map = new Map("mapDiv",
{
center: [-56.049, 38.485],
zoom: 3,
basemap: "streets"
});
var SunySchoolsLayer = new ArcGISDynamicMapServiceLayer("http://w7hp348/arcgis/rest/services/Testservice/XTest/MapServer");
map.addLayer(SunySchoolsLayer);
var queryTask= new QueryTask("http://w7hp348/arcgis/rest/services/Testservice/XTest/MapServer/0");
var query = new Query();
query.where ="CampusName= 'Albany'";
//query.outSpatialReference = map.spatialReference;
query.returnGeometry = true;
query.outFields = ["CampusName"];
queryTask.execute(query,showResults);
//console.log("My query results:", featureSet.features);
var symbol = new SimpleMarkerSymbol();
symbol.setStyle(SimpleMarkerSymbol.STYLE_SQUARE);
symbol.setSize(50);
var resultFeatures=FeatureSet.features;
console.log("My query results:", FeatureSet.length);
console.log("My query results:", FeatureSet.features); //returns an array of your query result's features
function showResults(resultFeatures)
{
for(var i=0, i1=resultFeatures.features.length; i<i1; i++);
{
var graphic=resultFeatures;
graphic.setSymbol(symbol);
map.graphics.add(graphic);
}
}
});
</script>
</head>
<body class="tundra">
<div id="mapDiv"></div>;
</body>
</html>
Thanks to all that helped, I'm going to consider this thread closed now.