Hi Joshua,
I'd say creating a polygon from a map click is certainly possible, but technicalities may be a bit different in ArcMap and the APIs.
When a user clickes a map, the map emits an on-click event. One of the properties of the parameter passed into the event handler is the point that was clicked. Take that point and calculate where the vertices of your polygon (like Darren suggested). I believe a map SilverLight (similarly to JavaScript) has one (or more) graphics layer(s), ideal for storing and displaying temporary geometries. Once you have your polygon, add it to the graphics layer.
Paste the code below into ArcGIS API for JavaScript Sandbox . Is it roughly what you want to do?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Polygon from map click</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<style>
html, body, #map { height: 100%; width: 100%; margin: 0; padding: 0; }
body { background-color: #FFF; overflow: hidden; font-family: "Trebuchet MS"; }
#help {position: absolute; top: 20px; right: 20px; z-index: 1001; background-color: white; padding: 10px;}
</style>
<script src="http://js.arcgis.com/3.10/"></script>
<script>
var map;
require(["esri/map", "esri/graphic",
"esri/geometry/webMercatorUtils",
"esri/geometry/Polygon",
"esri/symbols/SimpleFillSymbol",
"dojo/on","dojo/domReady!"
], function(Map, Graphic, webMercatorUtils, Polygon, SimpleFillSymbol) {
map = new Map("map", { basemap: "topo",center: [-92.0, 35.0], zoom: 9 });
var symbol = new SimpleFillSymbol({
"type": "esriSFS", "style": "esriSFSSolid", "color": [255,0,0,100],
"outline": {"type": "esriSLS", "style": "esriSLSSolid", "color": [255,0,0,255],"width": 1}
});
map.on('click', function(evt){
var pt = evt.mapPoint;
var x = pt.x, y = pt.y;
var dx = 500, dy = 1000; // THESE ARE JUST WEB MERKATOR UNITS NOW, NOT METRES!!!
var polygon = new Polygon({"rings":[[
[x - dx, y - dy], [x - dx, y + dy],
[x + dx, y + dy], [x + dx, y - dy], [x - dx, y - dy]
]], "spatialReference": pt.spatialReference});
//var pgwgs = webMercatorUtils.webMercatorToGeographic(polygon); // might come handy
var gr = new Graphic(polygon, symbol);
map.graphics.clear(); // may need to remove just a particular graphic
map.graphics.add(gr);
});
});
</script>
</head>
<body>
<div id="help">Click on the map to create a polygon</div>
<div id="map"></div>
</body>
</html>
I won't get into details about handling different coordinate systems now, maybe when we know what you are after. Also, you could potentially buffer the point and get envelope of the buffer to get a rectangle which you could then adjust. At what scale are you working? When I set the size to 10x20, the polygon wasn't even visible unless I zoomed really close.
Filip.