AnsweredAssumed Answered

Initial Esri map layer not loading till zoom

Question asked by meyvn77 on Sep 26, 2012
Latest reply on Dec 9, 2014 by pjege
I have a application that loads 6 layers the first being

    //ADD Layers to MAP
    var basemap =
    new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");

My issue is that the basemap layer does not show until I zoom in or out? I have tried to change the order of the layers but when I do it does not load any of my layers?

Any Ideas? Below is the complete code for the loading...
Thanks,
Charles...


//ADD Layers to MAP
    var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");


    //ServiceAreas
    var featureLayerServiceAreas = new esri.layers.FeatureLayer("http://services.arcgis.com/s94UJcOoEa23NHUs/arcgis/rest/services/Sales_Support_Map/FeatureServer/7", {
        mode: esri.layers.FeatureLayer.MODE_SNAPSHOT
    });

    //Yards
    var featureLayerYard = new esri.layers.FeatureLayer("http://services.arcgis.com/s94UJcOoEa23NHUs/arcgis/rest/services/Sales_Support_Map/FeatureServer/0", {
        mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
        id:"featureLayerYard"
    });

    //SWD
    var featureLayerSWD = new esri.layers.FeatureLayer("http://services.arcgis.com/s94UJcOoEa23NHUs/arcgis/rest/services/Sales_Support_Map/FeatureServer/1", {
        mode: esri.layers.FeatureLayer.MODE_SNAPSHOT
    });

    //LeaseRoads
    var featureLayerLeaseRoads = new esri.layers.FeatureLayer("http://services.arcgis.com/s94UJcOoEa23NHUs/arcgis/rest/services/Sales_Support_Map/FeatureServer/5", {
        mode: esri.layers.FeatureLayer.MODE_ONDEMAND
    });

    //Horizontal_Rigs
    var featureLayerHorizontal = new esri.layers.FeatureLayer("http://services.arcgis.com/s94UJcOoEa23NHUs/arcgis/rest/services/Sales_Support_Map/FeatureServer/2", {
        mode: esri.layers.FeatureLayer.MODE_ONDEMAND
    });

    //Vertical_Rigs
    var featureLayerVertical = new esri.layers.FeatureLayer("http://services.arcgis.com/s94UJcOoEa23NHUs/arcgis/rest/services/Sales_Support_Map/FeatureServer/3", {
        mode: esri.layers.FeatureLayer.MODE_ONDEMAND
    });

    //Rigs
    var featureLayerRIGS = new esri.layers.FeatureLayer("http://services.arcgis.com/s94UJcOoEa23NHUs/arcgis/rest/services/Sales_Support_Map/FeatureServer/4", {
        mode: esri.layers.FeatureLayer.MODE_ONDEMAND, outFields: ["SES_ORIENTATION", "SES_IMG", "SES_NAME", "API", "RigNumber", "SpudDate", "OBJECTID", "OperatorAddress",
                                                                  "OperatorZipCode", "OperatorContact", "OperatorPhoneNumber", "WellNumber", "WellClass", "SurfaceLat", "SurfaceLong"],
        infoTemplate: infoTemplate
    });


    //Legend LayerCode
    //var layerInfo = buildLayersList(layers);
    dojo.connect(map, 'onLayersAddResult', function (results) {
        var layerInfo = dojo.map(results, function (layer, index) {
            return { layer: layer.layer, title: layer.layer.name };
        });
        //alert(layerInfo.length);
        if (layerInfo.length > 0) {
            var legendDijit = new esri.dijit.Legend({
                map: map,
                layerInfos: layerInfo
            }, "legendDiv");
            legendDijit.startup();
        }
        else {
            dojo.byId('legendDiv').innerHTML = "";
        }
    });

    map.addLayers([basemap, featureLayerServiceAreas, featureLayerSWD, featureLayerYard, featureLayerLeaseRoads, featureLayerVertical, featureLayerHorizontal, featureLayerRIGS]);
    map.infoWindow.resize(300, 150);

Outcomes