[OpenLayers-Users] KaMap pink tiles

Chris Holmes cholmes at openplans.org
Wed Dec 13 14:46:36 EST 2006


Ah, very nice, I could definitely make use of this, and would be psyched 
if something like this got in to the core.

Just tried it out and it appears to be working great.

I'm working off of trunk, and the line number is a bit off, but I think 
I found the right method.

I can make a patch if it would be accepted, though my javascript skills 
are pretty poor, so someone may still want to clean it up.  But I can 
clean up the formatting at least according to: 
http://trac.openlayers.org/wiki/CodingStandards

Chris

Stuart Eve wrote:
> Hi all
> 
> I was having some problems with my KaMap layer producing pink tiles on 
> occasion - after advice from Christopher and TSchaub on the irc - I came 
> up with a bit of a hack that seemed to fix the problem. I haven;t really 
> done anything with JS before so its probably pretty ugly and perhaps 
> someone may want to clean it up. It basically sets the src of the image 
> again - if it really is a broken image after two goes it gives up and 
> makes it pink (although I haven't had that happen). It starts from Line 
> 244 of Util.js
> 
> OpenLayers.Util.onImageLoadError = function() {
> 
> this.setAttribute('tries',1);
> 
> do{
> 
> this.setAttribute('src',this.getAttribute('src'));
> 
> this.setAttribute('tries',this.getAttribute('tries') + 1);
> 
> }while(this.getAttribute('tries') < 2);
> 
> if (this.getAttribute('tries') >= 2){
> 
>     this.style.backgroundColor = OpenLayers.Util.onImageLoadErrorColor;
>     this.style.display = "";
> 
> }
> 
> };
> 
> Hope it helps someone
> 
> Stuart
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> !DSPAM:1003,45805410232252051017194!
> 

-- 
Chris Holmes
The Open Planning Project
http://topp.openplans.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cholmes.vcf
Type: text/x-vcard
Size: 269 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20061213/47970633/cholmes.vcf


More information about the Users mailing list