AnsweredAssumed Answered

Adding a graphic to graphic layer is adding it to different position then map click

Question asked by Kirtika_Chauhan on Mar 28, 2014
Latest reply on Apr 23, 2014 by Kirtika_Chauhan
Hi,

I am trying to add graphic(point) to my map, it adds the graphic but not at the mapclick point. It adds at a different position when I
zoom out the Map then only I am able to see the added graphic. But this works fine for second mapclick onwards. I am facing this
issue only for first map click. When I click on the map second time it draws the graphic at click location but not first time.

Any help would be really grateful.

My sample code is :     if (dojo.connect(Map, "onClick", function (e) {

        var newgraphic = new esri.Graphic(e.mapPoint, symbol);
        Map.reposition();
        graphicsLayer.clear();
        graphicsLayer.add(newgraphic);
    }));

I have already added graphics layer to map.

Outcomes