Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to display 2 fields from the POIData layer. What i get now is ${ToegangsNr} ${Baanvak} in text. Does anyone know how to do this in an DynamicMapServiceLayer. Thanks in advance

POIData = new esri.layers.ArcGISDynamicMapServiceLayer("", { id: "POI", "visible":false });

                dojo.connect(map, "onClick", function(evt) {
                                map.infoWindow.resize(175, 125);
                                    var symbol = new esri.symbol.SimpleMarkerSymbol().setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_X).setSize(12);

                                    dojo.connect(map, "onClick", function(evt) {
                                            var graphic = new esri.Graphic(evt.mapPoint, symbol);

                                            map.infoWindow.setContent("<tr>Baanvak: <td>${Baanvak}</tr></td>");

                                  , map.getInfoWindowAnchor(evt.screenPoint));

                                    dojo.connect(map.infoWindow, "onHide", function() {
share|improve this question

To show the substituted data, you'll need to set the graphic's InfoTemplate, instead of setting the InfoWindow directly. Here's an example using your code.

var POITemplate = new esri.InfoTemplate();
POITemplate.setContent("<tr>Baanvak: <td>${Baanvak}</tr></td>");

// a little further down in your code.

dojo.connect(map, "onClick", function(evt) {;
    var graphic = new esri.Graphic(evt.mapPoint, symbol);

    graphic.setInfoTemplate(POITemplate);;, map.getInfoWindowAnchor(evt.screenPoint));
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.