milana.ninkovic-gdi-net-esridist

MapOverview widget problem - javascript api 3.2

Discussion created by milana.ninkovic-gdi-net-esridist on Oct 31, 2012
Latest reply on Nov 2, 2012 by milana.ninkovic-gdi-net-esridist
Hello,

I have problem with mapOverview widget in javascript api 3.2. I have 2 map services in application (arcgis online and one local service - wkid 102100). After adding default mapOverview widget to application it sometimes works, sometimes don't causing the error TypeError: _9 is null in OverviewMap.js .
Changing baseLayer property of mapOverview widget to the local map service (it has to be local) causes mapOverview widget never works, reporting the same error.

My code looks like follows:


var onlnService = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
        {
     opacity: 1
 });

var local = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/lovistaWGS/MapServer",
     {
      opacity: 0.6
     });
var overviewLayer= new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/lovistaWGS/MapServer";

map.addLayers([arcgisonline, local]);

var overviewMapDijit = new esri.dijit.OverviewMap({
        map: map,
        visible: true,
        attachTo: "bottom-left",
        opacity: 0.5,
        color: "#000000",
        expandfactor: 4,
        maximizeButton: false,
        baseLayer: overviewLayer,
        visible: true
        });
    //}, dojo.byId("overviewDiv"));
    overviewMapDijit.startup();


What am I doing wrong?

Outcomes