aka2demo

best infowindow/popup approach for graphics

Discussion created by aka2demo on Oct 16, 2012
We have a simple asp.net project where we upload LAT/LONGS from a user query. Define an array, with lat/longs, load this array into a graphics layer, then display the graphicslayer a basemap and zoom to the graphicslayer. The page, basemap and graphic layer loads fine. However we having issues figuring out what is the best way to simply display an info window for the information from the array.

I was hoping to display a simple infowindow like the ESRI Map infowindow example (http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm). I've tried to use this example, the popup example, and the attributes/infotemplate option for a graphic but I cant seem to get any of them to work. Might have to do with the fact that the examples reference a featurelayer with URL, or the map.

Below is some of our code, can anyone please provide a recommendation on how to go about displaying an info window for this code and the graphic.

var points = [["long", "lat"], ["long", "lat"]]; //array example

function init(){
//add base map
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("Basemap URL");
map.addlayer(basemap);

dojo.connect(map, 'onload', function (theMap){
ShowLocation(); 
});

dojo.connect(dijit.byId('map'), 'resize', map, map.resize);
});
}

function ShowLocation(){
var mp = new esri.geometry.Multipoint(new esri.SpatialReference({ wkid: 4326}));
mp.points = points;
var symbol = new esri.symbol.SimpleMarkerSymbol(symbol style detail);

map.graphics.add(new esri.Graphic(mp, symbol));
map.setExtent(mp.getExtent().expand(2));
}
dojo.addOnLoad(init);



}

Outcomes