Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to use a different image for missing tiles with an OpenLayers application. Currently the tile is red/pink, with a red x in the upper left corner. I would like to remove that corner, does anybody know how to specify this image?

share|improve this question
    
Is there any solution to get the image from an other server in steed of getting static image "images/blank.png" ? other whise get the tile from an other server when the desired tile doesn't exist in the first one ? –  user18488 May 24 '13 at 14:05

2 Answers 2

up vote 4 down vote accepted

Try this:

OpenLayers.Util.onImageLoadError = function(){
     this.src = "images/blank.png";
};
share|improve this answer
    
Should I add this to Openlayers.js or to the <script> section of the HTML file hosting the Openlayers code? –  Ton Plomp Feb 28 '12 at 5:12
1  
to the <script> section of the HTML file hosting the Openlayers code. Actually at the beginning before you do var map =... –  CaptDragon Feb 28 '12 at 13:35

you can identify tile name from clicked coordinate with some code. if your problem is not contain big field you can use MapTiler site for identifying the defective tiles..

and Google Javascript Api can help you for finding some trick for this..

briefly your following way is:

  1. LatLontoMeters
  2. MeterstoPixel
  3. PixeltoTile

third item will give you the result..

i hope it helps you...

share|improve this answer
    
My issue is not about the actual tile (I have a special set for a given dataset), however sometimes I see missing tile in the corner of my screen, that I wish to replace with some special 'empty' tile –  Ton Plomp Feb 28 '12 at 6:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.