Map matching has been widely used in various indoor localization technologies. However, conventional map matching technologies based on probabilistic models, such as particle filter (PF), still have a series of limitations, such as underutilization of map information, poor generalization, and relatively low precision. To improve the performance of PF-based map matching technique, this paper proposes MapDem, a novel map matching model fusing dynamic word embeddings and Variational Autoencoder (VAE) to improve matching performance significantly. The key to our approach is to extract map information using dynamic word embeddings to represent each reachable point on the map as word vectors with allowable oriented trajectory information. The same point has different representations on different trajectories so that MapDem can adaptively learn the contextual information of map for position estimation. Unlike traditional particle filters, MapDem focuses on the learning of particle sets distribution by a statistical model, Variational Autoencoder (VAE), followed by estimating position with combined current and previous sequence information. Extensive experiments have been conducted with 610 trajectories in three real-world scenarios. Numerical results demonstrate the adaptability of MapDem which works equally well in all three different scenarios, outperforming traditional particle filters by 18% on average.