3

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?

0

2 Answers 2

6

Try this:

OpenLayers.Util.onImageLoadError = function(){
     this.src = "images/blank.png";
};
2
  • Should I add this to Openlayers.js or to the <script> section of the HTML file hosting the Openlayers code?
    – Ton Plomp
    Feb 28, 2012 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, 2012 at 13:35
-1

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.

1
  • 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, 2012 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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