After adding graphics trying to zoom map using the code below. But it is giving script error.How to zoom map with all graphics visibility?
//ADDING GRAPHICS
var geomPoint = new esri.geometry.Point(list.d[recordcount].ELon, list.d[recordcount].ELat, new esri.SpatialReference({ wkid: 2278 }));
geomPoint = esri.geometry.geographicToWebMercator(geomPoint);
var symbol = new esri.symbol.PictureMarkerSymbol({
"url": colourstyle,
"height": 16,
"width": 16,
"type": "esriPMS"
});
var infoTemplate = new esri.InfoTemplate();
infoTemplate.content = strhotspot;
var pointGraphic = new esri.Graphic(geomPoint, symbol);
pointGraphic.setInfoTemplate(infoTemplate);
graphicsLayer.add(pointGraphic);
//Getting Extent
//var zoomExtent = esri.graphicsExtent(graphicsLayer.graphics);
//map.setExtent(zoomExtent);
var lyrExtent = esri.geometry.geographicToWebMercator(esri.graphicsExtent(graphicsLayer.graphics));