AnsweredAssumed Answered

Adding multiple image layers

Question asked by momozza on Jun 4, 2013
Latest reply on Jun 5, 2013 by momozza
Hi all,

I have been attempting to display multiple image layers using MapImageLayer but have not been able to. I've managed to display two images in the same MapImage Layer but I want to create more than one layer so that I can manipulate them at that level individually. Does anyone know of a way of doing this?

  // create and add first layer       var mil = new esri.layers.MapImageLayer(       {   'id': 'usgs_screen_overlay'       });       map.addLayer(mil);          // adding image to the layer       var mi = new esri.layers.MapImage(        {   'extent':    { 'xmin': -125.1823, 'ymin': 53.4984, 'xmax': -121.5028, 'ymax': 55.5116, 'spatialReference':        { 'wkid': 4326 }   },   'href': 'TILERGB.jpg'        });         mil.addImage(mi);    // create and add another layer       var red = new esri.layers.MapImageLayer(       {   'id': 'usgs_screen_overlay'       });       map.addLayer(red);          //add an image to the second layer  var ra = new esri.layers.MapImage(       {   'extent':    { 'xmin': -124.2958, 'ymin': 54.1976, 'xmax': -123.0989, 'ymax': 54.7005,'spatialReference':     { 'wkid': 4326 }   },   'href': 'rdattack.png'  });

Outcomes