A method, system, terminal and computer device for zooming in and out of a map

By calculating the rectangular center point and diagonal point of a fixed point and a group of points on the map, and determining the diagonal point of the second rectangle, the problem of fixed point position offset when the map is zoomed is solved, and the user experience and operation efficiency are improved.

CN112801869BActive Publication Date: 2024-09-24BEIJING DIDI INFINITY TECH & DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110020367.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-06-19
Publication Date
2024-09-24
Estimated Expiration
2037-06-19

AI Technical Summary

Technical Problem

When the map is zoomed in the existing technology, the fixed point position is easily offset or requires additional movement, resulting in poor user experience.

Method used

By obtaining the coordinates of a fixed point and a group of points on the map, calculating the center point of the rectangle surrounding these points and the corresponding second rectangle, using the longitude and latitude difference to determine the diagonal point of the second rectangle, ensuring that the fixed point is in the zoom process The position remains unchanged.

Benefits of technology

It achieves the stability of the fixed point position when zooming in the map, saving user operation time and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112801869B
    Figure CN112801869B
Patent Text Reader

Abstract

The present invention proposes a method, system, terminal and computer device for zooming in and out a map, which are applied to the field of data processing technology. The method for zooming in and out a map includes: obtaining the coordinates of a fixed point and all the coordinates of a group of points on the map; obtaining the coordinates of the center point of a first rectangle surrounding the group of points; obtaining a second rectangle according to the coordinates of the center point and the coordinates of the fixed point; and zooming in and out the map according to the second rectangle. It can ensure that the position of the fixed point remains unchanged when the map is zoomed in and out, and solves the problem in the related art that the map needs to be moved to find the fixed point after zooming in and out once, which saves the time of users in zooming in and out of the map and improves the user's satisfaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, system, computer equipment and computer-readable storage medium for zooming in and out of a map. Background Art

[0002] When using a taxi app or searching for routes, all nearby drivers or routes are included in the map, and then the map is zoomed, and the user's point (any point) needs to be kept fixed. That is, the map is zoomed according to the longitude and latitude of a set of points and the longitude and latitude of a fixed point, so that all points are within the visible range and the fixed point position remains unchanged.

[0003] In the related art, there are two solutions to achieve the above purpose:

[0004] Solution 1: Zooming based on a set of points. After zooming based on this solution, the positions of the points on the map may shift, which means that it is impossible to achieve the purpose of keeping the position of a fixed point unchanged while zooming.

[0005] Solution 2: First zoom in and out based on a set of points, and then move the map after zooming. This solution returns the fixed points to their original positions, which can keep the fixed points unchanged. However, the map moves again after zooming, which results in a poor user experience. Summary of the invention

[0006] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.

[0007] Therefore, an object of the present invention is to provide a method for scaling a map.

[0008] Another object of the present invention is to provide a system for zooming in and out of a map.

[0009] Another object of the present invention is to provide a terminal.

[0010] Another object of the present invention is to provide a computer device.

[0011] Yet another object of the present invention is to provide a computer-readable storage medium.

[0012] In view of this, according to an object of the present invention, a method for zooming a map is proposed, which is used in a terminal. The method for zooming a map includes: obtaining the coordinates of a fixed point and all coordinates of a group of points on the map, the coordinates including latitude and longitude values; obtaining the coordinates of the center point of a first rectangle surrounding the group of points; determining a second rectangle based on the longitude difference and latitude difference corresponding to the coordinates of the center point and the coordinates of the fixed point; and zooming the map based on the second rectangle.

[0013] The method for zooming a map provided by the present invention determines a point where a user is located on the map as a fixed point, and takes the points within the zoom range of the user as a group of points, and simultaneously obtains the coordinates of all points marked by the fixed point and included in the group of points, forms a first rectangle according to the group of points, obtains the coordinates of the center point of the first rectangle, compares the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, obtains a second rectangle, the center point of the second rectangle is the fixed point, and determines the coordinates of the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value of the second rectangle, the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and zooms the map according to these two points. The present invention can ensure that the position of the fixed point (i.e. the point where the user is located) remains unchanged when zooming the map, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user in zooming the map, and improves the user's satisfaction.

[0014] The above-mentioned method for scaling a map according to the present invention may also have the following technical features:

[0015] In the above technical solution, preferably, the coordinates include latitude values ​​and longitude values, and the first rectangle includes a first diagonal point and a second diagonal point; the coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value among all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value among all coordinates; the center point of the first rectangle is the center point of the line connecting the first diagonal point and the second diagonal point.

[0016] In this technical solution, when the user zooms in and out on the map through gestures, a group of points will be obtained. The longitude and latitude values ​​of the coordinates of all points in the group of points are compared cyclically (the coordinates include longitude and latitude values). The first rectangle composed of the group of points is determined by the size of the longitude and latitude values ​​of the coordinates, and then the first diagonal point and the second diagonal point of the first rectangle are determined. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates. The midpoint of the diagonal line of the first diagonal point and the second diagonal point is the center point of the first rectangle. The determination of the center point of the first rectangle lays the foundation for achieving the purpose of ensuring that the position of the fixed point remains unchanged, and ensures that the user can directly see the fixed point after gesture zooming in and out at any position on the map without moving the map again, saving user operations.

[0017] In any of the above technical solutions, preferably, the step of determining the second rectangle based on the longitude difference and latitude difference corresponding to the center point coordinates and the fixed point coordinates specifically includes: calculating the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference; calculating the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference; calculating the third diagonal point and the fourth diagonal point based on the longitude difference and the latitude difference; and taking the rectangle with the third diagonal point as the coordinate point with the maximum latitude value and the maximum longitude value and the fourth diagonal point as the coordinate point with the minimum latitude value and the minimum longitude value as the second rectangle.

[0018] In this technical solution, the coordinates of the fixed point and the coordinates of the center point of the first rectangle are respectively calculated for the difference in longitude and latitude to obtain the longitude difference and latitude difference, and then the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle are calculated based on the two differences and the coordinates of the first diagonal point and the second diagonal point of the first rectangle. The third diagonal point is the coordinate point with the maximum latitude and the maximum longitude, and the fourth diagonal point is the coordinate point with the minimum latitude and the minimum longitude. The user's gesture zooming is performed according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, avoiding the problem of fixed point position change caused by zooming according to the original rectangle, so that the user can see the expected zooming effect by zooming the map once.

[0019] In any of the above technical solutions, preferably, the step of calculating the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference specifically includes: in response to the longitude difference being greater than zero, calculating the longitude value of the coordinates of the third diagonal point according to the first preset formula, and using the longitude value of the coordinates of the second diagonal point as the longitude value of the coordinates of the fourth diagonal point; in response to the latitude difference being greater than zero, calculating the latitude value of the coordinates of the third diagonal point according to the second preset formula, and using the latitude value of the coordinates of the second diagonal point as the latitude value of the coordinates of the fourth diagonal point; the first preset formula is LAN2=LAN1+2×DA, wherein LAN2 is the longitude value of the coordinates of the third diagonal point, LAN1 is the longitude value of the coordinates of the first diagonal point, and DA is the longitude difference; the second preset formula is LNN2=LNN1+2×DN, wherein LNN2 is the latitude value of the coordinates of the third diagonal point, LNN1 is the latitude value of the coordinates of the first diagonal point, and DN is the latitude difference.

[0020] In this technical solution, when the calculated longitude difference is greater than zero, the longitude value of the fixed point is greater than the longitude value of the center point of the first rectangle, indicating that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change, and may even not be displayed within the map display range. Therefore, the longitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the first preset formula, so that the longitude value of the coordinates of the third diagonal point is increased by twice the longitude difference on the basis of the longitude value of the coordinates of the first diagonal point of the first rectangle, and the longitude value of the coordinates of the second diagonal point of the first rectangle is used as the longitude value of the coordinates of the fourth diagonal point of the second rectangle. When the calculated latitude difference is greater than zero, the latitude value of the fixed point is greater than the latitude value of the center point of the first rectangle, which also means that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change, or even cannot be displayed within the map display range. Therefore, the latitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the second preset formula, and the latitude value of the coordinates of the second diagonal point of the first rectangle is used as the latitude of the coordinates of the fourth diagonal point of the second rectangle, so that the map is scaled according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, ensuring that the position of the fixed point remains unchanged.

[0021] In any of the above technical solutions, preferably, the step of calculating the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference also includes: in response to the longitude difference being not greater than zero, taking the longitude value of the first diagonal point coordinates as the longitude value of the third diagonal point coordinates, and calculating the longitude value of the fourth diagonal point coordinates according to a third preset formula; in response to the latitude difference being not greater than zero, taking the latitude value of the first diagonal point coordinates as the latitude value of the third diagonal point coordinates, and calculating the latitude value of the fourth diagonal point coordinates according to a fourth preset formula; the third preset formula is LAS2=LAS1-2×|DA|, wherein LAS2 is the longitude value of the fourth diagonal point coordinates, and LAS1 is the longitude value of the second diagonal point coordinates; the fourth preset formula is LNS2=LNS1-2×|DN|, wherein LNS2 is the latitude value of the fourth diagonal point coordinates, and LNS1 is the latitude value of the second diagonal point coordinates.

[0022] In this technical solution, when the longitude difference is less than zero, the longitude value of the fixed point is smaller than the longitude value of the center point of the first rectangle. If the map is scaled with the first rectangle, the position of the fixed point will definitely change. Therefore, the longitude value of the coordinates of the first diagonal point of the first rectangle is used as the longitude value of the coordinates of the third diagonal point of the second rectangle, and the longitude value of the coordinates of the fourth diagonal point of the second rectangle is calculated according to the third preset formula. When the latitude difference is not greater than zero, the latitude value of the fixed point is smaller than the latitude value of the center point of the first rectangle. The latitude value of the coordinates of the first diagonal point of the first rectangle is used as the latitude value of the coordinates of the third diagonal point of the second rectangle, and the latitude value of the coordinates of the fourth diagonal point of the second rectangle is calculated according to the fourth preset formula, so that the map is scaled according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, avoiding the change of the position of the fixed point and causing inconvenience to the user in using the map.

[0023] According to another object of the present invention, a system for zooming a map is proposed, which is used for a terminal and includes: a first acquisition unit, used to obtain the coordinates of a fixed point and all coordinates of a group of points on the map, the coordinates including latitude and longitude values; a second acquisition unit, used to obtain the coordinates of the center point of a first rectangle surrounding the group of points; a third acquisition unit, used to determine a second rectangle based on the longitude difference and latitude difference corresponding to the center point coordinates and the coordinates of the fixed points; and an execution unit, used to zoom the map based on the second rectangle.

[0024] The system for zooming a map provided by the present invention determines a point where a user is located on the map as a fixed point through a first acquisition unit, and takes the points within the zoom range of the user as a group of points, and simultaneously obtains the coordinates of all points marked by the fixed point and included in the group of points, forms a first rectangle according to the group of points, obtains the coordinates of the center point of the first rectangle through a second acquisition unit, compares the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, obtains a second rectangle through a third acquisition unit, the center point of the second rectangle is the fixed point, and determines the coordinates of the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value of the second rectangle, the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and the execution unit zooms the map according to the two points. The present invention can ensure that the position of the fixed point (i.e. the point where the user is located) remains unchanged when the map is zoomed, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user in zooming the map, and improves the user's satisfaction.

[0025] The system for scaling a map according to the present invention may also have the following technical features:

[0026] In the above technical solution, preferably, the coordinates include latitude values ​​and longitude values, and the first rectangle includes a first diagonal point and a second diagonal point; the coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value among all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value among all coordinates; the center point of the first rectangle is the center point of the line connecting the first diagonal point and the second diagonal point.

[0027] In this technical solution, when the user zooms in or out on the map through gestures or obtains a group of points, the second acquisition unit cyclically compares the latitude and longitude values ​​of the coordinates of all points in the group of points (the coordinates include longitude and latitude values), and determines the first rectangle composed of the group of points through the size of the longitude and longitude values ​​of the coordinates, and then determines the first diagonal point and the second diagonal point of the first rectangle. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates. The midpoint of the diagonal line of the first diagonal point and the second diagonal point is the center point of the first rectangle. The determination of the center point of the first rectangle lays the foundation for achieving the purpose of ensuring that the position of the fixed point remains unchanged, and ensures that the user can directly see the fixed point after gesture zooming in and out at any position on the map without moving the map again, saving user operations.

[0028] In any of the above technical solutions, preferably, the third acquisition unit includes: a first calculation unit, used to calculate the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference; calculate the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference; a second calculation unit, used to calculate the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference; and use the rectangle with the third diagonal point as the coordinate point with the maximum latitude value and the maximum longitude value and the fourth diagonal point as the coordinate point with the minimum latitude value and the minimum longitude value as the second rectangle.

[0029] In this technical solution, the first calculation unit calculates the difference in longitude and latitude between the coordinates of the fixed point and the coordinates of the center point of the first rectangle, respectively, to obtain the longitude difference and latitude difference, and then the second calculation unit calculates the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle according to the two differences and the coordinates of the first diagonal point and the second diagonal point of the first rectangle. The third diagonal point is the coordinate point with the maximum latitude and the maximum longitude, and the fourth diagonal point is the coordinate point with the minimum latitude and the minimum longitude, so that the user's gesture zooming is performed according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, avoiding the problem of fixed point position change caused by zooming according to the original rectangle, so that the user can see the expected zooming effect by zooming the map once.

[0030] In any of the above technical solutions, preferably, the second calculation unit includes: a second calculation unit, specifically used to calculate the longitude value of the third diagonal point coordinates according to the first preset formula in response to the longitude difference being greater than zero, and use the longitude value of the second diagonal point coordinates as the longitude value of the fourth diagonal point coordinates; the second calculation unit is also used to calculate the latitude value of the third diagonal point coordinates according to the second preset formula in response to the latitude difference being greater than zero, and use the latitude value of the second diagonal point coordinates as the latitude value of the fourth diagonal point coordinates; the first preset formula is LAN2=LAN1+2×DA, wherein LAN2 is the longitude value of the third diagonal point coordinates, LAN1 is the longitude value of the first diagonal point coordinates, and DA is the longitude difference; the second preset formula is LNN2=LNN1+2×DN, wherein LNN2 is the latitude value of the third diagonal point coordinates, LNN1 is the latitude value of the first diagonal point coordinates, and DN is the latitude difference.

[0031] In this technical solution, when the calculated longitude difference is greater than zero, the longitude value of the fixed point is greater than the longitude value of the center point of the first rectangle, indicating that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change, and may even not be displayed within the map display range. Therefore, the longitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the first preset formula, so that the longitude value of the coordinates of the third diagonal point is increased by twice the longitude difference on the basis of the longitude value of the coordinates of the first diagonal point of the first rectangle, and the longitude value of the coordinates of the second diagonal point of the first rectangle is used as the longitude value of the coordinates of the fourth diagonal point of the second rectangle. When the calculated latitude difference is greater than zero, the latitude value of the fixed point is greater than the latitude value of the center point of the first rectangle, which also means that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change, or even cannot be displayed within the map display range. Therefore, the latitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the second preset formula, and the latitude value of the coordinates of the second diagonal point of the first rectangle is used as the latitude of the coordinates of the fourth diagonal point of the second rectangle, so that the map is scaled according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, ensuring that the position of the fixed point remains unchanged.

[0032] In any of the above technical solutions, preferably, the second calculation unit is also used to, in response to the longitude difference being not greater than zero, use the longitude value of the first diagonal point coordinates as the longitude value of the third diagonal point coordinates, and calculate the longitude value of the fourth diagonal point coordinates according to a third preset formula; the second calculation unit is also used to, in response to the latitude difference being not greater than zero, use the latitude value of the first diagonal point coordinates as the latitude value of the third diagonal point coordinates, and calculate the latitude value of the fourth diagonal point coordinates according to a fourth preset formula; the third preset formula is LAS2=LAS1-2×|DA|, wherein LAS2 is the longitude value of the fourth diagonal point coordinates, and LAS1 is the longitude of the second diagonal point coordinates; the fourth preset formula is LNS2=LNS1-2×|DN|, wherein LNS2 is the latitude value of the fourth diagonal point coordinates, and LNS1 is the latitude value of the second diagonal point coordinates.

[0033] In this technical solution, when the longitude difference is less than zero, the longitude value of the fixed point is smaller than the longitude value of the center point of the first rectangle. If the map is scaled with the first rectangle, the position of the fixed point will definitely change. Therefore, the longitude value of the coordinates of the first diagonal point of the first rectangle is used as the longitude value of the coordinates of the third diagonal point of the second rectangle, and the longitude value of the coordinates of the fourth diagonal point of the second rectangle is calculated according to the third preset formula. When the latitude difference is not greater than zero, the latitude value of the fixed point is smaller than the latitude value of the center point of the first rectangle. The latitude value of the coordinates of the first diagonal point of the first rectangle is used as the latitude value of the coordinates of the third diagonal point of the second rectangle, and the latitude value of the coordinates of the fourth diagonal point of the second rectangle is calculated according to the fourth preset formula, so that the map is scaled according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, avoiding the change of the position of the fixed point and causing inconvenience to the user in using the map.

[0034] According to another object of the present invention, a terminal is provided, comprising any one of the above-mentioned systems for zooming in and out of a map.

[0035] The terminal provided by the present invention, by adopting the system for zooming in and out of a map as described in any of the above technical solutions, has all the beneficial effects of the system for zooming in and out of a map, which will not be described in detail here.

[0036] According to another object of the present invention, a computer device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for zooming a map as described in any one of the above items are implemented.

[0037] The computer device provided by the present invention can determine a point where a user is located on a map as a fixed point when the processor executes a computer program, and take the points within the user's zoom range as a group of points, and simultaneously obtain the coordinates of all points marked by the fixed point and included in the group of points, form a first rectangle according to the group of points, obtain the coordinates of the center point of the first rectangle, compare the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, obtain a second rectangle, the center point of the second rectangle is the fixed point, and determine the coordinates of the point with the maximum latitude value and the maximum longitude value of the second rectangle and the point with the minimum latitude value and the minimum longitude value, and the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value is the position point of the user's finger when zooming the map, and zoom the map according to these two points. The present invention can ensure that the position of the fixed point (i.e. the point where the user is located) remains unchanged when zooming the map, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user in zooming the map, and improves the user's satisfaction.

[0038] According to another object of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for zooming a map as described above are implemented.

[0039] The computer-readable storage medium provided by the present invention can be used to determine a point where a user is located on a map as a fixed point when the computer program is executed by a processor, and to take the points within the user's zoom range as a group of points, and to obtain the coordinates of all points marked by the fixed point and included in the group of points at the same time, to form a first rectangle according to the group of points, to obtain the coordinates of the center point of the first rectangle, to compare the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, to obtain a second rectangle, the center point of the second rectangle being the fixed point, and to determine the coordinates of the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value of the second rectangle, the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and to zoom the map according to the two points. The present invention can ensure that the position of the fixed point (i.e., the point where the user is located) remains unchanged when zooming the map, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user in zooming the map, and improves the user's satisfaction.

[0040] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0042] Figure 1 A schematic flow chart of a method for zooming a map in a terminal according to an embodiment of the present invention is shown;

[0043] Figure 2 A schematic flow chart showing a method for zooming a map in a terminal according to another embodiment of the present invention is shown;

[0044] Figure 3 A schematic flow chart showing a method for zooming a map in a terminal according to another embodiment of the present invention is shown;

[0045] Figure 4 A schematic flow chart showing a method for zooming a map in a terminal according to another embodiment of the present invention is shown;

[0046] Figure 5 A schematic block diagram of a system for zooming a map in a terminal according to an embodiment of the present invention is shown;

[0047] Figure 6 A schematic block diagram of a system for zooming a map in a terminal according to another embodiment of the present invention is shown;

[0048] Figure 7 A schematic block diagram of a system for zooming a map in a terminal according to another embodiment of the present invention is shown;

[0049] Figure 8 A schematic block diagram of a computer device according to an embodiment of the present invention is shown;

[0050] Fig. 9 A schematic block diagram of a terminal with map-related application software according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0051] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0053] The embodiment of the first aspect of the present invention provides a method for scaling a map, which is used in a terminal. Figure 1 A schematic flow chart of a method for zooming a map in a terminal according to an embodiment of the present invention is shown. The method includes:

[0054] Step 102, obtaining the coordinates of a fixed point and all coordinates of a group of points on the map;

[0055] Step 104, obtaining the coordinates of the center point of a first rectangle surrounding a group of points;

[0056] Step 106, obtaining a second rectangle according to the coordinates of the center point and the coordinates of the fixed point;

[0057] Step 108: scaling the map according to the second rectangle.

[0058] The method for zooming a map provided by the present invention determines a point where a user is located on the map as a fixed point, and takes the points within the zoom range of the user as a group of points, and simultaneously obtains the coordinates of all points marked by the fixed point and included in the group of points, forms a first rectangle according to the group of points, obtains the coordinates of the center point of the first rectangle, compares the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, obtains a second rectangle, the center point of the second rectangle is the fixed point, and determines the coordinates of the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value of the second rectangle, the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and zooms the map according to these two points. The present invention can ensure that the position of the fixed point (i.e. the point where the user is located) remains unchanged when zooming the map, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user in zooming the map, and improves the user's satisfaction.

[0059] Figure 2 A schematic flow chart of a method for zooming a map in a terminal according to another embodiment of the present invention is shown. The method includes:

[0060] Step 202, obtaining the coordinates of a fixed point and all coordinates of a group of points on the map;

[0061] Step 204, comparing the coordinates of all points in a group of points to obtain the coordinates of the first diagonal points and the second diagonal points of a first rectangle formed by the group of points;

[0062] Step 206, taking the center point of the line connecting the first diagonal point and the second diagonal point as the center point coordinates of the first rectangle;

[0063] Step 208, obtaining a second rectangle according to the coordinates of the center point and the coordinates of the fixed point;

[0064] Step 210: scaling the map according to the second rectangle.

[0065] Among them, the coordinates include latitude values ​​and longitude values, and the first rectangle includes a first diagonal point and a second diagonal point; the coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates; the center point of the first rectangle is the center point of the line connecting the first diagonal point and the second diagonal point.

[0066] In this embodiment, a point where a user is located is determined on the map as a fixed point, and the points within the user's zoom range are taken as a group of points. At the same time, the coordinates of all points marked by the fixed point and included in the group of points are obtained, and the longitude and latitude values ​​of the coordinates of all points in the group of points are cyclically compared (the coordinates include longitude and latitude values). The first rectangle composed of a group of points is determined by the size of the longitude and latitude values ​​of the coordinates, and then the first diagonal point and the second diagonal point of the first rectangle are determined. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates. The midpoint of the diagonal line of the first diagonal point and the second diagonal point is the center point of the first rectangle. The determination of the first center point lays the foundation for achieving the purpose of ensuring that the position of the fixed point remains unchanged, and ensures that the user can directly see the fixed point after gesture zooming at any position on the map without moving the map again, saving user operations.

[0067] Figure 3 A schematic flow chart of a method for zooming a map in a terminal according to another embodiment of the present invention is shown. The method includes:

[0068] Step 302, obtaining the coordinates of a fixed point and all coordinates of a group of points on the map;

[0069] Step 304, compare the coordinates of all points in a group of points to obtain the coordinates of the first diagonal points and the second diagonal points of the first rectangle formed by the group of points;

[0070] Step 306, taking the center point of the line connecting the first diagonal point and the second diagonal point as the center point coordinates of the first rectangle;

[0071] Step 308, calculating the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference;

[0072] Step 310, calculating the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference;

[0073] Step 312, calculating the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference; taking the rectangle with the third diagonal point as the coordinate point of the maximum latitude value and the maximum longitude value and the fourth diagonal point as the coordinate point of the minimum latitude value and the minimum longitude value as the second rectangle;

[0074] Step 314: scaling the map according to the second rectangle.

[0075] In this embodiment, a point where a user is located is determined on the map as a fixed point, and the points within the user's zoom range are taken as a group of points. At the same time, the coordinates of all points marked by the fixed point and included in the group of points are obtained, and the longitude and latitude values ​​of the coordinates of all points in the group of points are cyclically compared (the coordinates include longitude and latitude values). The first rectangle composed of a group of points is determined by the size of the longitude and latitude values ​​of the coordinates, and then the first diagonal point and the second diagonal point of the first rectangle are determined. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates. The midpoint of the diagonal line between the first diagonal point and the second diagonal point is the center of the first rectangle. Point, the coordinates of the fixed point and the coordinates of the center point of the first rectangle are respectively calculated for the difference in longitude and latitude to obtain the longitude difference and latitude difference, and then the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle are calculated according to the two differences and the coordinates of the first diagonal point and the second diagonal point of the first rectangle, the third diagonal point is the coordinate point with the maximum latitude and the maximum longitude, and the fourth diagonal point is the coordinate point with the minimum latitude and the minimum longitude, so that the user's gesture zooming is performed according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, avoiding the problem of fixed point position change caused by zooming according to the original rectangle, so that the user can see the expected zooming effect by zooming the map once.

[0076] Figure 4 A schematic flow chart of a method for zooming a map in a terminal according to another embodiment of the present invention is shown. The method includes:

[0077] Step 402, obtaining the coordinates of a fixed point and all coordinates of a group of points on the map;

[0078] Step 404, compare the coordinates of all points in a group of points to obtain the coordinates of the first diagonal points and the second diagonal points of the first rectangle formed by the group of points;

[0079] Step 406, taking the center point of the line connecting the first diagonal point and the second diagonal point as the center point coordinates of the first rectangle;

[0080] Step 408, calculating the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference;

[0081] Step 410, calculating the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference;

[0082] Step 412, determining whether the longitude difference is greater than zero;

[0083] Step 414, when the longitude difference is greater than zero, the longitude value of the third diagonal point coordinates is calculated according to the first preset formula, and the longitude value of the second diagonal point coordinates is used as the longitude value of the fourth diagonal point coordinates;

[0084] Step 416, determining whether the latitude difference is greater than zero;

[0085] Step 418, when the latitude difference is greater than zero, the latitude value of the coordinates of the third diagonal point is calculated according to the second preset formula, and the latitude value of the coordinates of the second diagonal point is used as the latitude value of the coordinates of the fourth diagonal point;

[0086] Step 420, when the longitude difference is not greater than zero, the longitude value of the first diagonal point coordinate is used as the longitude value of the third diagonal point coordinate, and the longitude value of the fourth diagonal point coordinate is calculated according to the third preset formula;

[0087] Step 422, when the latitude difference is not greater than zero, taking the latitude value of the first diagonal point coordinates as the latitude value of the third diagonal point coordinates, and calculating the latitude value of the fourth diagonal point coordinates according to a fourth preset formula;

[0088] Step 424, scaling the map according to the second rectangle.

[0089] In this embodiment, a point where a user is located is determined on the map as a fixed point, and the points within the user's zoom range are taken as a group of points. At the same time, the coordinates of all points marked by the fixed point and included in the group of points are obtained, and the longitude and latitude values ​​of the coordinates of all points in the group of points are cyclically compared (the coordinates include longitude and latitude values). The first rectangle composed of a group of points is determined by the size of the longitude and latitude values ​​of the coordinates, and then the first diagonal point and the second diagonal point of the first rectangle are determined. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates. The midpoint of the diagonal line of the first diagonal point and the second diagonal point is the center point of the first rectangle. The coordinates of the fixed point are compared with The coordinates of the center point of the first rectangle are obtained by calculating the difference between the longitude and latitude values ​​to obtain the longitude difference and latitude difference. When the calculated longitude difference is greater than zero, the longitude value of the fixed point is greater than the longitude value of the center point of the first rectangle, indicating that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change and may even not be displayed within the map display range. Therefore, the longitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the first preset formula, so that the longitude value of the coordinates of the third diagonal point is increased by twice the longitude difference on the basis of the longitude value of the coordinates of the first diagonal point of the first rectangle, and the longitude value of the coordinates of the second diagonal point of the first rectangle is used as the longitude value of the coordinates of the fourth diagonal point of the second rectangle. When the calculated latitude difference is greater than zero, the latitude value of the fixed point is greater than the latitude value of the center point of the first rectangle, which also means that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change, or even cannot be displayed within the map display range. Therefore, the latitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the second preset formula, and the latitude value of the coordinates of the second diagonal point of the first rectangle is used as the latitude of the coordinates of the fourth diagonal point of the second rectangle, so that the map is scaled according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, ensuring that the position of the fixed point remains unchanged.

[0090] In this embodiment, when the longitude difference is less than zero, the longitude value of the fixed point is smaller than the longitude value of the center point of the first rectangle. If the map is scaled with the first rectangle, the position of the fixed point will definitely change. Therefore, the longitude value of the first diagonal point coordinates of the first rectangle is used as the longitude value of the third diagonal point coordinates of the second rectangle, and the longitude value of the fourth diagonal point coordinates of the second rectangle is calculated according to the third preset formula. When the latitude difference is not greater than zero, the latitude value of the fixed point is smaller than the latitude value of the center point of the first rectangle. The latitude value of the first diagonal point coordinates of the first rectangle is used as the latitude value of the third diagonal point coordinates of the second rectangle, and the latitude value of the fourth diagonal point coordinates of the second rectangle is calculated according to the fourth preset formula, so that the map is scaled according to the third diagonal point coordinates and the fourth diagonal point coordinates of the second rectangle, avoiding the change of the position of the fixed point and causing inconvenience to the user in using the map.

[0091] Among them, the first preset formula is LAN2=LAN1+2×DA, where LAN2 is the longitude value of the third diagonal point coordinates, LAN1 is the longitude value of the first diagonal point coordinates, and DA is the longitude difference; the second preset formula is LNN2=LNN1+2×DN, where LNN2 is the latitude value of the third diagonal point coordinates, LNN1 is the latitude value of the first diagonal point coordinates, and DN is the latitude difference. The third preset formula is LAS2=LAS1-2×|DA|, where LAS2 is the longitude value of the fourth diagonal point coordinates, and LAS1 is the longitude value of the second diagonal point coordinates; the fourth preset formula is LNS2=LNS1-2×|DN|, where LNS2 is the latitude value of the fourth diagonal point coordinates, and LNS1 is the latitude value of the second diagonal point coordinates. .

[0092] The embodiment of the second aspect of the present invention provides a system for zooming a map, which is used in a terminal. Figure 5 A schematic block diagram of a system 500 for zooming a map in a terminal according to an embodiment of the present invention is shown. The system includes:

[0093] A first acquisition unit 502 is used to acquire the coordinates of a fixed point and all coordinates of a group of points on the map;

[0094] A second acquisition unit 504 is used to acquire the coordinates of the center point of a first rectangle surrounding a group of points;

[0095] A third acquisition unit 506 is used to acquire a second rectangle according to the coordinates of the center point and the coordinates of the fixed point;

[0096] The execution unit 508 is configured to scale the map according to the second rectangle.

[0097] The system 500 for zooming a map provided by the present invention determines a point where a user is located on the map as a fixed point through a first acquisition unit 502, and takes the points within the zoom range of the user as a group of points, and simultaneously obtains the coordinates of all points marked by the fixed point and included in the group of points, forms a first rectangle according to the group of points, obtains the coordinates of the center point of the first rectangle through a second acquisition unit, compares the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, obtains a second rectangle through a third acquisition unit, the center point of the second rectangle is the fixed point, and determines the coordinates of the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value of the second rectangle, the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and the execution unit zooms the map according to the two points. The present invention can ensure that the position of the fixed point (i.e. the point where the user is located) remains unchanged when zooming the map, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user in zooming the map, and improves the user's satisfaction.

[0098] In one embodiment of the present invention, preferably, the coordinates include latitude values ​​and longitude values, and the first rectangle includes a first diagonal point and a second diagonal point; the coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates; the center point of the first rectangle is the center point of the line connecting the first diagonal point and the second diagonal point.

[0099] In this embodiment, when the user zooms in or out on the map through gestures or obtains a group of points, the second acquisition unit cyclically compares the latitude and longitude values ​​of the coordinates of all points in the group of points (the coordinates include longitude and latitude values), and determines the first rectangle composed of the group of points through the size of the longitude and longitude values ​​of the coordinates, and then determines the first diagonal point and the second diagonal point of the first rectangle. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates, and the coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates. The midpoint of the diagonal line of the first diagonal point and the second diagonal point is the center point of the first rectangle. The determination of the center point of the first rectangle lays the foundation for achieving the purpose of ensuring that the position of the fixed point remains unchanged, and ensures that the user can directly see the fixed point after gesture zooming in and out at any position on the map without moving the map again, saving user operations.

[0100] Figure 6 A schematic block diagram of a system 600 for zooming a map in a terminal according to another embodiment of the present invention is shown. The system includes:

[0101] A first acquisition unit 602 is used to acquire the coordinates of a fixed point and all coordinates of a group of points on the map;

[0102] A second acquisition unit 604 is used to acquire the coordinates of the center point of a first rectangle surrounding a group of points;

[0103] A third acquisition unit 606 is used to acquire a second rectangle according to the coordinates of the center point and the coordinates of the fixed point;

[0104] An execution unit 608 is used to scale the map according to the second rectangle;

[0105] The third acquisition unit 606 includes:

[0106] The first calculation unit 662 is used to calculate the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference; calculate the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference;

[0107] The second calculation unit 664 is used to calculate the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference; and use the rectangle with the third diagonal point as the coordinate point of the maximum latitude value and the maximum longitude value and the fourth diagonal point as the coordinate point of the minimum latitude value and the minimum longitude value as the second rectangle.

[0108] In this embodiment, the first calculation unit 662 calculates the difference in longitude and latitude between the coordinates of the fixed point and the coordinates of the center point of the first rectangle to obtain the longitude difference and latitude difference, and then the second calculation unit 664 calculates the third diagonal point coordinates and the fourth diagonal point coordinates of the second rectangle based on the two differences and the first diagonal point coordinates and the second diagonal point coordinates of the first rectangle. The third diagonal point is the coordinate point with the maximum latitude and the maximum longitude, and the fourth diagonal point is the coordinate point with the minimum latitude and the minimum longitude, so that the user's gesture zooming is performed according to the third diagonal point coordinates and the fourth diagonal point coordinates of the second rectangle, avoiding the problem of fixed point position change caused by zooming according to the original rectangle, so that the user can see the expected zooming effect by zooming the map once.

[0109] Figure 7 A schematic block diagram of a system 700 for zooming a map in a terminal according to another embodiment of the present invention is shown. The system includes:

[0110] A first acquisition unit 702 is used to acquire the coordinates of a fixed point and all coordinates of a group of points on the map;

[0111] A second acquisition unit 704 is used to acquire the coordinates of the center point of a first rectangle surrounding a group of points;

[0112] A third acquisition unit 706 is used to acquire a second rectangle according to the coordinates of the center point and the coordinates of the fixed point;

[0113] An execution unit 708, configured to scale the map according to the second rectangle;

[0114] The third acquisition unit 706 includes:

[0115] The first calculation unit 762 is used to calculate the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference; calculate the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference;

[0116] The second calculation unit 764 is used to calculate the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference; and use the rectangle with the third diagonal point as the coordinate point of the maximum latitude value and the maximum longitude value and the fourth diagonal point as the coordinate point of the minimum latitude value and the minimum longitude value as the second rectangle.

[0117] The second calculation unit 764 includes: the second calculation unit 764 is specifically configured to calculate the longitude value of the third diagonal point coordinates according to the first preset formula in response to the longitude difference being greater than zero, and use the longitude value of the second diagonal point coordinates as the longitude value of the fourth diagonal point coordinates;

[0118] The second calculating unit 764 is further configured to calculate the latitude value of the coordinates of the third diagonal point according to a second preset formula in response to the latitude difference being greater than zero, and use the latitude value of the coordinates of the second diagonal point as the latitude value of the coordinates of the fourth diagonal point;

[0119] The first preset formula is LAN2=LAN1+2×DA, wherein LAN2 is the longitude value of the coordinates of the third diagonal point, LAN1 is the longitude value of the coordinates of the first diagonal point, and DA is the longitude difference; the second preset formula is LNN2=LNN1+2×DN, wherein LNN2 is the latitude value of the coordinates of the third diagonal point, LNN1 is the latitude value of the coordinates of the first diagonal point, and DN is the latitude difference.

[0120] In this embodiment, when the calculated longitude difference is greater than zero, the longitude value of the fixed point is greater than the longitude value of the center point of the first rectangle, indicating that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change and may even not be displayed within the map display range. Therefore, the longitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the first preset formula, so that the longitude value of the coordinates of the third diagonal point is increased by twice the longitude difference on the basis of the longitude value of the coordinates of the first diagonal point of the first rectangle, and the longitude value of the coordinates of the second diagonal point of the first rectangle is used as the longitude value of the coordinates of the fourth diagonal point of the second rectangle. When the calculated latitude difference is greater than zero, the latitude value of the fixed point is greater than the latitude value of the center point of the first rectangle, which also means that if the map is scaled according to the first diagonal point and the second diagonal point of the first rectangle, the position of the fixed point will change, or even cannot be displayed within the map display range. Therefore, the latitude value of the coordinates of the third diagonal point of the second rectangle is calculated according to the second preset formula, and the latitude value of the coordinates of the second diagonal point of the first rectangle is used as the latitude of the coordinates of the fourth diagonal point of the second rectangle, so that the map is scaled according to the coordinates of the third diagonal point and the fourth diagonal point of the second rectangle, ensuring that the position of the fixed point remains unchanged.

[0121] In one embodiment of the present invention, preferably, the second calculation unit 764 is also used to, in response to the longitude difference being not greater than zero, use the longitude value of the first diagonal point coordinates as the longitude value of the third diagonal point coordinates, and calculate the longitude value of the fourth diagonal point coordinates according to a third preset formula; the second calculation unit 764 is also used to, in response to the latitude difference being not greater than zero, use the latitude value of the first diagonal point coordinates as the latitude value of the third diagonal point coordinates, and calculate the latitude value of the fourth diagonal point coordinates according to a fourth preset formula; the third preset formula is LAS2=LAS1-2×|DA|, wherein LAS2 is the longitude value of the fourth diagonal point coordinates, and LAS1 is the longitude value of the second diagonal point coordinates; the fourth preset formula is LNS2=LNS1-2×|DN|, wherein LNS2 is the latitude value of the fourth diagonal point coordinates, and LNS1 is the latitude value of the second diagonal point coordinates.

[0122] In this embodiment, when the longitude difference is less than zero, the longitude value of the fixed point is smaller than the longitude value of the center point of the first rectangle. If the map is scaled with the first rectangle, the position of the fixed point will definitely change. Therefore, the longitude value of the first diagonal point coordinates of the first rectangle is used as the longitude value of the third diagonal point coordinates of the second rectangle, and the longitude value of the fourth diagonal point coordinates of the second rectangle is calculated according to the third preset formula. When the latitude difference is not greater than zero, the latitude value of the fixed point is smaller than the latitude value of the center point of the first rectangle. The latitude value of the first diagonal point coordinates of the first rectangle is used as the latitude value of the third diagonal point coordinates of the second rectangle, and the latitude value of the fourth diagonal point coordinates of the second rectangle is calculated according to the fourth preset formula, so that the map is scaled according to the third diagonal point coordinates and the fourth diagonal point coordinates of the second rectangle, avoiding the change of the position of the fixed point and causing inconvenience to the user in using the map.

[0123] An embodiment of the third aspect of the present invention provides a terminal, comprising any of the above-mentioned systems for zooming in and out of a map.

[0124] The terminal provided by the present invention, by adopting the system for zooming in and out of a map as described in any of the above technical solutions, has all the beneficial effects of the system for zooming in and out of a map, which will not be described in detail here.

[0125] According to a fourth aspect of the present invention, a computer device is provided. Figure 8 A schematic block diagram of a computer device 800 according to an embodiment of the present invention is shown. The computer device 800 includes:

[0126] The memory 802, the processor 804 and the computer program stored in the memory 802 and executable on the processor 804, when the processor 804 executes the computer program, the steps of the method for zooming a map as described above are implemented.

[0127] The computer device 800 provided by the present invention, when the processor 804 executes the computer program, can determine a point where a user is located on the map as a fixed point, and take the points within the user's zoom range as a group of points, and at the same time obtain the coordinates of all points marked by the fixed point and included in the group of points, form a first rectangle according to the group of points, obtain the coordinates of the center point of the first rectangle, compare the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, obtain a second rectangle, the center point of the second rectangle is the fixed point, and determine the coordinates of the point with the maximum latitude value and the maximum longitude value of the second rectangle and the point with the minimum latitude value and the minimum longitude value, the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and zoom the map according to these two points. The present invention can ensure that the position of the fixed point (i.e. the point where the user is located) remains unchanged when zooming the map, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user zooming the map, and improves the user's satisfaction.

[0128] An embodiment of the fifth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for zooming a map as described in any one of the above items are implemented.

[0129] The computer-readable storage medium provided by the present invention can be used to determine a point where a user is located on a map as a fixed point when the computer program is executed by a processor, and to take the points within the user's zoom range as a group of points, and to obtain the coordinates of all points marked by the fixed point and included in the group of points at the same time, to form a first rectangle according to the group of points, to obtain the coordinates of the center point of the first rectangle, to compare the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point, to obtain a second rectangle, the center point of the second rectangle being the fixed point, and to determine the coordinates of the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value of the second rectangle, the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and to zoom the map according to the two points. The present invention can ensure that the position of the fixed point (i.e., the point where the user is located) remains unchanged when zooming the map, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user in zooming the map, and improves the user's satisfaction.

[0130] The sixth aspect of the present invention provides a terminal having map-related application software. Fig. 9 A schematic block diagram of a terminal 900 having map-related application software according to an embodiment of the present invention is shown. The terminal includes:

[0131] 902 memory, processor 904, wherein the processor 904 is used to execute the steps of any of the above-mentioned methods for zooming a map by calling the operation instructions stored in the memory 902.

[0132] The terminal 900 with map-related application software provided by the present invention, the processor 904 is used to execute the determination of a point where a user is located on the map as a fixed point by calling the operation instructions stored in the memory, and the points within the user's zooming range are taken as a group of points, and the coordinates of all points marked by the fixed point and included in the group of points are obtained at the same time, a first rectangle is formed according to the group of points, the coordinates of the center point of the first rectangle are obtained, the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point are compared, and a second rectangle is obtained, the center point of the second rectangle is the fixed point, and the coordinates of the point with the maximum latitude value and the maximum longitude value of the second rectangle and the point with the minimum latitude value and the minimum longitude value are determined, and the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value are the position points of the user's finger when zooming the map, and the map is zoomed according to these two points. The present invention can ensure that the position of the fixed point (i.e. the point where the user is located) remains unchanged when the map is zoomed, and well solves the problem in the related art that the map needs to be moved to find the fixed point after zooming the map once, saves the time of the user to zoom the map, and improves the user's satisfaction.

[0133] In a method for scaling based on a group of points and a fixed point in a specific embodiment of the present invention, there is a group of points P1 (lat1, lng1), P2 (lat2, lng2), P3 (lat3, lng3)...Pn (latn, lngn) and a fixed point P0 (lat0, lnt0), where lat and lng represent latitude and longitude, respectively.

[0134] The first step is to loop P1 (lat1, lng1), P2 (lat2, lng2) ... Pn (latn, lngn) to compare the longitude and latitude, and get the longitude and latitude of the northeasternmost point Pne1 (lat-ne1, lng-ne1) and the southwesternmost point Psw1 (lat-sw1, lng-sw1) of the rectangle Rect1 they enclose:

[0135] lat-ne1=Max(lat1, lat2...latn);

[0136] lng-ne1=Max(lng1, lng2...lngn);

[0137] lat-sw1=Min(lat1, lat2...latn);

[0138] lng-sw1=Min(lng1, lng2...lngn).

[0139] The second step is to obtain the center point Pc (lat-c, lng-c) of the line connecting the northeasternmost point Pne1 (lat-ne1, lng-ne1) and the southwesternmost point Psw1 (lat-sw1, lng-sw1):

[0140] lat-c=(lat-ne1+lat-sw1) / 2;

[0141] lng-c=(lng-ne1+lng-sw1) / 2.

[0142] The third step is to compare the latitude and longitude difference between the fixed point P0 (lat0, lnt0) and the obtained center point Pc (lat-c, lng-c):

[0143] Longitude difference Dlat = lat0 – lat-c;

[0144] Latitude difference Dlng=lng0–lng-c.

[0145] The fourth step is to obtain the latitude and longitude of the northeasternmost point Pne2 (lat-ne2, lng-ne2) and the southwesternmost point Psw2 (lat-sw2, lng-sw2) of the latest rectangle Rect2:

[0146] If Dlat>0, lat-ne2=lat-ne1+2×Dlat, otherwise lat-ne2=lat-ne1;

[0147] If Dlat>0, lat-sw2=lat-sw1, otherwise lat-sw2=lat-sw1-2×|Dlat|;

[0148] If Dlng>0, lng-ne2=lng-ne1+2×Dlng, otherwise lng-ne2=lng-ne1;

[0149] If Dlng>0, lng-sw2=lng-sw1, otherwise lng-sw2=lng-sw1-2×|Dlng|.

[0150] The fifth step is to scale the map based on the northeasternmost point Pne2 (lat-ne2, lng-ne2) and the southwesternmost point Psw2 (lat-sw2, lng-sw2) of the latest rectangle Rect2.

[0151] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0152] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for scaling a map, characterized in that: The method for scaling the map includes: Determine the point where the user is located on the map displayed on the terminal as a fixed point coordinate; In response to obtaining a zoom gesture, taking points within a zoom range performed by the user as a group of points; Determine the center point coordinates of a first rectangle surrounding the group of points as the center point coordinates corresponding to the zoom gesture; Compare the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point to obtain a second rectangle, wherein the center of the second rectangle is the fixed point; Zooming the map by taking the point with the maximum latitude and the maximum longitude and the point with the minimum latitude and the minimum longitude in the second rectangle as the position point of the finger; Wherein, comparing the positional relationship between the center point coordinates of the first rectangle and the fixed point coordinates to obtain the second rectangle includes: A second rectangle is determined according to the longitude difference and latitude difference corresponding to the coordinates of the center point and the coordinates of the fixed point.

2. The method according to claim 1, characterized in that The coordinates include latitude and longitude values; The first rectangle includes a first diagonal point and a second diagonal point. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all coordinates in the first rectangle. The coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all coordinates. The center point of the first rectangle is the center point of the line connecting the first diagonal point and the second diagonal point.

3. The method according to claim 1, characterized in that Determining the second rectangle according to the longitude difference and latitude difference corresponding to the coordinates of the center point and the coordinates of the fixed point includes: Determine a third diagonal point and a fourth diagonal point according to the longitude difference and latitude difference corresponding to the coordinates of the center point and the coordinates of the fixed point; A second rectangle is determined according to the third diagonal point and the fourth diagonal point.

4. The method according to claim 3, characterized in that Determining the third diagonal point and the fourth diagonal point according to the longitude difference and latitude difference corresponding to the coordinates of the center point and the coordinates of the fixed point includes: Calculate the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference; Calculate the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference; The third diagonal point and the fourth diagonal point are calculated according to the longitude difference and the latitude difference.

5. The method according to claim 3, characterized in that: Determining the second rectangle according to the third diagonal point and the fourth diagonal point specifically includes: A rectangle with the third diagonal point as the coordinate point of the maximum latitude and the maximum longitude and the fourth diagonal point as the coordinate point of the minimum latitude and the minimum longitude is used as the second rectangle.

6. The method according to claim 4, characterized in that The step of calculating the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference specifically includes: In response to the longitude difference being greater than zero, calculating the longitude value of the third diagonal point coordinates according to a first preset formula, and using the longitude value of the second diagonal point coordinates of the first rectangle as the longitude value of the fourth diagonal point coordinates; In response to the latitude difference being greater than zero, calculating the latitude value of the coordinates of the third diagonal point according to a second preset formula, and using the latitude value of the coordinates of the second diagonal point as the latitude value of the coordinates of the fourth diagonal point; The first preset formula is: ,in, is the longitude value of the coordinates of the third diagonal point, is the longitude value of the coordinates of the first diagonal point of the first rectangle, is the longitude difference; The second preset formula is: ,in, is the latitude value of the coordinates of the third diagonal point, is the latitude value of the coordinates of the first diagonal point, is the latitude difference.

7. The method according to claim 6, characterized in that The step of calculating the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference further includes: In response to the longitude difference being not greater than zero, taking the longitude value of the first diagonal point coordinates as the longitude value of the third diagonal point coordinates, and calculating the longitude value of the fourth diagonal point coordinates according to a third preset formula; In response to the latitude difference being not greater than zero, taking the latitude value of the first diagonal point coordinates as the latitude value of the third diagonal point coordinates, and calculating the latitude value of the fourth diagonal point coordinates according to a fourth preset formula; The third preset formula is: ,in, is the longitude value of the coordinates of the fourth diagonal point, is the longitude value of the coordinates of the second diagonal point; The fourth preset formula is: ,in, is the latitude value of the coordinates of the fourth diagonal point, is the latitude value of the coordinates of the second diagonal point.

8. A system for scaling a map, characterized in that: The system for zooming in and out of the map includes: A first acquisition unit, used to determine the point where the user is located on the map displayed by the terminal as a fixed point coordinate; A second acquisition unit is used to take the points within the zoom range of the user as a group of points; and determine the center point coordinates of a first rectangle surrounding the group of points as the center point coordinates corresponding to the zoom gesture; an execution unit, configured to compare the positional relationship between the coordinates of the center point of the first rectangle and the coordinates of the fixed point to obtain a second rectangle, wherein the center of the second rectangle is the fixed point; and to zoom the map by taking the point with the maximum latitude value and the maximum longitude value and the point with the minimum latitude value and the minimum longitude value in the second rectangle as the position point of the finger; The execution unit comprises: The third acquisition unit is used to determine a second rectangle according to the longitude difference and latitude difference corresponding to the coordinates of the center point and the coordinates of the fixed point.

9. The system according to claim 8, characterized in that The coordinates include latitude and longitude values; The first rectangle includes a first diagonal point and a second diagonal point. The coordinates of the first diagonal point are the maximum latitude value and the maximum longitude value of all the coordinates of the first rectangle. The coordinates of the second diagonal point are the minimum latitude value and the minimum longitude value of all the coordinates. The center point of the first rectangle is the center point of the line connecting the first diagonal point and the second diagonal point.

10. The system according to claim 8, characterized in that The third acquisition unit includes: A diagonal point determination unit, configured to determine a third diagonal point and a fourth diagonal point according to the longitude difference and latitude difference corresponding to the coordinates of the center point and the coordinates of the fixed point; A rectangle determining unit is used to determine a second rectangle according to the third diagonal point and the fourth diagonal point.

11. The system according to claim 10, characterized in that The diagonal point determination unit comprises: The first calculation unit is used to calculate the difference between the longitude value of the fixed point coordinates and the longitude value of the center point coordinates as the longitude difference; and calculate the difference between the latitude value of the fixed point coordinates and the latitude value of the center point coordinates as the latitude difference.

12. The system according to claim 10, characterized in that The rectangle determining unit comprises: The second calculation unit is used to calculate the third diagonal point and the fourth diagonal point according to the longitude difference and the latitude difference; and use the rectangle with the third diagonal point as the coordinate point of the maximum latitude value and the maximum longitude value and the fourth diagonal point as the coordinate point of the minimum latitude value and the minimum longitude value as the second rectangle.

13. The system according to claim 12, characterized in that The second computing unit comprises: The second calculation unit is specifically configured to calculate the longitude value of the third diagonal point coordinates according to a first preset formula in response to the longitude difference being greater than zero, and use the longitude value of the second diagonal point coordinates of the first rectangle as the longitude value of the fourth diagonal point coordinates; The second calculation unit is further configured to calculate the latitude value of the coordinates of the third diagonal point according to a second preset formula in response to the latitude difference being greater than zero, and use the latitude value of the coordinates of the second diagonal point as the latitude value of the coordinates of the fourth diagonal point; The first preset formula is: ,in, is the longitude value of the coordinates of the third diagonal point, is the longitude value of the coordinates of the first diagonal point of the first rectangle, is the longitude difference; The second preset formula is: ,in, is the latitude value of the coordinates of the third diagonal point, is the latitude value of the coordinates of the first diagonal point, is the latitude difference.

14. The system according to claim 13, characterized in that The second calculation unit is further configured to, in response to the longitude difference being not greater than zero, use the longitude value of the first diagonal point coordinates as the longitude value of the third diagonal point coordinates, and calculate the longitude value of the fourth diagonal point coordinates according to a third preset formula; The second calculation unit is further configured to, in response to the latitude difference being not greater than zero, use the latitude value of the first diagonal point coordinates as the latitude value of the third diagonal point coordinates, and calculate the latitude value of the fourth diagonal point coordinates according to a fourth preset formula; The third preset formula is: ,in, is the longitude value of the coordinates of the fourth diagonal point, is the longitude value of the coordinates of the second diagonal point; The fourth preset formula is: ,in, is the latitude value of the coordinates of the fourth diagonal point, is the latitude value of the coordinates of the second diagonal point.

15. A terminal, characterized in that: include: A system for zooming a map as claimed in any one of claims 8 to 14.

16. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for zooming a map according to any one of claims 1 to 7 are implemented.

17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for zooming a map according to any one of claims 1 to 7 are implemented.