Hey Zconlen, Thanks for getting back to me, I am messing around with the code you supplied, but getting a bit stuck.So far my geomerty point is:
////////////////AUCKLAND
var Auckland = new esri.geometry.Point(174.758, -36.855, new esri.SpatialReference({ 'wkid': 4326 }));
map.graphics.add(new esri.Graphic(esri.geometry.geographicToWebMercator(Auckland), // geometry
new esri.symbol.SimpleMarkerSymbol( {"angle":1,"xoffset":1,"yoffset":6,"type":"esriPMS","url":"http://static.arcgis.com/images/Symbols/Basic/BlueStickpin.png","imageData":"","contentType":"image/png","width":24,"height":24} ),
// symbol
{ 'title': 'TITLE', 'content': 'CONTENT' }, // attributes
new esri.InfoTemplate ('${title}', '${content}')
));
*
and I have added your code into my zoom to extent which is called from a HTML Button.
function ZoomToNewZealandAuckland() {
var customExtentAndSR = new esri.geometry.Extent(174.756,-36.857,174.763,-36.852,new esri.SpatialReference({"wkid":4326}));
map.setExtent(customExtentAndSR);
var extent = map.extent;
if(extent.contains(graphic.geometry)) {
//Use html to mimic look and feel of default webmap popup
//Use html to mimic look and feel of default webmap popup
var infoTemplate = new esri.InfoTemplate("test", "<div id='Popup'><strong>${title}</strong><hr><table cellpadding='5'><tr><td></td></tr><tr></tr><tr><td><td>${content}</td></tr></table><br></div>");
//call defineInfoTemplate func, to apply above infoTemplate to features
defineInfoTemplate(Auckland, infoTemplate);
//set infowindow features to full array
map.infoWindow.setFeatures(Auckland);
//text for title bar
map.infoWindow.setTitle('+ title +');
// zoom map
map.infoWindow.show(Auckland);
}
Everything works fine but no infowindow. This is my first esri Javascript so feeling quite lost.Thanks for you help! much appreciated