CN110347771B - Method and apparatus for presenting a map - Google Patents

Method and apparatus for presenting a map Download PDF

Info

Publication number
CN110347771B
CN110347771B CN201910636768.0A CN201910636768A CN110347771B CN 110347771 B CN110347771 B CN 110347771B CN 201910636768 A CN201910636768 A CN 201910636768A CN 110347771 B CN110347771 B CN 110347771B
Authority
CN
China
Prior art keywords
determining
level
screen
map
actual distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910636768.0A
Other languages
Chinese (zh)
Other versions
CN110347771A (en
Inventor
李杨
柯海帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910636768.0A priority Critical patent/CN110347771B/en
Publication of CN110347771A publication Critical patent/CN110347771A/en
Application granted granted Critical
Publication of CN110347771B publication Critical patent/CN110347771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Remote Sensing (AREA)
  • Data Mining & Analysis (AREA)
  • Navigation (AREA)
  • Instructional Devices (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for presenting a map. One embodiment of the method comprises: receiving a map display request sent by a client; determining a device screen size based on the device information; taking a preset level as an initial level, executing the following level determination steps: determining an actual distance corresponding to the shortest distance between the center point of the equipment screen and the edge of the screen based on the size of the equipment screen and the initial level; determining a minimum actual distance of at least one point of interest in the map data from the user location; determining whether the minimum actual distance is less than the actual distance; determining the initial level as a presentation level in response to determining that the minimum actual distance is less than the actual distance; and sending the map data to the client according to the presentation level so that the client presents the map by taking the user position as a central point. This embodiment ensures that the map presented in the screen of the device includes points of interest when the map is presented with the user position as the center point.

Description

Method and apparatus for presenting a map
Technical Field
The disclosed embodiments relate to the field of computer technologies, and in particular, to a method and apparatus for presenting a map.
Background
Electronic maps, i.e., digital maps, are maps that are stored and referred to digitally using computer technology. At present, the electronic map can perform drawing output with any scale and any range. Generally, when a user opens an electronic map, the electronic map displays a map of a certain range at a default scale, and the range may be related to the position of the user and the size of the screen of the electronic device used by the user. If POI (Point of Interest) exists in the range, the POI is displayed at the corresponding position of the map. If no POI exists in the range, no POI is displayed in the drawing, namely, no POI exists in the visual range of the screen of the electronic equipment used by the user. In this case, the user may only drag the map or manually change the scale to make POIs appear in the visible range.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for presenting a map.
In a first aspect, the disclosed embodiments provide a method for presenting a map, the method including: receiving a map display request sent by a client, wherein the map display request comprises user position and equipment information; determining the size of the screen of the equipment based on the equipment information; taking a preset level as an initial level, executing the following level determination steps: determining an actual distance corresponding to the shortest distance between the center point of the equipment screen and the edge of the screen based on the size of the equipment screen and the initial level; determining a minimum actual distance of at least one interest point in the map data from the user position; determining whether said minimum actual distance is less than said actual distance; determining said initial level as a presentation level in response to determining that said minimum actual distance is less than said actual distance; and sending map data to the client according to the presentation level so that the client presents a map by taking the user position as a central point.
In some embodiments, the step of determining the level further comprises: and in response to determining that the minimum actual distance is not less than the actual distance, taking a level less than the initial level as an initial level, and continuing to perform the level determining step.
In some embodiments, the device information includes a device model; and the determining of the device size based on the device information includes: and determining the width of the equipment screen according to the equipment model.
In some embodiments, the determining an actual distance corresponding to a shortest distance between a center point of the device screen and an edge of the screen based on the device screen size and the initial level includes: determining the shortest distance from the center point of the equipment screen to the edge of the screen according to the screen width in the size of the equipment screen; determining a scale corresponding to the initial level; and determining the actual distance corresponding to the shortest distance according to the shortest distance and the scale.
In some embodiments, the sending map data to the client according to the presentation level for the client to present a map with the user location as a center point includes: determining actual coordinates of positions corresponding to four vertexes of the device screen at the presentation level with the user position as a center point; determining the visible range of the map according to the actual coordinates of the four vertexes; determining a point of interest within the visual range from at least one point of interest in the map data; and taking the determined interest points as interest points to be presented, and sending the information of the interest points to be presented to the client so as to be presented in the displayed map by the client.
In a second aspect, an embodiment of the present disclosure provides an apparatus for presenting a map, the apparatus including: the map display device comprises a receiving unit, a display unit and a display unit, wherein the receiving unit is configured to receive a map display request sent by a client, and the map display request comprises user position and equipment information; a determination unit configured to determine a device screen size based on the device information; an execution unit configured to execute a preset level determination step with a preset level as an initial level; wherein, the execution unit comprises: a first determining module configured to determine an actual distance corresponding to a shortest distance between a center point of a device screen and an edge of the screen based on the device screen size and the initial level; a second determination module configured to determine a minimum actual distance of at least one point of interest in the map data from the user location; a third determining module configured to determine whether the minimum actual distance is less than the actual distance; a fourth determination module configured to determine the initial level as a presentation level in response to determining that the minimum actual distance is less than the actual distance; and the sending unit is configured to send the map data to the client according to the presentation level so that the client presents the map by taking the user position as a center point.
In some embodiments, the execution unit further includes: and a step executing module configured to continue executing the level determining step by using a level smaller than the initial level as an initial level in response to determining that the minimum actual distance is not smaller than the actual distance.
In some embodiments, the device information includes a device model; and the determining unit is further configured to: and determining the width of the equipment screen according to the equipment model.
In some embodiments, the first determining module is further configured to: determining the shortest distance from the center point of the equipment screen to the edge of the screen according to the screen width in the size of the equipment screen; determining a scale corresponding to the initial level; and determining the actual distance corresponding to the shortest distance according to the shortest distance and the scale.
In some embodiments, the transmitting unit is further configured to: determining actual coordinates of positions corresponding to four vertexes of the device screen at the presentation level with the user position as a center point; determining the visible range of the map according to the actual coordinates of the four vertexes; determining a point of interest within the visual range from at least one point of interest in the map data; and taking the determined interest points as interest points to be presented, and sending the information of the interest points to be presented to the client so as to be presented in the displayed map by the client.
In a third aspect, an embodiment of the present disclosure provides a server, including: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer-readable medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The method and the device for presenting the map, provided by the embodiment of the disclosure, determine the screen size of the device based on the device information in the map display request sent by the client, and perform the following level determination steps with a preset level as an initial level: firstly, determining an actual distance corresponding to the shortest distance between the center point of the equipment screen and the edge of the screen based on the size of the equipment screen and the initial level; thereafter, determining a minimum actual distance of at least one point of interest in the map data from the user location; then, it is determined whether the minimum actual distance is less than the actual distance, and if the minimum actual distance is less than the actual distance, the initial level is determined as the presentation level. And sending the map data to the client according to the presentation level so that the client presents the map by taking the user position as a central point, thereby ensuring that the map presented in the screen of the equipment comprises interest points when the map is presented by taking the user position as the central point, improving the rich degree of information display and improving the user experience.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for presenting a map according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for presenting a map according to the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for presenting a map according to the present disclosure;
FIG. 5 is a schematic block diagram of one embodiment of an apparatus for presenting maps in accordance with the present disclosure;
FIG. 6 is a schematic block diagram of a computer system suitable for use with a server embodying embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of a method for presenting a map or an apparatus for presenting a map to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a map-like application, a search-like application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting positioning, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background server that provides support for electronic maps displayed on the terminal devices 101, 102, 103. The backend server can determine the level for presentation according to the user position and the screen size, and send the map data to the terminal devices 101, 102, 103 for display by the terminal devices 101, 102, 103 according to the level for presentation.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the method for presenting a map provided by the embodiment of the present disclosure is generally performed by the server 105, and accordingly, the apparatus for presenting a map is generally disposed in the server 105.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for presenting a map in accordance with the present disclosure is shown. The method for presenting the map comprises the following steps:
step 201, receiving a map display request sent by a client.
In this embodiment, an execution subject (e.g., the server 105 shown in fig. 1) of the method for presenting a map may receive a map display request from a client terminal through a wired connection manner or a wireless connection manner, wherein the map display request may include user location and device information. Here, the device information may refer to information of an electronic device (e.g., terminal devices 101, 102, 103 shown in fig. 1) where the client is located, for example, a model of the electronic device, a hardware identification, a size of a screen, and the like. In practice, the client used by the user may perform positioning through a variety of positioning techniques, and send the positioning result (e.g., coordinates) as the user position to the execution subject. For example, the Positioning may be implemented based on a Global Positioning System (GPS), or based on a base station of a mobile operating network.
Step 202, determining the screen size of the device based on the device information.
In this embodiment, the execution body may determine the device screen size from the device information in the map display request. Here, the device screen size may include a screen height and a width, the screen height may be equal to the length of the long side of the rectangular screen, and the screen width may be equal to the length of the short side of the rectangular screen. As an example, the device information may include a screen size. In this way, the execution body can directly determine the screen size of the device according to the device information sent by the client.
In some optional implementation manners of this embodiment, the device information may further include a device model. And step 202 may be specifically performed as follows: and determining the width of the equipment screen according to the equipment model.
In this implementation, the execution main body may store, in advance, a correspondence between a plurality of sample device models and the width of the sample device screen. In this way, the execution subject may compare the device model received from the client with a plurality of sample device models in the correspondence relationship, and determine the width of the sample device screen corresponding to the sample device model that is the same as the received device model as the width of the device screen corresponding to the received device model.
Step 203, with the preset level as the initial level, executing the following level determination steps 2031 to 2034.
In this embodiment, the execution subject may take a preset level as an initial level. In practice, there is a one-to-one correspondence between the levels of the map and the scale. For example, an electronic map may include multiple levels, e.g., levels 1-19, each level corresponding to a scale. Generally, larger levels correspond to larger scales. For example, in certain electronic maps, the 19-level scale corresponds to 1cm (centimeter): 20m (meter), and represents that the distance 1cm on the graph is the actual distance 20 m. The scale bar for 18 grades is 1 cm: scale bar for 50m, 17 scale is 1 cm: 100 m. Here, the preset level may be set according to actual needs. With a preset level as an initial level, the execution agent may perform the following level determination steps 2031 to 2034.
Step 2031, based on the size of the device screen and the initial level, determining an actual distance corresponding to the shortest distance between the center point of the device screen and the edge of the screen.
In this embodiment, the execution subject may determine an actual distance corresponding to a shortest distance between a center point of the device screen and an edge of the screen based on the device screen size and the initial level. Typically, a rectangular device screen includes two long sides and two short sides. Here, the shortest distance between the center point of the device screen and the edge of the screen may refer to a distance between the center point of the screen and the short side of the device screen, which is equal to half the width of the screen.
As an example, first, the execution body may determine actual coordinates of corresponding positions of four vertices of the device screen at an initial level with the user position in the map display request as a center point. Then, the executing body may determine the nearest coordinate corresponding to the screen edge closest to the center point according to the coordinate of the user position and the actual coordinates of the four vertices. Then, the distance between the coordinates of the user position and the nearest coordinates is calculated. And finally, taking the calculated distance as an actual distance corresponding to the shortest distance from the center point of the equipment screen to the edge of the screen.
In some optional implementations of this embodiment, step 2031 may be specifically performed as follows:
first, the shortest distance from the center point of the device screen to the edge of the screen is determined according to the screen width in the device screen size.
In this implementation, the executing agent may determine the shortest distance from the center point of the device screen to the edge of the screen according to the screen width in the device screen size. As an example, half the width of the screen may be determined as the shortest distance from the center point of the device screen to the edge of the screen.
Then, a scale corresponding to the initial level is determined.
In this implementation, the execution subject may determine the scale corresponding to the initial level according to the one-to-one correspondence between the level of the map and the scale.
And finally, determining the actual distance corresponding to the shortest distance according to the shortest distance and the scale.
In this implementation, the execution subject may determine the actual distance corresponding to the shortest distance according to the shortest distance and the scale corresponding to the initial level. As an example, the execution subject may calculate a ratio of the shortest distance to a scale corresponding to the initial level, and take the ratio as an actual distance corresponding to the shortest distance.
Step 2032, a minimum actual distance of at least one point of interest in the map data from the user location is determined.
In this embodiment, the map data of the execution subject may include information of at least one point of interest. Here, the information of the point of interest may include a name, a category, coordinates, a classification, and the like. Here, the execution subject may calculate the straight actual distances from the respective interest points to the user position based on the coordinates of the interest points and the coordinates of the user position, and determine a minimum actual distance from the calculated actual distances as the minimum actual distance.
Step 2033, it is determined whether the minimum actual distance is less than the actual distance.
In this embodiment, the executing agent may compare the minimum actual distance obtained in step 2032 with the actual distance obtained in step 2031, so as to determine whether the minimum actual distance obtained in step 2032 is smaller than the actual distance obtained in step 2031.
In response to determining that the minimum actual distance is less than the actual distance, the initial level is determined to be a presentation level, step 2034.
In this embodiment, if it is determined that the minimum actual distance obtained in step 2032 is smaller than the actual distance obtained in step 2031, the execution subject may determine the initial level as the presentation level.
And step 204, sending the map data to the client according to the presentation level so that the client presents the map by taking the user position as a central point.
In this embodiment, the execution body may transmit, to the client, map data having the same scale as that corresponding to the presentation level according to the presentation level. The map data also includes information of the points of interest. In this way, the client can present a map with the user position as a central point, and points of interest can be marked in the presented map.
In some optional implementations of this embodiment, the step 204 may be specifically performed as follows:
first, the actual coordinates of the positions corresponding to the four vertices of the device screen at the presentation level are determined with the user position as the center point.
In this implementation, the execution subject may determine the actual coordinates of the positions on the graph corresponding to the four vertices of the device screen at the presentation level described above, with the user position as a center point. As an example, the actual coordinates of the position on the graph corresponding to the four vertices of the device screen may be calculated by the execution subject from the coordinates of the user position and the level for presentation. As another example, the actual coordinates of the on-graph location corresponding to the four vertices of the device screen may also be received from the client, which may determine the actual coordinates of the on-graph location corresponding to the four vertices of the device screen, typically when the client loads a map.
Secondly, according to the actual coordinates of the four vertexes, the visible range of the map is determined.
In this implementation manner, the execution subject may determine a range displayed by the electronic map at the client according to the actual coordinates corresponding to the four vertices of the device screen, where the range is a visual range of the user. As an example, the rectangular range framed by the actual coordinates of the four vertices is the visible range.
Then, a point of interest located within the visible range is determined from the at least one point of interest in the map data.
In this implementation, the execution subject may determine a point of interest located within the above-described visual range from at least one point of interest in the map data. In practice, the execution subject may determine whether a certain interest point is located within the visible range according to the coordinates of the interest point.
And finally, taking the determined interest points as interest points to be presented, and sending the information of the interest points to be presented to the client for presentation in the displayed map by the client.
In this implementation, the execution subject may use the determined interest point as an interest point to be presented, and send information of the interest point to be presented to the client, so that the client presents the information in the displayed map. As an example, the client may mark the interest point to be presented in the displayed map according to the coordinates of the interest point to be presented.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for presenting a map according to the present embodiment. In the application scenario of fig. 3, the server 301 first receives a map display request sent by the client 302, and determines a device screen size based on device information in the map display request, where the map display request includes the user location "a" and the device information. After that, the server 301 may perform the following level determination steps with the preset level as an initial level: in step S1, an actual distance corresponding to the shortest distance between the center point of the device screen and the edge of the screen is determined based on the device screen size and the initial level. Step S2, a minimum actual distance of at least one point of interest in the map data from the user' S location is determined. Step S3, determining whether the minimum actual distance is less than the actual distance. In step S4, if the minimum actual distance is smaller than the actual distance, the initial level is determined as the presentation level. Then, the server 301 transmits the map data to the client 302 according to the presentation level, so that the client 302 presents the map with the user position as a center point.
The method provided by the embodiment of the disclosure can determine the level for presentation based on the size of the screen of the device, thereby ensuring that when the map is presented by taking the position of the user as a central point, the map presented in the screen of the device comprises interest points, thereby improving the richness of information display and improving the user experience.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for presenting a map is shown. The flow 400 of the method for presenting a map comprises the steps of:
step 401, receiving a map display request sent by a client.
In this embodiment, step 401 is similar to step 201 of the embodiment shown in fig. 2, and is not described here again.
At step 402, a device screen size is determined based on the device information.
In this embodiment, step 402 is similar to step 202 of the embodiment shown in fig. 2, and is not described herein again.
Step 403, with a preset level as an initial level, executing the following level determination steps 4031-4035.
In this embodiment, the execution subject may perform the following level determination steps 4031 to 4035 with a preset level as an initial level.
Step 4031, based on the size of the device screen and the initial level, an actual distance corresponding to the shortest distance between the center point of the device screen and the edge of the screen is determined.
In this embodiment, step 4031 is similar to step 2031 in the embodiment shown in fig. 2, and is not described here again.
Step 4032, a minimum actual distance of at least one point of interest in the map data from the user's location is determined.
In this embodiment, step 4032 is similar to step 2032 of the embodiment shown in fig. 2, and is not described here again.
Step 4033, determine whether the minimum actual distance is less than the actual distance.
In this embodiment, step 4033 is similar to step 2033 of the embodiment shown in fig. 2, and is not described here again.
Step 4034, in response to determining that the minimum actual distance is less than the actual distance, determining the initial level as a presentation level.
In this embodiment, step 4034 is similar to step 2034 of the embodiment shown in fig. 2, and is not described here again.
Step 4035, in response to determining that the minimum actual distance is not less than the actual distance, the level less than the initial level is taken as the initial level, and the level determination step is continued.
In this embodiment, if the minimum actual distance determined in step 4032 is not less than the actual distance determined in step 4031, the execution subject may continue to perform the above-described level determination step with a level less than the initial level as the initial level. Generally, the smaller the level, the smaller the scale, e.g. some electronic map, the 19 level, the 1 cm: 20 m. The scale bar for 18 grades is 1 cm: scale bar for 50m, 17 scale is 1 cm: 100 m. Since the scale and the actual range shown on the map are inversely proportional at a constant distance on the map, that is, the smaller the scale, the larger the actual range shown on the map, the level smaller than the initial level is used as the initial level, and the actual range displayed on the screen of the device can be made larger while the size of the screen of the device is not changed. And the larger the actual range, the more likely there is a point of interest. Therefore, by setting a level smaller than the initial level as the initial level, the level for presentation can be determined more quickly.
And step 404, sending map data to the client according to the presentation level so that the client presents the map by taking the user position as a central point.
In this embodiment, step 404 is similar to step 204 of the embodiment shown in fig. 2, and is not described here again.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for presenting a map in the present embodiment highlights the step of continuing to perform the level determining step with a level smaller than the initial level as the initial level when the minimum actual distance is not smaller than the actual distance. Therefore, the scheme described in the embodiment can iteratively execute the level determination step, so that the automatic determination of the presentation level is realized, and the efficiency of determining the presentation level is improved. Meanwhile, when the map is presented by taking the user position as the central point, the map presented in the screen of the equipment comprises the interest point, so that the rich degree of information display is improved, and the user experience is improved.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for presenting a map, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 5, the apparatus 500 for presenting a map of the present embodiment includes: a receiving unit 501, a determining unit 502, an executing unit 503 and a transmitting unit 504. The receiving unit 501 is configured to receive a map display request sent by a client, where the map display request includes user location and device information; the determination unit 502 is configured to determine a device screen size based on the device information; the execution unit 503 is configured to execute a preset level determination step with a preset level as an initial level; the execution unit 503 includes: a first determining module 5031 configured to determine an actual distance corresponding to a shortest distance between a center point of the device screen and an edge of the screen based on the device screen size and the initial level; a second determining module 5032 configured to determine a minimum actual distance from the user location of at least one point of interest in the map data; a third determining module 5033 configured to determine whether the minimum actual distance is less than the actual distance; a fourth determination module 5034 configured to determine the initial level as a presentation level in response to determining that the minimum actual distance is less than the actual distance; the sending unit 504 is configured to send map data to the client according to the presentation level, so that the client presents a map with the user position as a center point.
In this embodiment, specific processing of the receiving unit 501, the determining unit 502, the executing unit 503 and the sending unit 504 of the apparatus 500 for presenting a map and technical effects thereof may refer to related descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the executing unit 503 further includes: a step executing module (not shown in the figure) configured to, in response to determining that the minimum actual distance is not smaller than the actual distance, take a level smaller than the initial level as an initial level, and continue to execute the level determining step.
In some optional implementation manners of this embodiment, the device information includes a device model; and the above-mentioned determining unit 502 is further configured to: and determining the width of the equipment screen according to the equipment model.
In some optional implementations of the present embodiment, the first determining module 5031 is further configured to: determining the shortest distance from the center point of the equipment screen to the edge of the screen according to the screen width in the size of the equipment screen; determining a scale corresponding to the initial level; and determining the actual distance corresponding to the shortest distance according to the shortest distance and the scale.
In some optional implementations of this embodiment, the sending unit 504 is further configured to: determining actual coordinates of positions corresponding to four vertexes of the device screen at the presentation level with the user position as a center point; determining the visible range of the map according to the actual coordinates of the four vertexes; determining a point of interest within the visual range from at least one point of interest in the map data; and taking the determined interest points as interest points to be presented, and sending the information of the interest points to be presented to the client so as to be presented in the displayed map by the client.
Referring now to FIG. 6, a schematic diagram of an electronic device (e.g., the server of FIG. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a map display request sent by a client, wherein the map display request comprises user position and equipment information; determining a device screen size based on the device information; taking a preset level as an initial level, executing the following level determination steps: determining an actual distance corresponding to the shortest distance between the center point of the device screen and the edge of the screen based on the size of the device screen and the initial level; determining a minimum actual distance of at least one point of interest in map data from the user location; determining whether the minimum actual distance is less than the actual distance; determining the initial level as a presentation level in response to determining that the minimum actual distance is less than the actual distance; and sending map data to the client according to the presentation level so that the client presents a map by taking the user position as a central point.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a determining unit, an executing unit, and a transmitting unit. The names of these units do not in some cases constitute a limitation on the unit itself, and for example, a receiving unit may also be described as a "unit that receives a map display request sent by a client".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method for presenting a map, comprising:
receiving a map display request sent by a client, wherein the map display request comprises user position and equipment information;
determining a device screen size based on the device information;
taking a preset level as an initial level, executing the following level determination steps: determining an actual distance corresponding to the shortest distance between the center point of the device screen and the edge of the screen based on the size of the device screen and the initial level; determining a minimum actual distance of at least one point of interest in map data from the user location; determining whether the minimum actual distance is less than the actual distance; determining the initial level as a presentation level in response to determining that the minimum actual distance is less than the actual distance; the actual distance is determined according to the shortest distance and the scale corresponding to the initial level;
sending map data to the client according to the presentation level so that the client presents a map by taking the user position as a central point;
the sending map data to the client according to the presentation level for the client to present a map with the user position as a center point comprises:
determining actual coordinates of positions corresponding to four vertexes of the device screen at the presentation level with the user position as a center point;
determining the visible range of the map according to the actual coordinates of the four vertexes;
determining a point of interest within the visual range from at least one point of interest in the map data;
and taking the determined interest points as interest points to be presented, and sending the information of the interest points to be presented to the client so that the client presents the marked interest points to be presented in the displayed map.
2. The method of claim 1, wherein the level determining step further comprises:
in response to determining that the minimum actual distance is not less than the actual distance, taking a level less than the initial level as an initial level, continuing to perform the level determining step.
3. The method of claim 1, wherein the device information includes a device model number; and
the determining a device size based on the device information includes:
and determining the width of the equipment screen according to the equipment model.
4. The method of claim 1, wherein determining an actual distance corresponding to a shortest distance between a center point of a device screen and an edge of the screen based on the device screen size and the initial level comprises:
determining the shortest distance from the center point of the equipment screen to the edge of the screen according to the screen width in the size of the equipment screen;
determining a scale corresponding to the initial level;
and determining the actual distance corresponding to the shortest distance according to the shortest distance and the scale.
5. An apparatus for presenting a map, comprising:
a receiving unit configured to receive a map display request transmitted by a client, wherein the map display request includes user location and device information;
a determination unit configured to determine a device screen size based on the device information;
an execution unit configured to execute a preset level determination step with a preset level as an initial level; wherein the execution unit includes: a first determining module configured to determine an actual distance corresponding to a shortest distance between a center point of a device screen and an edge of the screen based on the device screen size and the initial level; the actual distance is determined according to the shortest distance and the scale corresponding to the initial level; a second determination module configured to determine a minimum actual distance of at least one point of interest in map data from the user location; a third determination module configured to determine whether the minimum actual distance is less than the actual distance; a fourth determination module configured to determine the initial level as a presentation level in response to determining that the minimum actual distance is less than the actual distance;
a sending unit configured to send map data to the client according to the presentation level for the client to present a map with the user position as a center point;
the sending unit is further configured to:
determining actual coordinates of positions corresponding to four vertexes of the device screen at the presentation level with the user position as a center point;
determining the visible range of the map according to the actual coordinates of the four vertexes;
determining a point of interest within the visual range from at least one point of interest in the map data;
and taking the determined interest points as interest points to be presented, and sending the information of the interest points to be presented to the client so that the client presents the marked interest points to be presented in the displayed map.
6. The apparatus of claim 5, wherein the execution unit further comprises:
a step execution module configured to continue executing the level determination step with a level smaller than the initial level as an initial level in response to determining that the minimum actual distance is not smaller than the actual distance.
7. The apparatus of claim 5, wherein the device information comprises a device model number; and
the determination unit is further configured to:
and determining the width of the equipment screen according to the equipment model.
8. The apparatus of claim 5, wherein the first determination module is further configured to:
determining the shortest distance from the center point of the equipment screen to the edge of the screen according to the screen width in the size of the equipment screen;
determining a scale corresponding to the initial level;
and determining the actual distance corresponding to the shortest distance according to the shortest distance and the scale.
9. A device/terminal/server comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-4.
CN201910636768.0A 2019-07-15 2019-07-15 Method and apparatus for presenting a map Active CN110347771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910636768.0A CN110347771B (en) 2019-07-15 2019-07-15 Method and apparatus for presenting a map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910636768.0A CN110347771B (en) 2019-07-15 2019-07-15 Method and apparatus for presenting a map

Publications (2)

Publication Number Publication Date
CN110347771A CN110347771A (en) 2019-10-18
CN110347771B true CN110347771B (en) 2022-04-22

Family

ID=68176374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910636768.0A Active CN110347771B (en) 2019-07-15 2019-07-15 Method and apparatus for presenting a map

Country Status (1)

Country Link
CN (1) CN110347771B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100831595B1 (en) * 2006-11-08 2008-05-23 팅크웨어(주) Navigation system and method for displaying poi of land mark
CN101666656A (en) * 2008-09-05 2010-03-10 宏达国际电子股份有限公司 Method and device for operating the visual field of electronic map and computer program product used thereby
CN102053782A (en) * 2009-10-26 2011-05-11 奥多比公司 Zoom adjustment process
CN103185600A (en) * 2011-12-30 2013-07-03 上海博泰悦臻电子设备制造有限公司 Navigation system, and navigation method and device
CN105378433A (en) * 2013-06-07 2016-03-02 诺基亚技术有限公司 Method and apparatus for self-adaptively visualizing location based digital information
CN106017490A (en) * 2016-04-29 2016-10-12 玉环看知信息科技有限公司 Map display method, navigation server and navigation system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100831595B1 (en) * 2006-11-08 2008-05-23 팅크웨어(주) Navigation system and method for displaying poi of land mark
CN101666656A (en) * 2008-09-05 2010-03-10 宏达国际电子股份有限公司 Method and device for operating the visual field of electronic map and computer program product used thereby
CN102053782A (en) * 2009-10-26 2011-05-11 奥多比公司 Zoom adjustment process
CN103185600A (en) * 2011-12-30 2013-07-03 上海博泰悦臻电子设备制造有限公司 Navigation system, and navigation method and device
CN105378433A (en) * 2013-06-07 2016-03-02 诺基亚技术有限公司 Method and apparatus for self-adaptively visualizing location based digital information
CN106017490A (en) * 2016-04-29 2016-10-12 玉环看知信息科技有限公司 Map display method, navigation server and navigation system

Also Published As

Publication number Publication date
CN110347771A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
CN111273830A (en) Data display method and device, electronic equipment and computer readable medium
CN110619085B (en) Information processing method and device
CN110347771B (en) Method and apparatus for presenting a map
CN111324470A (en) Method and device for generating information
CN110619089B (en) Information retrieval method and device
CN110620808A (en) Method and device for pushing information
US10567301B2 (en) Implementation of third party services in a digital service platform
CN110086880B (en) Method and apparatus for creating instances of network requests
CN113970754A (en) Positioning method and device of autonomous travelable equipment
CN111835917A (en) Method, device and equipment for showing activity range and computer readable medium
CN110083283B (en) Method, device and system for managing information
CN110084298B (en) Method and device for detecting image similarity
CN113691937A (en) Method for determining position information, cloud mobile phone and terminal equipment
CN110647599B (en) Method and apparatus for displaying information
CN111931044A (en) Information display method and device and electronic equipment
CN110621066B (en) Method and apparatus for processing information
CN111327472A (en) Method and device for acquiring target network
CN110728478A (en) Method and device for generating information
CN111741437B (en) Positioning method for addressing correction of satellite positioning and communication base station cloud terminal
CN115268917B (en) Node structure diagram construction method, device, equipment and medium
CN114357348B (en) Display method and device and electronic equipment
CN111461227B (en) Sample generation method, device, electronic equipment and computer readable medium
CN112883410B (en) Method and device for displaying information
CN110110695B (en) Method and apparatus for generating information
CN110620805B (en) Method and apparatus for generating information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant