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

How to check if the map tiles are loaded?

I need to know whether all map tiles are loaded on to the OpenLayers map as html contents.... Is there any method to find out or function in openlayers to find out for how much percentage the map tiles are loaded.......

share|improve this question
up vote 7 down vote accepted

see the Layer Load Monitoring sample for some ideas."loadend", layer, function() {
  this.logEvent("Load End. Grid:" + this.grid.length + "x" + this.grid[0].length);
share|improve this answer
thanks @stephen it helped me..... – Raghu Sep 4 '12 at 14:40
is there a call that would check every layer on the map rather than just one single layer? or do we basically have to monitor each one separately? – Manuel Arredondo Dec 3 '12 at 21:15
@ManuelArredondo I can't see any map-level events at… so I believe you'll need to monitor each layer separately. – Stephen Lead Dec 4 '12 at 0:33

In case you see this answer and you were looking for the same thing just in open layers 3 so here is the code you need:

var source = new ol.source.TileJSON({
  url: '',
  crossOrigin: 'anonymous'

source.on('tileloadstart', function(event) {
  // do some stuff start loading tiles...

source.on('tileloadend', function(event) {
  // do some stuff tiles were loaded...
source.on('tileloaderror', function(event) {
  // eject :(

var map = new ol.Map({
  logo: false,
  layers: [
    new ol.layer.Tile({source: source})
  renderer: exampleNS.getRendererFromQueryString(),
  target: 'map',
  view: new ol.View({
    center: [0, 0],
    zoom: 2
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.