Effectively adding baseLayer to  OverView Map

Discussion created by AlexAnkrah on Jun 1, 2011
Latest reply on Jul 6, 2011 by AlexAnkrah
Hi Folks,
I have successfully implemented the overview widget, all works great. The only snag is my main map (used in map:map) is a tiled service starting at a particular scale to the lowest zoom level.

And I have a dynamic map which shows on the start of the app and hides at the scale where the tiled map kicks in.

Now by default the overview widget uses the first map "layer" (in my case the tiled map) if no baseLayer parameters are provide - that works fine. Now I want to define a baseLayer such that there're quite literally two maps (the tiles and the  dynamic) for the overview widget.

From the documentations that I have seen, you could do this by simply going

var layer = new esri.layers.ArcGISTiledMapServiceLayer("")

then setting baseLayer:layer

This sometimes works, sometime I get the following error
'wkid' is null or not an object

This I think have something to do with the layer definition for the baseLayer. Can anyone shed more light on this?

Thanks. below is a section of what I have.

dojo.connect(this.GISmap, 'onLayerAdd', jQuery.proxy(function() {        
            dojo.connect(dijit.byId("Map_Div"), 'resize', jQuery.proxy(this.resizeMap, this));
        }, this));

afterLoad: function() {

var overviewMapDijit = new esri.dijit.OverviewMap({
    map: this.GISmap,
    baseLayer: layer,
        visible: false,
        attachTo: "top-right",
        expandFactor: 2.5