ArcGISDynamicMapServiceLayer onload

746
0
04-15-2013 12:22 AM
CristinaJacome
New Contributor
Hello

I'm using ArcGISDynamicMapServiceLayer to load images from a WMS.
I want to optimize the number of server calls. The problem is that whenever I move the map is loading ArcGISDynamicMapServiceLayer layer.

Is it possible to change this so that only loads when the zoom changes?



  dojo.declare("wmsLayer", esri.layers.ArcGISDynamicMapServiceLayer, {
                    constructor: function (url, capas) {

                        this.loaded = true;
                        capasWMS = capas;
                        urlWMS = url;
                    },

                    getImageUrl: function (extent, width, height, callback) {
                       

                        var params = {
                            request: "GetMap",
                            transparent: "Yes",
                            format: "PNG",
                            version: "1.1.1",
                            layers: capasWMS,
                            //changing values
                            bbox: extent.xmin + "," + extent.ymin + "," + extent.xmax + "," + extent.ymax,
                            srs: "EPSG:" + extent.spatialReference.wkid,
                            width: width,
                            height: height
                        };

                        callback(urlWMS + dojo.objectToQuery(params));

                    }
                })
0 Kudos
0 Replies