Hi Jimmy, It looks like your calculation of tileY variable is always a multiple of 1000, that way tileY % 1000 always returns 0 I don;t have the data to dive into this more deeply
Cheers KRis Met vriendelijke groet, Kind regards, Kristiaan Geusebroek Consultant [cid:image005.jpg@01CAD62A.CDCB6570] [cid:image006.png@01CAD62A.CDCB6570] Email: kgeusebr...@xebia.com<mailto:kgeusebr...@xebia.com> 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<http://www.xebia.com/> Xebia Blog: http://blog.xebia.com/ Xebia Podcast: http://podcast.xebia.com/ On Apr 22, 2010, at 12:19 PM, Jimmy Aumard wrote: 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 <kgeusebr...@xebia.com<mailto:kgeusebr...@xebia.com>> 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 <image005.jpg> <image006.png> Email: kgeusebr...@xebia.com<mailto:kgeusebr...@xebia.com> 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<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<http://www.kinaxia.fr/> _______________________________________________ Users mailing list Users@openlayers.org<mailto:Users@openlayers.org> 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<http://www.kinaxia.fr/>
<<inline: image005.jpg>>
<<inline: image006.png>>
_______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users