kirill_lykov

trying to display my point

Discussion created by kirill_lykov on Apr 21, 2011
Latest reply on Apr 21, 2011 by kirill_lykov
I'm trying to display my point using the following code:

var extent = new esri.geometry.Extent(
 { "xmin":-97.0,"ymin":38.0,"xmax":-96.0,
           "ymax":39.0,"spatialReference":{"wkid":4269}});
map = new esri.Map("map", { extent: esri.geometry.geographicToWebMercator(extent)});

//... then in the call back function for map's onLoad event:
 
var symbol = new esri.symbol.SimpleMarkerSymbol();
symbol.style = esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE;
symbol.setSize(8);
symbol.setColor(new dojo.Color([255,255,0,0.5]));
  
var point = new esri.geometry.Point(x, y);
var graphic = new esri.Graphic(point, symbol);
map.graphics.add(graphic);


The problem is this code always displays point somewhere in in the Africa and it doesn't depend on the x, y values passed to the Point constructor. For instance, I tried 0.0,0.0 and -80.12468662, 40.42756484.
Where is the mistake? Perhaps, I need to convert point to be point in the display coordinates? How can I do this?

Outcomes