Thanks Kris, I test to override the getURL method but I have problem I have one directory with all my tiles like LayerName_Zoom_0000.jpg LayerName_Zoom_0001.jpg .....
And I have override getURL like this :
getURL: function(bounds) {
var res = this.map.getResolution();
var bbox = this.maxExtent;
var size = this.tileSize;
var tileX = Math.round((bounds.left - bbox.left) / (res * size.w));
var tileY = Math.round((bounds.bottom - bbox.bottom) / (res *
size.h));
var tileZ = this.serverResolutions != null ?
OpenLayers.Util.indexOf(this.serverResolutions, res) : this.map.getZoom();
/**
* Zero-pad a positive integer.
* number - {Int}
* length - {Int}
*
* Returns:
* {String} A zero-padded string
*/
function zeroPad(number, length) {
number = String(number);
var zeros = [];
for(var i=0; i<length; ++i) {
zeros.push('0');
}
return zeros.join('').substring(0, length - number.length) +
number;
}
var components = [
this.layername
];
var path = components.join('/');
var url = this.url;
if (url instanceof Array) {
url = this.selectUrl(path, url);
}
url = (url.charAt(url.length - 1) == '/') ? url : url + '/';
return url +
path+"/"+this.layername+"_"+res+"_"+zeroPad((parseInt(tileY) % 1000), 4) +
'.' + this.extension;
}
But OpenLayers get just the first tiles (0000.jpg) by zoom.
Do you have an idea why openlayers take just one tiles?
Cheers.
Jim
2010/4/21 Kris Geusebroek <[email protected]>
> Hi Jimmy,
>
> You can use a server to do that, but it is also possible if the tiles are
> served from a webserver.
> The directory structure or naming of the tiles has to be somewhat
> structured though.
>
> You can use the OpenLayers.Layer.TileCache class of openLayers if you
> confirm to that directory/naming convention or you can subclass that on and
> overide the getURL method to create an url that makes sense with your tiles.
>
> Hope this helps you a bit.
>
> Cheers Kris
> Met vriendelijke groet, Kind regards,
> * *
> *Kristiaan Geusebroek*
> Consultant**
> * *
>
>
> *
> *
> Email: [email protected]**
> Tel: +31 (0)35 538 1921
> Fax: +31 (0)35 538 1922
> Mobiel: +31 (0)6 3069 7223**
> * *
> Utrechtseweg 49
> 1213 TL Hilversum
> The Netherlands
> http://www.xebia.com
>
> Xebia Blog: http://blog.xebia.com/
> Xebia Podcast: http://podcast.xebia.com/
>
>
> On Apr 21, 2010, at 9:16 AM, Jimmy Aumard wrote:
>
> Hello,
>
> I have big image (.jpg) too heavy to load by OpenLayers.
> I tiled it and tiles are accessible.
> I would like to know if OpenLayers manage tiled images.
>
> I don't know if I'm clear.
>
> Thanks
>
> --
> Aumard Jimmy
> Développeur
>
> KINAXIA
> c/o CICA / PacaEst
> 2229 Route des Crêtes
> F-06560 Sophia Antipolis
>
> Tél.: +33 (0)4 8973 0242
> Mob.: +33 (0)6 6017 2827
> Fax : +33 (0)4 8307 6583
>
> http://www.kinaxia.fr
> _______________________________________________
> Users mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/users
>
>
>
--
Aumard Jimmy
Développeur
KINAXIA
c/o CICA / PacaEst
2229 Route des Crêtes
F-06560 Sophia Antipolis
Tél.: +33 (0)4 8973 0242
Mob.: +33 (0)6 6017 2827
Fax : +33 (0)4 8307 6583
http://www.kinaxia.fr
<<image006.png>>
<<image005.jpg>>
_______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
