Near-field optics and control of photonic crystals