AnsweredAssumed Answered

Drawing a polygon using Easting and Northings

Question asked by peterbridger on Feb 15, 2012
Latest reply on Feb 16, 2012 by peterbridger
I'm using the polygon drawing code here to draw my own polygon retrieved using AJAX.

This is for a web application designed to run in the UK, so the points retrieved are eastings and northings.

However I don't understand how to get ESRI ArcGIS to display polygons using eastings and northing are points.

I've been looking through the documentation and examples, but I'm struggling to find anything that can help me.

My code is as follows:

               var points = new Array();                var csv = result.Value.split(','); // CSV of eastings and northings                for( var i = 0; i < csv.length; i+=2){                 points[points.length] = new esri.geometry.Point(csv[i], csv[i+1]);                }                                 // Draw polygon                var polygon = new esri.geometry.Polygon();                polygon.addRing(points);                polygon.spatialReference = new esri.SpatialReference({ wkid: 27700 }); // British National Grid                                  // Add the polygon to map                 var symbol = new esri.symbol.SimpleFillSymbol().setStyle(esri.symbol.SimpleFillSymbol.STYLE_SOLID);                 polygonGraphic = new esri.Graphic(polygon, symbol);       ;

Any help would be very much appreciated

Peter Bridger