crisjacome

ArcGISDynamicMapServiceLayer onload

Discussion created by crisjacome on Apr 15, 2013
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));

                    }
                })

Outcomes