Is there a way to detect when the tile server cannot be contacted with OpenLayers? I want to display a "Tile server cannot be found" failure message instead of just those ugly "image not found" red X tiles.
Just as an FYI to anyone who needs to do this, I solved this with the following code (placed BEFORE I created my map, layers, etc.):
OpenLayers.Util.onImageLoadError = function () {
this.src = "images/noTile.png";
}
where images/noTile.png was the image I used as the "Tile not found" image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With