Hi,
I created a map with some points on it with the ESRI JavaScript API.
I would now like to attach a InfoWindow (or pop-up, ...) to the point so that when you click on a point, the info window shows with information in it .
I am new to this and haven't found what i wanted so i'm asking here, please tell me if this is inappropriate.
Thanks in advance,
Thomas
Solved! Go to Solution.
Are those points graphics? If so check out my example here: Button Popup 1 - JSFiddle
Tim
Hi Thomas,
Assuming that you have used FeatureLayer in your map , i am suggesting the following code :
var map; require(["esri/map", "esri/layers/FeatureLayer", "esri/InfoTemplate", "dojo/domReady!"], function(Map,FeatureLayer,InfoTemplate) { map = new Map("map", { basemap: "topo", //For full list of pre-defined basemaps, navigate to http://arcg.is/1JVo6Wd center: [0, 0] // longitude, latitude }); var infoTemplate = new InfoTemplate("${NAME}", "${*}"); // Info template definition var featureLayer = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3", { infoTemplate: infoTemplate // assigning the Info template to the feature layer }); map.addLayer(featureLayer); });
In my case i have implemented the map in an other app where I query a table with GlideRecord to create those points, so i it would mean i have to do a Dynamic Layer ? Thanks a lot for your help
Are those points graphics? If so check out my example here: Button Popup 1 - JSFiddle
Tim
Thomas,
Here is a link that will help you with info windows/popups Samples | popups_and_info_windows,
and InfoWindow | API Reference
Tim Witt's example is very nice too!
Hi Rickey,
Indeed I have went through the API References but didn't figure out i had to put the info window and point together in a graphic, Thanks a lot too
Thomas
I think this is the best solution for me,
Thanks a lot !
Thomas