Hi, currently I am working on my school project, and I need to buffer a point when I select a point from the map. I am currently trying to use this sample http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm to try and buffer a point. However, when i try to change the map server to the one needed for my project, they requested me to include a proxy url. So I did, and have added the following line to the proxy.config file "<serverUrl url="http://www.onemap.sg/arcgis/rest/services/" matchAll="true"></serverUrl>" and also added these on the javascript codes " esriConfig.defaults.io.proxyUrl = "http://localhost:8893/proxy.ashx"; esriConfig.defaults.io.alwaysUseProxy = false;". The results that was return to me was an error code, it is error code 400 with no message and saying that the error is 'inSR' parameter is invalid,'outSR' parameter is invalid. I am currently stuck as to what to do with it, any help would be appreciated..
function doBuffer(evt) { map.graphics.clear(); alert("in Do Buffer"); var params = new esri.tasks.BufferParameters(); params.geometries = [evt.mapPoint];
//buffer in linear units such as meters, km, miles etc. params.distances = [5, 10]; params.unit = esri.tasks.GeometryService.UNIT_KILOMETER; params.outSpatialReference = map.spatialReference;
gsvc.buffer(params, showBuffer); }
function showBuffer(geometries) { alert("in Show Buffer"); var symbol = new esri.symbol.SimpleFillSymbol( esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol( esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 0, 255, 0.65]), 2 ), new dojo.Color([0, 0, 255, 0.35]) );
dojo.forEach(geometries, function (geometry) { var graphic = new esri.Graphic(geometry, symbol); map.graphics.add(graphic); }); }
dojo.addOnLoad(initialize); </script>
</head>
<body class="claro"> <b>Click a location on the map to buffer. Click again on another location to buffer again.</b> <div id="map" style="width:600px; height:400px; border:1px solid #000;"></div> </body>