Problem creating WMS Layer Type in Asynchronous Module Definition(AMD)

679
0
06-20-2014 03:49 AM
PauPérez_Puigcerver
New Contributor II
Hello,

I'm adapting programming to the new website Asynchronous Module Definition (AMD) format, but when I try to define a particular WMS layer type, I have problems. Has anyone done this conversion?

The code is as follows:

dojo.declare("my.CatastroWMSLayer", DynamicMapServiceLayer, {
     constructor: function() {
      this.initialExtent = this.fullExtent = new Extent({xmin:xExtMin,ymin:yExtMin,xmax:xExtMax,ymax:yExtMax,spatialReference:{wkid:sistRefVisor}});
      this.spatialReference = new SpatialReference({wkid:sistRefVisor});        
      this.loaded = true;
      this.onLoad(this);
     },
                                    
     getImageUrl: function(extent, width, height, callback) {
      var params = {
                             request:"GetMap",
        version:"1.1.1",
        service:"WMS",
        srs: "EPSG:" + extent.spatialReference.wkid,
        bbox:extent.xmin + "," + extent.ymin + "," + extent.xmax + "," + extent.ymax,
        width: width,
                             height: height,
        layers:"Catastro",
                             styles: "",
        format:"image/png",
        transparent:true,
                             bgcolor:"ffffff",
        time:timeCatastro,
                             exceptions: "application/vnd.ogc.se_xml"
                             //changing values
                             };
        
      callback("http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?" + dojo.objectToQuery(params));
     }
    });


Thanks!

Pau Pérez
http://cartoweb.cma.gva.es
0 Kudos
0 Replies