The story
Named for various dukes of York. In the case of the New Zealand atoll, for Prince Edward, younger brother of George III of England. In the case of the Ecuadorian island, for James II of England prior to his father's death.
Etymology from Wiktionary, CC BY-SA 4.0.