paupepui

WMTS tiles images in wrong order

Discussion created by paupepui on Aug 2, 2011
Latest reply on Sep 27, 2011 by bob_carr
I'm loading a WMTS layer in my html viewer (API for JavaScript 2.4), but the tiles in the layer are displayed in wrong order (see attached image).

I'm using this code to load the WMTS layer:

dojo.declare("ogc.WMTSLayer", esri.layers.TiledMapServiceLayer, { // create WMTSLayer by extending esri.layers.TiledMapServiceLayer
constructor: function() {
this.spatialReference = new esri.SpatialReference({wkid: 25830});
this.initialExtent = new esri.geometry.Extent(600000, 4150000, 850000, 4550000, this.spatialReference);
this.fullExtent = new esri.geometry.Extent(600000, 4150000, 850000, 4550000, this.spatialReference);
//
this.tileInfo = new esri.layers.TileInfo({
"dpi": "90.71428571427429",
"format": "image/png",
"compressionQuality": 0,
"spatialReference": {"wkid": "25830"},
"rows": 256,
"cols": 256,
"origin": {
"x": 600000,
"y": 4550000
},
"lods": [{
"level": "00",
"scale": 1600000,
"resolution": 448
}, {
"level": "01",
"scale": 1000000,
"resolution": 280
}, {
"level": "02",
"scale": 800000,
"resolution": 224
}, {
"level": "03",
"scale": 600000,
"resolution": 168
}, {
"level": "04",
"scale": 500000,
"resolution": 140
}, {
"level": "05",
"scale": 400000,
"resolution": 112
}, {
"level": "06",
"scale": 300000,
"resolution": 84
}, {
"level": "07",
"scale": 250000,
"resolution": 70
}, {
"level": "08",
"scale": 10000,
"resolution": 2.8
}]
});
this.loaded = true;
this.onLoad(this);
},

getTileUrl: function(level, row, col) {
return "http://cartoplora:8081/service" + "?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile" + "&LAYER=orto_icv" + "&STYLE=_null" + "&FORMAT=image/png" + "&TILEMATRIXSET=grid_orto" + "&TILEMATRIX=" + level + "&TILEROW=" + row + "&TILECOL=" + col;
}
});


How can I do to load the tile rows in the correct order?

Thanks in advance.

Pau Pérez
PRODEVELOP S.L.
Conselleria de infraestructuras, Territorio y Medio Ambiente.
http://cartoweb.cma.gva.es

Attachments

Outcomes