I know that I can do this:
var foo = new esri.Map("foo"); var bar = foo; foo.id; //"foo" bar.id; //"foo" foo.id = "oof"; bar.id; //"oof"
what I want is to make a copy of foo so that
bar.id = "bar"; foo.id; //"foo" bar.id; //"bar"
Any ideas? So far the best I've come up with to to construct two different maps, and then copy foo's graphics, features, etc over to bar:
var foo = new esri.Map("foo"); //do some stuff to foo, adding layers etc var bar = new esri.Map("bar"); bar.addLayers(foo.getLayersVisibleAtScale()); //etc