Quito became a seat of Spanish colonial government in 1563 and part of the Viceroyalty of New Granada in 1717 .