jfbomber

ArcGISDynamicMapServiceLayer Not Showing Until Pan

Discussion created by jfbomber on Oct 22, 2011
Latest reply on Oct 22, 2011 by jfbomber
I am having a problem with the datamap not showing until I pan. It wont appear if I zoom but only on pan. Does anyone have any ideas on what is causing this?

    mapData = eval("(" + document.getElementById("MapData").value + ")");
    map = new esri.Map("map");
    mapExtent = new esri.geometry.Extent({
        "xmin": mapData.xmin,
        "ymin": mapData.ymin,
        "xmax": mapData.xmax,
        "ymax": mapData.ymax,
        "spatialReference": { "wkid": mapData.wkid }
    });
        map.setExtent(mapExtent);
        baseUrl = mapData.GISMaps.Imagery;
        baseLayer = new esri.layers.ArcGISTiledMapServiceLayer(baseUrl);
        baseLayer.id = "BaseLayer";
        map.addLayer(baseLayer);

        dataUrl = mapData.DataMap;
        dataLayer = new esri.layers.ArcGISDynamicMapServiceLayer(dataUrl, {"opacity":0.75});
        dataLayer.id = "DataLayer";

        dojo.connect(dataLayer, "onVisibilityChange", function (visibility) {
            alert(visibility);
        });
        map.addLayer(dataLayer);

        dataLayer.show();
        dojo.connect(dataLayer, "onLoad", function () {
            // Do Something
        });

Outcomes