1. A method for obtaining a map by using an electronic device, comprising: capturing a map image from a physical map; obtaining a plurality of geographic coordinates corresponding to a plurality of reference points on the physical map from one of the physical map and the map image; calculating a corresponding geographic coordinate of each pixel in the map image according to the plurality of geographic coordinates corresponding to the plurality of reference points and a plurality of pixels corresponding to the plurality of reference points; and embedding the corresponding geographic coordinate of each pixel into the map image.