AnsweredAssumed Answered

My Graphics objects get plotted on very strange places

Question asked by geonetadmin on Aug 7, 2012
Latest reply on Aug 22, 2012 by clindholm
Original User: clindholm

Hi,

I have a simple code that should add one graphic point to a basic world street map. I cannot find out why my graphic point gets plotted at very strange coordinates. What is wrong in my code below when the testGraphic object gets plotted at the equator and not inside Finland.
The map extent gets correctly set (see attachment 1), but as can bee seen in the second attachment the point gets plotted near coordinates 0N 0E.

dojo.require("esri.map");  function init(){     var map = new esri.Map("map",{   wrapAround180:true,   extent: esri.geometry.geographicToWebMercator(new esri.geometry.Extent(19.5, 59, 31.7, 70.5 , new esri.SpatialReference(4326)))  });    dojo.connect(window,'resize',map,map.resize);    var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");  map.addLayer(tiledMapServiceLayer);    dojo.connect(map, "onLoad", function() {     var Point = new esri.geometry.Point(20, 60, new esri.SpatialReference(4326));       var testGraphic =    new esri.Graphic(     Point,     new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0,0,255])),     {"Point":"1"},     new esri.InfoTemplate()    );   map.graphics.add(testGraphic);  });   }   dojo.addOnLoad(init);



Thanks in advance,
-Christian

Attachments

Outcomes