AnsweredAssumed Answered

Programmatically adding multiple points to the map

Question asked by mohit.bhonde on Oct 14, 2011
Latest reply on Jun 21, 2017 by khaldoon_82

I intend to programatically add Points(Pins) on the map.

I have a function which looks like this

var mp = new esri.geometry.Multipoint(new esri.SpatialReference({wkid:4326}));
mp.points =  [[-122.63,45.51],[-122.56,45.51],[-122.56,45.55],[-122.62,45.],[-122.59,45.53]];

var simpleMarkerSymbol = new esri.symbol.PictureMarkerSymbol('images/red-pushpin.png', 24, 24);
var infoTemplate = new esri.InfoTemplate("Vernal Pool Locations");  
var graphic = new esri.Graphic(mp, simpleMarkerSymbol, infoTemplate);

   console.debug("adding a graphic to the map" + graphic);;

I am using 2.4 version of the JSAPI. Upon executing, the pin gets placed at the centre of the map and all i see is one (overlapping) pin

Any thoughts on where I might be going wrong?