Those are Blowfly larvae. These are the most common maggot in compost heaps. They will usually appear when the pile is less aerobic than ideal, but will hit almost any compost heap, especially those with raw kitchen scraps or manure added. These will become flies if you don't stop them soon.
When I had this problem, I spread out the pile to 1" deep, on some tarps. They sat in the sun until completely dry. This of course brings the composting process to a standstill, but you can moisten and re-stack the pile after all the maggots are dead. Drying the heap in some way is probably your best option. Be creative.
If you have chickens, you can spread out your heap in their pen. They will eat out the maggots (free protein supplement), and add valuable manure. Re-stack, and add carbon accordingly.
Most maggot infestations are caused by a heap which is:
- too damp
- too compacted
- too large
- too cold (a good hot heap will kill them)
- mostly partially decomposed food scraps or manure
and others. It could be any combination of these. Composting is complicated and these things happen to almost everyone. If neither of the suggested methods will work for you, and no one else gives input, you may have to wait this one out, and try to create a healthy, active heap which the flies won't lay eggs in.
....................Dirty maggots:............................................Clean maggots:....................

