igolka6662

calculate the distance between two points

Discussion created by igolka6662 on Nov 18, 2012
Latest reply on Nov 18, 2012 by igolka6662
Hellow. Please, help me.
Why my code do not working???
var distParams = new esri.tasks.DistanceParameters();
  distParams.distanceUnit = esri.tasks.GeometryService.UNIT_SQUARE_METERS;    
  distParams.geometry1 = new esri.geometry.Point(-118.15, 33.80, new esri.SpatialReference({ wkid: 4326 }));     
  distParams.geometry2 = new esri.geometry.Point(-188.15, 83.80, new esri.SpatialReference({ wkid: 4326 }));
  distParams.geodesic = true;
  var geometryService;
    geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
    geometryService.distance(distParams,function(distance){
   dojo.byId("distance").innerHTML = distance;
   }); 

urgently,please!!!

Outcomes