 	jsonp:()->undefined
 	
 Blender = (opt, routes)->
-	@base = opt.layers[0]
-	@overlay = opt.layers[1]
+	@layers = opt.layers
 	@routes = routes
 	@
 

		else
			cb null, data.data
 
composit = (a,b,cb)->
	if a and not b
		cb null, a
		return
	else if not a and b
		cb null, b
		return
	else if not a and not b
		cb(true)
		return
	async.map [a,b], parsePng, (err, tiles)->
		if tiles.length == 0
			cb true
			return

	
Blender::getTile = (z,x,y, cb) ->
	#console.log "getting"
	opts={}
	opts.zoom = z
	opts.y = y
	opts.x = x
	opts.format = "png"
	mapFunc = (l, clb)=>
		opts.layer = l
		@routes.getTile opts, clb
	filterFunc = (a,c)->
		c !!a
	async.map @layers, mapFunc, (err, tilesRaw)->
		async.filter tilesRaw, filterFunc, (tiles)->
			composit tiles, cb
		
