//<![CDATA[
/*
  clouds.js
  
  Copyright 2007 Udell Enterprises, Inc
*/

var _maxZoom = 5;

if (location.hostname == 'dev.daylightmap.com')
  var _serverDomain = 'http://dev.daylightmap.com/';
else
  var _serverDomain = 'http://www.daylightmap.com/';

cloudLayer = function()
{
  this.isPng = function() {return true};
  this.projection = new GMercatorProjection(_maxZoom);
};
cloudLayer.prototype = new GTileLayer(new GCopyrightCollection(''), 0, _maxZoom);

cloudLayer.prototype.addToMap = function(newMap)
{
  // Add the daylight layer to the supplied GMap2 object
  this.map = newMap;
  var types = this.map.getMapTypes();
  //for (var i = 0; i < types.length; i++)
    this.addToMapType(types[5]);
};

cloudLayer.prototype.addToMapType = function(mapType)
{
  // Add the daylight layer to a single map type (like G_SATELLITE_MAP)
  mapType.getTileLayers().splice(1, 0, this);
  mapType.getMaximumResolution = function(){return _maxZoom;};
};

cloudLayer.prototype.getTileUrl = function(point, zoom)
{
  return _serverDomain + '/clouds/tiles/ir_' + zoom + '_' + point.x + '_' + point.y + '.png';
};

//]]>