Well I am building a GIS web app using ArcGIS Javascript API , I want to create a user interface in which the user provides an array of coordinates and I have to get those coordinates and create a polygon on the map from this array of coordinates. Do you have any idea?
Take the 2-minute tour
×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
You could use a textarea to collect pairs of coordinates. The coordinates should have a comma between them and each pair should be separated by a new line. Then format the pairs to look like: [[[coord1,coord2],[coord3,coord4],[coord5,coord6]]] Here is an example of how to do that: HTML
JavaScript
Here is the code required (from the ESRI Javascript API) to create a new graphic using JSON. Pass in your arrayOfCoordinates variable as your rings and the wkid for your map's spatial reference. Then use your map object to add the graphic with map.graphic.add(graphic).
|
|||||||||
|