cbExecuteGenerateRendererTask: function(renderer){ var optionsArray = []; var drawingOptions = new esri.layers.LayerDrawingOptions(); drawingOptions.renderer = renderer; optionsArray[this.layerId] = drawingOptions; this.layer.setLayerDrawingOptions(optionsArray); this.layer.setVisibleLayers([this.layerId]); // -------- // this.layer is instantiated elsewhere as: new esri.layers.ArcGISDynamicMapServiceLayer("serviceUrl"); // That mapping service contains 7 layers of data; only one is visible at any one time and a single // attribute from that visible layer is used to generate the renderer for it. //--------- if (this.dynamicLayerInfos === null){ this.dynamicLayerInfos = this.layer.createDynamicLayerInfosFromLayerInfos(); } var dynamicLayerInfos = []; var dynamicLayerInfo = new esri.layers.DynamicLayerInfo(); dynamicLayerInfo.id = this.layerId; dynamicLayerInfo.source = this.dynamicLayerInfos[this.layerId]; dynamicLayerInfos.push(dynamicLayerInfo); this.layer.setDynamicLayerInfos(dynamicLayerInfos); }
{"error":{"code":400,"message":"Missing mapLayerId for dynamic mapLayer with 'id': 1.","details":[]}}
http://<mydomain>/arcgis/rest/services/<myservice>/MapServer/export?dpi=96&transparent=true&format=png8&layers=show:-1&dynamicLayers=[{ "id": 1, "source": { "defaultVisibility": false, "id": 1, "maxScale": 0, "minScale": 0, "name": "Crops (vegetables, fruits, berries, nuts, nursery, sod, Christmas trees, greenhouse, mushrooms, and maple)", "parentLayerId": -1, "subLayerIds": null, "source": { "type": "mapLayer", "mapLayerId": 1 } }, "drawingInfo": { "renderer": { "type": "classBreaks", "field": "FRUIT_FARM_NUM", "minValue": 0, "classBreakInfos": [{ "classMaxValue": 14, "label": "0 - 14", "description": "", "symbol": { "color": [204, 255, 204, 255], "type": "esriSFS", "style": "esriSFSSolid" } }, { "classMaxValue": 59, "label": "15 - 59", "description": "", "symbol": { "color": [130, 217, 142, 255], "type": "esriSFS", "style": "esriSFSSolid" } }, { "classMaxValue": 165, "label": "60 - 165", "description": "", "symbol": { "color": [72, 179, 100, 255], "type": "esriSFS", "style": "esriSFSSolid" } }, { "classMaxValue": 298, "label": "166 - 298", "description": "", "symbol": { "color": [28, 142, 73, 255], "type": "esriSFS", "style": "esriSFSSolid" } }, { "classMaxValue": 498, "label": "299 - 498", "description": "", "symbol": { "color": [0, 104, 55, 255], "type": "esriSFS", "style": "esriSFSSolid" } }] } } }]&bbox=-14896912.62163498,3215744.8139635143,-5700009.378365019,10123206.186036486&bboxSR=102100&imageSR=102100&size=940,706&f=json
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.