Indoor positioning has attracted considerable interest in both the industry and academic communities because of its wide range of applications, such as asset tracking, healthcare and context-aware services like targeted advertisements. While there are many indoor localisation methods, each has its advantages and disadvantages, taking into consideration various factors such as the effect of the indoor environment, ease of implementation, computational cost, positioning accuracy, etc. In other words, no single solution can cater for all different situations. Although many survey papers have been published on indoor positioning, new techniques and methods are proposed every year, so it is important to stay abreast of its latest developments. In addition, each survey has its own classification for indoor positioning systems without a common scheme. Inspired by the well-known OSI model and TCP/IP model, it would be desirable to develop a systematic framework for studying indoor positioning systems. In this paper, we make this new contribution by introducing a systemic survey framework based on a six-layer model to give a comprehensive survey of indoor positioning systems, namely: device layer, communication layer, network layer, data layer, method layer and application layer. Complementing the previous survey papers, this paper provides a survey of the latest research works on indoor positioning based on the six-layer model. Our emphasis is on systematic categorisation, machine learning-based enhancements, collaborative localisation and COVID-19-related applications. The six-layer model should provide a useful framework and new insights for the research community.