A computer-implemented method, comprising: obtaining a floor plan about a first floor of a first building comprising at least one floor; generating a first map for the first floor based on the floor plan, the first map including a plurality of vertices and edges, wherein one vertex corresponds to a position on the first floor, an edge connecting two vertices represents a physical object or a passable path on the first floor, and two positions corresponding to the two vertices are located at the physical object or on the passable path; and providing a location-based service to a user at least based on the first map; wherein generating the first map comprises: generating an initial map for the first floor based on the floor plan, the initial map including a first group of vertices and edges representing outlines of physical objects on the first floor; optimizing the initial map to remove redundant information and generate a second map for the first floor, the second map including a second group of vertices and edges derived from optimizing the first group of vertices and edges; and generating the first map based on the second map, characterised in that generating the first map based on the second map comprises: generating a third map by applying triangulation to the second map, the third map including the second group of vertices and edges and at least one edge added through the triangulation; and generating the first map by adding, to the third map based on heuristics, a vertex representing a position on a passable path on the first floor, wherein the vertex is on the at least one edge added through triangulation. obtaining a floor plan about a first floor of a first building comprising at least one floor; generating a first map for the first floor based on the floor plan, the first map including a plurality of vertices and edges, wherein one vertex corresponds to a position on the first floor, an edge connecting two vertices represents a physical object or a passable path on the first floor, and two positions corresponding to the two vertices are located at the physical object or on the passable path; and providing a location-based service to a user at least based on the first map; wherein generating the first map comprises: generating an initial map for the first floor based on the floor plan, the initial map including a first group of vertices and edges representing outlines of physical objects on the first floor; optimizing the initial map to remove redundant information and generate a second map for the first floor, the second map including a second group of vertices and edges derived from optimizing the first group of vertices and edges; and generating the first map based on the second map, characterised in that generating the first map based on the second map comprises: generating a third map by applying triangulation to the second map, the third map including the second group of vertices and edges and at least one edge added through the triangulation; and generating the first map by adding, to the third map based on heuristics, a vertex representing a position on a passable path on the first floor, wherein the vertex is on the at least one edge added through triangulation. generating a third map by applying triangulation to the second map, the third map including the second group of vertices and edges and at least one edge added through the triangulation; and generating the first map by adding, to the third map based on heuristics, a vertex representing a position on a passable path on the first floor, wherein the vertex is on the at least one edge added through triangulation.