Solved! Go to Solution.
//Fetch parameters to buffer
function BufferParameters() {
isSpanClicked = false;
HideMapTip();
dojo.disconnect(mouseMoveHandle);
var params = new esri.tasks.BufferParameters();
if (map.getLayer(queryGraphicLayer).graphics) {
var polygon = new esri.geometry.Polygon(map.spatialReference);
for (var i = 0; i < map.getLayer(queryGraphicLayer).graphics.length; i++) {
polygon.addRing(map.getLayer(queryGraphicLayer).graphics.geometry.rings[0]);
}
params.geometries = [polygon];
}
else {
alert(messages.getElementsByTagName("createBuffer")[0].childNodes[0].nodeValue);
}
params.distances = [dist.value];
params.unit = esri.tasks.GeometryService.UNIT_FOOT;
params.bufferSpatialReference = new esri.SpatialReference({
wkid: 2238
});
params.outSpatialReference = map.spatialReference;
esri.config.defaults.io.alwaysUseProxy = true;
geometryService.buffer(params, ShowBuffer, function (err) { HideLoadingMessage(); alert("Query " + err); }); //querying geometry service for buffered geometry
esri.config.defaults.io.alwaysUseProxy = false;
selectedPoint = null;
displayInfo = null;
map.infoWindow.hide();
if (findTasksGraphicClicked) {
findTasksGraphicClicked = false;
graphicLayerClicked = false;
}
ShowLoadingMessage('Buffering');
}
SJ City:
Is this public notification tool available to be added to a Javascript/HTML5 app? If so, do you know of any documentation that would describe this process.
Also, where on the ESRI website would I find this tool?
//Fetch parameters to buffer
function BufferParameters() {
isSpanClicked = false;
HideMapTip();
dojo.disconnect(mouseMoveHandle);
var params = new esri.tasks.BufferParameters();
if (map.getLayer(queryGraphicLayer).graphics) {
var polygon = new esri.geometry.Polygon(map.spatialReference);
for (var i = 0; i < map.getLayer(queryGraphicLayer).graphics.length; i++) {
polygon.addRing(map.getLayer(queryGraphicLayer).graphics.geometry.rings[0]);
}
params.geometries = [polygon];
}
else {
alert(messages.getElementsByTagName("createBuffer")[0].childNodes[0].nodeValue);
}
params.distances = [dist.value];
params.unit = esri.tasks.GeometryService.UNIT_FOOT;
params.bufferSpatialReference = new esri.SpatialReference({
wkid: 2238
});
params.outSpatialReference = map.spatialReference;
esri.config.defaults.io.alwaysUseProxy = true;
geometryService.buffer(params, ShowBuffer, function (err) { HideLoadingMessage(); alert("Query " + err); }); //querying geometry service for buffered geometry
esri.config.defaults.io.alwaysUseProxy = false;
selectedPoint = null;
displayInfo = null;
map.infoWindow.hide();
if (findTasksGraphicClicked) {
findTasksGraphicClicked = false;
graphicLayerClicked = false;
}
ShowLoadingMessage('Buffering');
}
Hi @Luci Hawkins,
I think I am seeing this exact same error. I'm trying to figure out where to plug in your fix but I'm not seeing anything similar to your posted code in the locator.js file that I have. Also, your note says "The code in red is what I added" but there isn't any red that I can see. Maybe any styling got stripped out when it got sent to this site.
Thanks,
Mark
This was for version 10.2 of the Public Notification tool. The line of code that was in red was:
params.bufferSpatialReference = new esri.SpatialReference({
wkid: 2238
});
If you are using the same version, search for the BufferParameters function and add that line to the params. Be sure and change the wkid: to the same one your map is using.
Hope it helps!
Luci
In the locator.js file, I added code because my parcel map is in a different projection and it cleared up the buffer error.
The code in red is what I added.
Hope this helps,
Luci