Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a map using openlayers contains osm, google layers and some vector features, On loading it shows two errors like: GET 404 (Not Found). How to prevent this , I've googled it, and i can't understand what is the exact problem and how to solve this please help me.

share|improve this question
up vote 2 down vote accepted

you cant prevent this. it says that the server you have used for openstreetmap dont have image at this url.

but you can use this code for image loading error:

OpenLayers.Util.onImageLoadError = function(){

i hope it helps you...

share|improve this answer
Shows a new error Failed to load resource: the server responded with a status of 404 (Not Found). – bios Aug 14 '12 at 11:02
check your all paths whether they are valid or invalid. – Aragon Aug 14 '12 at 11:08
I've not used paths to create map only added two scripts: <script src="…; <script src=""></script>; – bios Aug 14 '12 at 11:20
@Aragon, onImageLoadError has been deprecated, see my answer below. – drnextgis Aug 14 '12 at 15:20

You are asking for the second tile (in the y direction) in zoom level 0. It only has one tile at that level (at

Something is wrong with your code, or the js you are importing.

share|improve this answer

OpenLayers.Util.onImageLoadError no longer exists

To replace a tile that couldn't be loaded with a static image, create a css selector for the .olImageLoadError class (e.g. a background-image):

.olImageLoadError {
    background: url(./images/missing-tile.png) no-repeat scroll 0 0 transparent !important;
    opacity: 1.0 !important;

For more complex tile loading error handling, register a listener to the layer's tileerror event.

Corresponding issues/pull requests:

onImageLoadError was removed by this commit.

share|improve this answer

Your Answer


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.