var x = dojo.byId("txtX").value; var y = dojo.byId("txtY").value; var point = new esri.geometry.Point(x,y, new esri.SpatialReference({ wkid: 4326 })); var graphic = new esri.Graphic(point,null,null); surveyPointLayer.applyEdits([graphic],null,null, function(addResults) { surveyPointLayer.refresh(); },function(err){ alert(err); });
var attributes = {}; attributes.SPEED = location.coords.speed; attributes.ACCURACY = location.coords.accuracy; attributes.DATETIME = now.getTime(); var pt = esri.geometry.geographicToWebMercator(new esri.geometry.Point(location.coords.longitude, location.coords.latitude)); var graphic = new esri.Graphic(new esri.geometry.Point(pt, map.spatialReference), null, attributes); featureLayer.applyEdits([graphic], null, null, function(adds) {
function SubmitControlPoint(){ var x = dojo.byId("txtX").value; var y = dojo.byId("txtY").value; var point = new esri.geometry.Point(x,y, new esri.SpatialReference({ wkid: 4326 })); var attributes = {}; var pt = esri.geometry.geographicToWebMercator(point); var graphic = new esri.Graphic(pt, null, attributes); surveyPointLayer.applyEdits([graphic],null,null,function(addResults) { surveyPointLayer.refresh(); },function(err){ alert(err); }); }
function addData(){ var x = dojo.byId('xval').value; var y = dojo.byId('yval').value; var point = new esri.geometry.Point(x,y,new esri.SpatialReference({wkid:4326})); var graphic = new esri.Graphic(point,null,null); featureLayer.applyEdits([graphic],null,null, function(addResults,updateResults,deleteResults) { console.log("ObjectId = " + addResults[0].objectId); },function(error){ console.log("error occurred"); }); }