Thanks for the response... still stuck I'm afraid. The error I'm getting is that: evt is undefined. Normally the identify runs from a user click, defined by the line in red below.... so I'm missing something.I've highlighted in green where the script get to...How do I define this evt. From the original markpoint(evt)?Cheers in advance, any help greatly appreciated.gsvc = new esri.tasks.GeometryService("http://bl-arcgis-1/ArcGIS/rest/services/Geometry/GeometryServer");
dojo.connect(map, "onClick", markpoint);
dojo.connect(map, "onLoad", mapReady);
};
function markpoint(evt) {
map.graphics.clear();
var point = evt.mapPoint;
var symbol = new esri.symbol.SimpleMarkerSymbol().setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND);
var graphic = new esri.Graphic(point, symbol);
var outSR = new esri.SpatialReference({ wkid: 27700});
map.graphics.add(graphic);
gsvc.project([ point ], outSR, function(projectedPoints) {
pt = projectedPoints[0];
graphic.setInfoTemplate(new esri.InfoTemplate("HERE?",
"<p> X: " + pt.x +
"<br/> Y: " + pt.y +
"</p>" +
"<input type='button' value='CONFIRM' onClick='executeIdentifyTask(evt);' />" +
"<div id='latlong'></div>"));
map.infoWindow
.setTitle(graphic.getTitle())
.setContent(graphic.getContent())
.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
});
}
function mapReady(map){
//create identify tasks and setup parameters
//dojo.connect(map,"onClick",executeIdentifyTask);
identifyTask = new esri.tasks.IdentifyTask("http://bl-arcgis-1/ArcGIS/rest/services/CRM/MapServer");
identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = false;
identifyParams.layerIds = [1,2,3,4];
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
identifyParams.width = map.width;
identifyParams.height = map.height;
}
function executeIdentifyTask(evt) {
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;