I am in the process of configuring the ParksFinder template from the Local Government resource center. I have gotten everything to work except for that when I try to select parks that are within the 1 mile buffer the query returns all the parks in my map service.I have changed the spatial reference throughout my app to match my services. When I use Firebug I can see the extent sent through the query seems to be correct, but the query always returns all the park features.The spatial reference I am currently using is "wkid: 103779". I have also reomved all references to esri services including the routing functionality, so I am not sure why there would be an issue with my spatial reference. I have tested out some attribute queries and they all work, so it is definitely an issue with the spatial relationship portion of the query statement.Here is the code for my query task.../function for drawing the buffer
function DoBuffer(bufferDistance, mapPoint) {
if (mapPoint && bufferDistance) {
var params = new esri.tasks.BufferParameters();
params.distances = [bufferDistance];
params.unit = esri.tasks.GeometryService.UNIT_STATUTE_MILE;
params.bufferSpatialReference = map.spatialReference;
params.outSpatialReference = map.spatialReference;
params.geometries = [mapPoint];
params.unionResults = true;
geometryService.buffer(params, ShowBuffer);
features = [];
}
}
//function for Displaying the buffer
function ShowBuffer(geometries) {
ClearBuffer();
var lineColor = new dojo.Color();
lineColor.setColor(rendererColor);
var fillColor = new dojo.Color();
fillColor.setColor(rendererColor);
fillColor.a = 0.55;
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
lineColor, 2),
fillColor);
dojo.forEach(geometries, function (geometry) {
AddGraphic(map.getLayer(tempBufferLayer), symbol, geometry);
});
map.setExtent(geometries[0].getExtent().expand(1.2));
QueryLayer(geometries[0]);
}
//function for getting the features and their length with in the buffer region
function QueryLayer(geometry) {
var cityName = "CITY OF BIG LAKE";
var qTask = 'qTask';
qTask = new esri.tasks.QueryTask(devPlanLayerURL);
var query = new esri.tasks.Query();
query.geometry = geometry;
query.outFields = ["*"];
query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_WITHIN;
query.returnGeometry = true;
qTask.execute(query, function (featureset) {
if (dojo.byId('spanParkActivityContainer')) {
dojo.byId('spanParkActivityContainer').style.display = 'none';
}
dojo.byId('spanParkListContainer').innerHTML = 'Found ' + featureset.features.length + ' park(s) near the address';
CreateDistance(featureset);
});
}
Anyone ever experience an issue like this before? Any help would be greatly appreciated.