 			if(!wmsURL.value)
 				return;
 			
-			//http://tiles.domain.com/layer/{z}/{x}/{y}.png			
-			
-			var basicReq:String = getTileUrls(new Coordinate(0,0,0));
+			//http://tiles.domain.com/layer/{z}/{x}/{y}.png
+			getAllowedBounds(_tempBounds);
+			_tempBounds2.setBounds(0, 0, 256, 256);
+			
+			var basicReq:String = getTileUrl(new Coordinate(0,0,0), _tempBounds, _tempBounds2);
 			var instance:CustomWMS = this;
 			WeaveAPI.URLRequestUtils.getContent(
 				this,

				_tempCoord.zoom = higherQualZoomLevel;
		}
		
		private function getTileUrls(coord:Coordinate):String
		{
			if(!wmsURL || !wmsURL.value)
				return null;
			
			var url:String = wmsURL.value;
			
			url= url.replace('{z}','{0}');
			url= url.replace('{x}','{1}');
			url= url.replace('{y}','{2}');
			
			url = StringUtil.substitute(url,coord.zoom.toString(),coord.column.toString(),coord.row.toString());
			
			return url;
		}
		
		/**

		 * @param sourceSRS The SRS code of the source projection.
		 * @param destSRS The SRS code of the destination projection.
		 */
		private function setReprojectedBounds(input:IBounds2D, output:IBounds2D, sourceSRS:String, destSRS:String):void
		{
			input.getMinPoint(_tempPoint);
			WeaveAPI.ProjectionManager.transformPoint(sourceSRS, destSRS, _tempPoint);
			output.setMinPoint(_tempPoint);
			input.getMaxPoint(_tempPoint);
			WeaveAPI.ProjectionManager.transformPoint(sourceSRS, destSRS, _tempPoint);
			output.setMaxPoint(_tempPoint);
			
			output.makeSizePositive();
		}
		
		
		/**
		 * This function will convert a bounds in lat/long coordinates to tile (x, y) coordinates.
		 * 
		 * @param input The input values.
		 * @param output The output buffer.
		 * @param zoomScale The value 2^zoom where zoom is the zoom level.
		 * @return The destination bounds.
		 */
		private function dataBoundsToTileXY(input:Bounds2D, output:Bounds2D, zoomScale:Number):IBounds2D
		{
			input.makeSizePositive();
			
			output.xMin = zoomScale * (input.xMin + 180) / 360.0; 
			output.xMax = zoomScale * (input.xMax + 180) / 360.0; 
			
			var latRadians:Number = input.yMin * Math.PI / 180;
			output.yMin = zoomScale * (1 - (Math.log(Math.tan(latRadians) + (1 / Math.cos(latRadians))) / Math.PI)) / 2.0;
			latRadians = input.yMax * Math.PI / 180;
			output.yMax = zoomScale * (1 - (Math.log(Math.tan(latRadians) + (1 / Math.cos(latRadians))) / Math.PI)) / 2.0;
			
			output.makeSizePositive();
			
			output.xMin = Math.floor(output.xMin);
			output.yMin = Math.floor(output.yMin);
			output.xMax = Math.ceil(output.xMax);
			output.yMax = Math.ceil(output.yMax);
			
			// although this may allow the max values to be zoomScale, which is 1 larger than number of tiles,
			// it's not a problem because the tile starting at zoomScale,zoomScale is never requested.
			_tempBounds.setBounds(0, 0, zoomScale, zoomScale); 
			_tempBounds.constrainBounds(output, false);
			
			return output;
		}
		
		/**
		 * This function will convert bounds from tile x,y coordinates to Latitude and Longitude coordinates.
		 * @param input The input values.
		 * @param output The output buffer.
		 * @param zoomScale The value 2^zoom.
		 * @return The destBounds.
		 */
		private function tileXYToDataBounds(input:Bounds2D, output:Bounds2D, zoomScale:Number):IBounds2D
		{
			output.xMin = 360 * (input.xMin / zoomScale) - 180.0;
			output.xMax = 360 * (input.xMax / zoomScale) - 180.0;
			
			var latRadians:Number = Math.atan(ProjConstants.sinh(Math.PI * (1 - 2 * input.yMin / zoomScale)));
			output.yMin = latRadians * 180.0 / Math.PI;
			latRadians = Math.atan(ProjConstants.sinh(Math.PI * (1 - 2 * input.yMax / zoomScale)));
			output.yMax = latRadians * 180.0 / Math.PI;
			
			output.makeSizePositive();
			
			return output;
		}
		
		public const creditInfo:LinkableString = registerLinkableChild(this,new LinkableString(""));
