insanebunny

InfoTemplate inside InfoWindow with multiple service layers

Discussion created by insanebunny on May 30, 2014
I have implemented the InfoWindow with TabContainer to work with my InfoTemplate which, when my layer is identified works beautifully with the custom attributes that I have set up.  However, when trying to implement a second InfoTemplate, the result is blank.

I know that I am missing a function somewhere which will allow the reading of multiple service layers but I'm not sure which to implement and how to implement it


 var infoWindow = new InfoWindow(null, domConstruct.create("div"));
 infoWindow.startup();

      map = new Map("map", {
        center: [-119.152, 50.40],
        zoom: 8,
        basemap: "topo",
  infoWindow: infoWindow
  
      });
   map.infoWindow.resize(300,300);

 
      var home = new HomeButton({
        map: map
      }, "HomeButton");
      home.startup();

   var scalebar = new Scalebar({
          map: map,
          // "dual" displays both miles and kilmometers
          // "english" is the default, which displays miles
          // use "metric" for kilometers
          scalebarUnit: "metric"
    });

      var toggle = new BaseMapToggle({
        map: map,
        basemap: "hybrid",
  bingMapsKey: "As1ihAUhwYD1Q583Ka6RLQZjMHV85t9Zve6xQJePqmmPTStjNlR5FJmGWEj5xdLJ"
      }, "BaseMapToggle");
      toggle.startup();

 map.on("zoom-end", showScale);
 map.on("load", showScale);

 function numberWithCommas(x) {
  return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
 }
 function showScale(evt){
 var ms = map.getScale()
 dojo.byId("scaleText").innerHTML = "<center><b>Scale</b><br>1:" + numberWithCommas(ms.toFixed(0));
 }
 

//#########################################################################################################################################
//Create info template to hold the content inside
var vliTemplate = new InfoTemplate();
vliTemplate.setTitle("VLI");
vliTemplate.setContent(getWindowContent);

function getWindowContent(graphic) {
//make a tab container
var tc1 = new TabContainer({
style:"width:100%;height:100%;",
useMenu: false,
useSlider:false,
}, dojo.create("div"));

ar cp1vli = new ContentPane({
//add content to identity popup based on attributes of layer service
title: "Current",
content: "<b>VLI Number:</b><td>"+graphic.attributes.VLI_VLI_NO+"</tr></td>"
});

var cp2vli = new ContentPane({
title: "Approved",
content: "<b>VLI Number:</b><td>"+graphic.attributes.VLI_NO+"</tr></td>"
});
tc1.addChild(cp1vli);
tc1.addChild(cp2vli);
return tc1.domNode;
}

//Second InfoTemplate would be placed under here, assumably set up the same way but changing the variables so that they are not exactly the same as the previous one


I have looked at a ton of templates but so far I can't figure out which one is the right one or how to implement them into my code.

Thanks

Outcomes