In this paper, a novel method is proposed to generate the matching sequence of an ICCP algorithm for aircraft geomagnetic-aided navigation based on the M coding principle. The length of the matching sequence and the selection of the matching points directly affects the performance of the Iterated Closest Contour Point (ICCP) algorithm. This study proposes an adaptive geomagnetic matching method, ΔM-ICCP, to solve the problem of selecting suitable matching lengths, and matching points, when a vehicle is moving in a highly dynamic environment. First, the △M coding principle is adopted to select the matching points based on the information of the magnetic field, the resolution of the magnetic map, and the accuracy of the magnetic sensor. Then, the problem of selecting parameters for the △M-ICCP algorithm is turned into an optimisation problem, which can be solved by a Binary Particle Swarm Optimisation (BPSO) algorithm. Finally, the algorithm is verified through simulation experiments. The proposed algorithm can provide a basis to determine the matching length of the △M-ICCP algorithm and adaptively adjust the algorithm's parameters according to different trajectories. The algorithm is applicable even in the areas where the fluctuations of Earth's magnetic field are not significant.