annika.hermodssonesri-se-esridist

Need to connect to a URL in my Info window

Discussion created by annika.hermodssonesri-se-esridist Employee on Feb 15, 2011
I have tried several ways to connect to a URL in the info window. In the feature layer I have an attribute field with the URL for each of the features in that layer. The url's ar individual for each feature. I have tried to work out the example code of the "Format InfoWindow Contents", http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm, with no luck. Is there anyone who can help me with this?


  function initOperationalLayer(map) {
        var content = "<b>Kommun</b>: ${KOMMUN}" +
                      "<br /><b>Hemsida</b>: ${URL}";

        var infoTemplate = new esri.InfoTemplate("Kommun_Centrum", content);

        var featureLayer = new esri.layers.FeatureLayer("http://localhost/ArcGIS/rest/services/Bredband/KommunCenter/MapServer/0",{
          mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
          outFields: ["*"],
          infoTemplate: infoTemplate
        });
        map.addLayer(featureLayer);
        map.infoWindow.resize(200,105);
        mapLayers.push(featureLayer);        
      }

Outcomes