Select to view content in your preferred language

OverView Map Widget Help!

1465
3
07-01-2011 02:11 AM
AlexanderAnkrah
Deactivated User
Right I thought I had this cracked but apparently not!

I sometimes get one of these two errors or both

1. 'esri.bundle.widgets' is null or not an object
2. 'wkid' is null or not an object


Below is my current implementation of the OverView widget. Anything I'm doing wrong?

dojo.connect(this.GISmap, 'onLayerAdd', jQuery.proxy(function() {
            this.afterLoad();
        }, this));



afterLoad: function() {

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

}


I have tried other approaches including the two below but the above errors keep coming up. Any pointers please?

afterLoad: function() {

if (this.GISmap.loaded) {
var overviewMapDijit = new esri.dijit.OverviewMap({
map: this.GISmap,
baseLayer: layer,
visible: false,
attachTo: "top-right",
expandFactor: 2.5
});
overviewMapDijit.startup();
}
else{
//nothing. 
}
}


This other approach just gives errors usual errors (but works in a simple map app!!)

if (this.GISmap.loaded) {
                   var createOverviewMap = function() {
                   overviewMapDijit = new esri.dijit.OverviewMap({
                       map: this.GISmap,
                       baseLayer: layer,
                       visible: false,
                       attachTo: "top-right",
                       color: "#D84E13",
                       width: 300,
                       height: 250,
                       expandFactor: 2
                       });
                       overviewMapDijit.startup();
                       dojo.style(dojo.byId("status"), "display", "none");
                   };

                   if (layer.loaded) {
                       createOverviewMap();
                   }
                   else {
                       dojo.connect(layer, "onLoad", createOverviewMap);
                   }
               }


Also See
http://forums.arcgis.com/threads/31709-Effectively-adding-baseLayer-to-OverView-Map?highlight=overvi...
0 Kudos
3 Replies
AlexanderAnkrah
Deactivated User
Right. Problem solved. For anyone else having issues using the overview map my solution is below.

My problems were

1. 'esri.bundle.widgets' is null or not an object
2. 'wkid' is null or not an object
3. The overview map "arrow" disappears when the browser is refreshed

All three errors were intermittent.

My Work around.

I downloaded a local copy of the original overView map Dijit from http://arcscripts.esri.com/details.asp?dbid=16114

and added the dijits folder to my app. Setting the modulePaths  etc.

Then as per normal, in my JS (this is an extract)

dojo.connect(this.GISmap, 'onLayerAdd', jQuery.proxy(function() {
            this.afterLoad();           
        }, this));


afterLoad: function() {
        var map = this.GISmap;
        var createOverviewMap = function() {
            var overviewMapDijit = new dijits.overview.OverviewMap({
                map: map,
                baseLayer: layerOvw,
                width: 200,
                height: 150,
                attachTo: "top-right",
                expandFactor: 2.5,
                color: "#000000"
            });
            overviewMapDijit.startup();

        };
        if (layerOvw.loaded) {
            createOverviewMap();
        }
        else {
            dojo.connect(layerOvw, "onLoad", createOverviewMap);
        }
    },


NOTE: layerOvw is a dynamic service defined in an external JS file. Defining it in the "afterLoad" caused the overView window to fall over.

Also unlike the core API implementation, the parameters for the overView Dijit must all be specified as above.

Hope this helps somebody.

Cheers
0 Kudos
DavidWilton
Frequent Contributor
Thanks I had the same issue and your work around helped. There is clearly something wrong in the new esri widget that has been included. I found that in IE7 to version 9 (only IE) when the page was refreshed I got an error. Error: 'esri.bundle.widgets' is null or not an object ]. This error did not occur on initial load
0 Kudos
AdrianMarsden
Honored Contributor
Anyone know if any progress has been made on this - I too am having issues with defining what layer out of several layers for the overview map to use.

Cheers

ACM
0 Kudos