I've created a simple map on arcgis.com and am able to render the map in my web pages using a map key. However, I'd like to be able to add a point from my server side code. Here is my code so far. How do add a new graphic point? ESRI has terribly limited documentation and usually its examples cut out a lot of dependencies.
var point = new esri.geometry.Point(lon, lat, mapDeferred.spatialReference); var symbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0, 255, 0])); var graphic = new esri.Graphic(point, symbol);
ESRI has terribly limited documentation and usually its examples cut out a lot of dependencies.
Actually, compared to many other libraries I reckon their doco is pretty good!
You've got two dojo.ready functions, which might be a problem. Perhaps try running the addPointToMap function on the map's onLoad event to see if that makes any difference.
The help file says that "The graphics object is available to use after the Map.onLoad event."