Streaker

MODE_SNAPSHOT not working

Discussion created by Streaker on Jan 7, 2011
ONDEMAND works, but is not ideal.

2 things I can think of:
1. This is that this is a really large dataset (almost 500k records) which is why I am using the setDefinitionExpression to filter by Crop. Is this the right way to filter the data?
2. My SDE is still on 9.3.1 and the web server is on 10. but I'm using direct connect so I'm not sure that should make a difference.

        var timeLayers = [];
         
        var symbol = new esri.symbol.SimpleFillSymbol();
        symbol.setColor(new dojo.Color([150, 150, 150, 0.5]));

        //Add five breaks to the renderer.
        var renderer = new esri.renderer.ClassBreaksRenderer(symbol, "Acres");
        renderer.addBreak(0, 25, new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([56, 168, 0, 0.5])));
        renderer.addBreak(25, 75, new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([139, 209, 0, 0.5])));
        renderer.addBreak(75, 175, new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([255, 255, 0, 0.5])));
        renderer.addBreak(175, 400, new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([255, 128, 0, 0.5])));
        renderer.addBreak(400, 640, new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([255, 0, 0, 0.5])));

        //arroyoFieldGas = null;
        var infoTemplate = new esri.InfoTemplate("${Crop}", "${*}");
        var arroyoFieldGas = new esri.layers.FeatureLayer("http://yosemite/ArcGIS/rest/services/Test/FeatureServer/0", {
        mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
            outFields: ["*"],
            infoTemplate: infoTemplate
        });   
  
        selectedCrop = 'CILANTRO'
        var ddList = document.getElementById('<%=DropDownList1.ClientID %>');
        //var selectedCrop = ddList.options[ddList.selectedIndex].value;

        arroyoFieldGas.setDefinitionExpression("Crop = '" + selectedCrop + "'");
  arroyoFieldGas.setRenderer(renderer);  
        timeLayers.push(arroyoFieldGas);
  

        //add all the layers to the map then initialize the slider
        map.addLayers(timeLayers);  

Outcomes