Export Image at specific scale

517
1
03-06-2013 04:57 AM
Kamil_YasinDERER
New Contributor
Hi,
I want to export image at specific scale but  I can't find set the scale.
I'm looking for a method like this. esri.geometry.getExtentForScale(map, 1000)

My code:
     
            var params = new esri.layers.ImageParameters();
            params.format = 'png8';
            params.bbox = tempExtent;//esri.geometry.getExtentForScale(tempExtent, 1000);
            params.height = '407';
            params.width = '655';
            params.dpi = 200;
            params.layerIds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
            params.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW; //LAYER_OPTION_SHOW
            params.transparent = true;
            
            mapLayer.exportMapImage(params, function (img) {                
                document.getElementById('imgPath').innerHTML = img.href;
            });
        }



Thanks
Yasin
0 Kudos
1 Reply
JohnGravois
Frequent Contributor
since the REST exportMap operation supports setting a scale, you might be able to use esri.setRequestPreCallback() to set it as an additional parameter before the request is actually sent.
0 Kudos