CN110704057A - Service processing method based on map service and related device - Google Patents
Service processing method based on map service and related device Download PDFInfo
- Publication number
- CN110704057A CN110704057A CN201910954560.3A CN201910954560A CN110704057A CN 110704057 A CN110704057 A CN 110704057A CN 201910954560 A CN201910954560 A CN 201910954560A CN 110704057 A CN110704057 A CN 110704057A
- Authority
- CN
- China
- Prior art keywords
- map
- tile
- target
- longitude
- coordinate
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Instructional Devices (AREA)
Abstract
The invention discloses a service processing method based on map service, which comprises the following steps: acquiring a service access instruction, wherein the service access instruction carries position information of a target object; acquiring a first map tile corresponding to the target object based on the position information of the target object, wherein the first map tile is a map tile where the target object is located; generating a target map according to the first map tiles, wherein the target map comprises a second map tile set, the second map tile set has an association relation with the first map tiles, and the second map tile set comprises at least one second map tile; and displaying the target map through the target application. The invention discloses a device. The map service developed based on the unity engine can support the realization of cross-platform access, so that the same map service can be accessed when applications under different operating systems are developed, thereby realizing the undifferentiated development of the applications and reducing the operation and maintenance cost of the applications.
Description
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a service processing method and a related device based on a map service.
Background
With the rapid development of internet technology, more and more users can use computers, mobile phones, tablet computers and other clients to establish communication with users from other areas through a network. A common communication method is that a user searches for a user from nearby by using a map function provided by the user, so as to realize communication and interaction between users.
At present, an application developer can select to create a new application on a map development platform, then select an operating system supported by the application, for example, an Android operating system or an iOS operating system, and finally develop an application with a map function based on different operating systems.
However, applications often need to be developed for different operating systems so that the applications can run under the different operating systems. Therefore, for an application developer, not only the usage fees corresponding to different operating systems need to be paid to the map development platform, but also more manpower needs to be consumed to maintain the map services under different operating systems, which results in higher operation and maintenance costs of the application.
Disclosure of Invention
The embodiment of the invention provides a map service-based service processing method and a related device, wherein a map service developed based on a unity engine can support the realization of cross-platform access and the realization of undifferentiated development of application, and for an application developer, map service use fees corresponding to a plurality of operating systems are not required to be paid, and the map service can be efficiently managed and maintained, so that the operation and maintenance cost of the application is reduced.
In view of the above, a first aspect of the present invention provides a service processing method based on a map service, including:
acquiring a service access instruction, wherein the service access instruction carries position information of a target object;
acquiring a first map tile corresponding to the target object based on the position information of the target object, wherein the first map tile is a map tile where the target object is located;
generating a target map according to the first map tiles, wherein the target map comprises a second map tile set, the second map tile set has an association relationship with the first map tiles, and the second map tile set comprises at least one second map tile;
and displaying the target map.
A second aspect of the present invention provides a client, including:
the access module is used for acquiring a service access instruction, wherein the service access instruction carries the position information of a target object;
an obtaining module, configured to obtain, based on location information of the target object, a first map tile corresponding to the target object, where the first map tile is a map tile where the target object is located;
a generating module, configured to generate a target map according to the first map tile acquired by the acquiring module, where the target map includes a second map tile set, the second map tile set has an association relationship with the first map tile, and the second map tile set includes at least one second map tile;
and the display module is used for displaying the target map generated by the generation module.
In one possible design, in a first implementation of the second aspect of the embodiment of the invention,
the service access instruction is used for accessing the map service in the target application, wherein the map service is generated by a unity engine.
In one possible design, in a second implementation of the second aspect of the embodiment of the invention,
the obtaining module is specifically configured to obtain a longitude coordinate and a latitude coordinate corresponding to the target object according to the service access instruction;
determining a tile abscissa and a tile ordinate according to the longitude coordinate and the latitude coordinate;
determining a pixel abscissa and a pixel ordinate according to the longitude coordinate and the latitude coordinate;
determining a location of the first map tile on the target map according to the tile abscissa, the tile ordinate, the pixel abscissa, and the pixel ordinate.
In a possible design, in a third implementation manner of the second aspect of the embodiment of the present invention, the client further includes a processing module;
the processing module is used for acquiring a screen sliding instruction after the display module displays the target map;
determining an overlapping area of a first display area and a second display area according to the screen sliding instruction, wherein the first display area is used for displaying a preset map, and the second display area is used for displaying the target map;
determining a first compensation area according to the first display area and the overlapping area, and determining a second compensation area according to the second display area and the overlapping area;
and processing the target map according to the first compensation area and the second compensation area.
In one possible design, in a fourth implementation of the second aspect of the embodiment of the invention,
the processing module is specifically configured to obtain screen position information corresponding to the first compensation area if the first compensation area is greater than or equal to the second compensation area;
determining the screen position information corresponding to the first compensation area as the screen position information of the second compensation area;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
In one possible design, in a fifth implementation of the second aspect of the embodiment of the invention,
the processing module is specifically configured to create screen position information if the first compensation area is smaller than the second compensation area;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
In one possible design, in a sixth implementation of the second aspect of the embodiment of the invention,
the processing module is further used for acquiring a first moving instruction after the display module displays the target map;
and if the target map is determined to reach a latitude boundary according to the first moving instruction, controlling the target map to stop moving, wherein the latitude boundary represents the latitude line where the north pole is located and the latitude line where the south pole is located.
In one possible design, in a seventh implementation of the second aspect of the embodiment of the present invention,
the processing module is further configured to obtain a second moving instruction after the display module displays the target map, where the longitude moving instruction corresponds to a target direction;
and if the longitude boundary is determined to be reached according to the second movement instruction, controlling the target map to continuously move from the longitude boundary along the target direction, wherein the longitude boundary is preset longitude.
In one possible design, in an eighth implementation of the second aspect of the embodiment of the invention,
the processing module is further configured to obtain a nearby search instruction, where the nearby search instruction carries the longitude coordinate, the latitude coordinate, and the radius longitude and latitude of the target object;
acquiring object information of N associated objects according to the longitude coordinate, the latitude coordinate and the radius longitude and latitude, wherein N is an integer greater than or equal to 0;
and displaying the object information of the N associated objects.
In one possible design, in a ninth implementation of the second aspect of the embodiment of the invention,
the processing module is further configured to obtain a map movement instruction, where the map movement instruction includes a pixel abscissa and a pixel ordinate;
determining a moving distance according to the pixel abscissa and the pixel ordinate;
acquiring screen position information of a second compensation area according to the moving distance;
loading at least one third map tile according to the screen location information of the second compensation area.
In one possible design, in a tenth implementation of the second aspect of the embodiment of the invention,
the processing module is further configured to obtain a map zooming instruction, where the map zooming instruction carries a pixel coordinate of a first position and a pixel coordinate of a second position, the pixel coordinate of the first position includes a first pixel abscissa and a first pixel ordinate, and the pixel coordinates of the second position includes a second pixel abscissa and a second pixel ordinate;
determining a central point position according to the pixel coordinates of the first position and the pixel coordinates of the second position, wherein the central point position is the central position of the straight-line distance between the first position and the second position;
carrying out zooming processing by taking the central point position as a father node control map;
and when the scaling of the zooming processing reaches a preset scale, acquiring the updated map according to the target depth value.
In one possible design, in an eleventh implementation of the second aspect of the embodiment of the present invention,
the processing module is further used for acquiring a first object selection instruction and a second object selection instruction;
determining a first longitude coordinate and a first latitude coordinate corresponding to a first position according to the first object selection instruction, and determining a second longitude coordinate and a second latitude coordinate corresponding to a second position according to the second object selection instruction;
determining a distance between the first location and the second location based on the first longitude coordinate, the first latitude coordinate, a second longitude coordinate, and a second latitude coordinate;
showing a distance between the first location and the second location.
A third aspect of the present invention provides a terminal device, including: a memory, a transceiver, a processor, and a bus system;
wherein the memory is used for storing programs;
the processor is used for executing the program in the memory and comprises the following steps:
acquiring a service access instruction, wherein the map service is generated by a unity engine, and the service access instruction carries position information of a target object;
acquiring a first map tile corresponding to the target object based on the position information of the target object, wherein the first map tile is a map tile where the target object is located;
generating a target map according to the first map tiles, wherein the target map comprises a second map tile set, the second map tile set has an association relationship with the first map tiles, and the second map tile set comprises at least one second map tile;
displaying the target map;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the above-described aspects.
According to the technical scheme, the embodiment of the invention has the following advantages:
the embodiment of the invention provides a map service-based service processing method which is applied to a unity engine, when a service access instruction is obtained, a map service is accessed in a target application, the map service is a service generated by the unity engine, then a first map tile corresponding to a target object is obtained, wherein the first map tile is a map tile where the target object is located, a target map is generated according to the first map tile, the target map comprises a second map tile set, the second map tile set has an incidence relation with the first map tile, the second map tile set comprises at least one second map tile, and finally the target map can be displayed through the target application. By the mode, the map service developed based on the unity engine can support the realization of cross-platform access, so that the same map service can be accessed when applications under different operating systems are developed, and the undifferentiated development of the applications is realized.
Drawings
FIG. 1 is a schematic diagram of an architecture of a business processing system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an interface for accessing a map service according to an embodiment of the present invention;
FIG. 3 is a diagram of an embodiment of a map service-based service processing method according to the embodiment of the present invention;
FIG. 4 is a schematic view of a mercator projection in an embodiment of the present invention;
FIG. 5 is a schematic view of a tile pyramid in an embodiment of the present invention;
FIG. 6 is a schematic view of a map tile in a coordinate system in accordance with an embodiment of the present invention;
FIG. 7 is a schematic diagram of a screen-based gap filling algorithm according to an embodiment of the present invention;
FIG. 8 is a diagram of an embodiment of a screen-based gap filling algorithm according to an embodiment of the present invention;
FIG. 9 is a diagram of another embodiment of a screen-based gap filling algorithm according to an embodiment of the present invention;
FIG. 10 is a schematic illustration of the earth based latitude and longitude of an embodiment of the present invention;
FIG. 11 is a schematic diagram of an embodiment of the present invention based on boundary constraint and cycle presentation;
FIG. 12 is a schematic diagram of an interface for locating nearby people in accordance with an embodiment of the present invention;
FIG. 13 is a schematic view of another interface for locating nearby people in accordance with an embodiment of the present invention;
FIG. 14 is a schematic diagram of an interface for moving a map according to an embodiment of the present invention;
FIG. 15 is a schematic diagram of an interface for zooming a map in an embodiment of the present invention;
FIG. 16 is a schematic diagram of an interface for obtaining a linear distance between two points according to an embodiment of the present invention;
FIG. 17 is a diagram of one embodiment of a client in an embodiment of the invention;
FIG. 18 is a diagram of another embodiment of a client in an embodiment of the present invention;
fig. 19 is a schematic structural diagram of a terminal device in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a map service-based service processing method and a related device, wherein a map service developed based on a unity engine can support the realization of cross-platform access and the realization of undifferentiated development of application, and for an application developer, map service use fees corresponding to a plurality of operating systems are not required to be paid, and the map service can be efficiently managed and maintained, so that the operation and maintenance cost of the application is reduced.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "corresponding" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that the map service provided by the present invention is developed based on a game engine, such as a unity engine, and the map service may also be referred to as unity map service. The map service is an application tool set established based on real map data, and can help a developer add scenes needing Location Based Service (LBS) capability support, such as block ranking, real-scene display, stranger social contact, nearby friends and the like, in an application (such as a game). Meanwhile, because the map service provided by the invention is developed based on a game engine, such as the unity engine, the access cost of a developer is greatly reduced, and game objects can be easily created through a C # script and a graphical interface. It will be appreciated that the map service may also access different types of applications, including but not limited to gaming type applications, instant messaging type applications, and other types of applications. The Unity engine, which may also be referred to as Unity3D, is a multi-platform development tool that can create types such as three-dimensional video games, building visualizations, and real-time three-dimensional animations. And the application developed by using the unity engine can support the running of multiple platforms, and the platform types include but are not limited to a Windows (Windows) operating system, a Linux operating system, an apple operating system (Mac OS), an Android (Android) operating system and an iOS.
The gesture operation can be realized based on the map service, and the operation mode based on the map service provided by the invention is introduced as follows, specifically:
(1) operation of moving the map:
v/x, y screen coordinate offset
void MoveOffset(double x,double y)
void DidRender()
During the move, MoveOffset (x, y) is called. At the end of the move, DidRender () is called once.
(2) Operation of zooming in and out of the map:
// zoomlevelle is the map target zoom level
void SetZoomLevel(double zoomLevel)
void DidRender()
In zooming the map, setzoomlevelle (zoomlevelle) is called. At the end of zooming the map, DidRender () is called once.
It should be understood that the above mentioned name and calling manner of the Application Programming Interface (API) are merely illustrative, and should not be construed as a limitation to the present invention, and the map service provided by the present invention may have more extended functions, which is not exhaustive here.
For convenience of understanding, the present invention provides a map service-based service processing method, which is applied to a service processing system shown in fig. 1, please refer to fig. 1, where fig. 1 is a schematic diagram of an architecture of the service processing system in an embodiment of the present invention, as shown in the figure, an application is run on a client, and the application needs to access LBS social contact, that is, an LBS function based on geographical location interaction is implemented. The map service provided by the invention is accessed when the application is developed, and can be directly realized in a unity engine by using C #. The online map of the internet map service provider is provided in a tile mode, and the service is called map tile service. The most common map tiles are in picture format, typically 256 pixels by 256 pixels in size. The map tile is used as a big map, and is divided into different map tiles according to the tile grades under different zooming scales, so that the longitude and latitude of each map tile can be positioned. Map tiles are typically stored in a server from which map tiles used in the map service may be downloaded.
It should be noted that the client is deployed on the client, where the client includes, but is not limited to, a tablet computer, a notebook computer, a palm computer, a mobile phone, a voice interaction device, and a Personal Computer (PC), and the present disclosure is not limited thereto. The voice interaction device includes, but is not limited to, an intelligent sound and an intelligent household appliance.
Referring to fig. 2, fig. 2 is an interface schematic diagram of the map service access in the embodiment of the present invention, as shown in the figure, for the application of the map service access, nearby people can be found, and by taking fig. 2 as an example, it is assumed that a user "pinkish" can also query nearby people after accurately positioning to his own position, and at this time, the positions of the user "xiaoming", the user "tom", the user "jieri", and the user "girl" in the map are queried. The user "pinkish" may choose to interact with one or more of the users.
With reference to the above description, the following description will describe a map service-based service processing method in the present invention, and please refer to fig. 3, where the map service-based service processing method in the embodiment of the present invention is applied to a unity engine, and an embodiment of the service processing method includes:
101. acquiring a service access instruction, wherein the service access instruction carries position information of a target object;
in this embodiment, when the client obtains the service access instruction, the map service may be accessed in the target application, and it may be understood that the client may be deployed in the client, where the client runs the target application, and the target application may be a game application, an instant messaging application, or another application, which is not limited here. The target application and the map service are developed by adopting a unity engine.
Specifically, taking the target application as a game application as an example, after the target application is started, the user selects a service related to the map, such as that the user (i.e., the target object) searches for a nearby person, or the user (i.e., the target object) obtains positioning information of the user, and the like. For the client, the longitude coordinate and the latitude coordinate corresponding to the target object may be determined through an LBS, which is a value-added service that obtains the location Information (e.g., Geographic coordinates or geodetic coordinates) of the Mobile terminal user through a radio communication network (e.g., a Global System for Mobile Communications (GSM) network and a Code Division Multiple Access (CDMA) network) of a telecom Mobile operator or an external positioning manner (e.g., a Global Positioning System (GPS)), and provides the user with a corresponding service under the support of a Geographic Information System (GIS) platform.
There are several methods for location definition:
(1) base station location
Each base station has an identifier, and a terminal device can make and receive calls and send and receive short messages, which indicates that the terminal device can initiate interaction with nearby base stations and send and receive signals. For the terminal device, the base station identifier may also be obtained through an interface of the system. The positioning of the base station determines the position of the terminal device by using the measured distance of the base station to the distance of the terminal device. The accuracy of base station positioning depends to a large extent on the distribution of the base stations and the size of the coverage area.
(2) Wireless Fidelity (WiFi) positioning
Under the condition that the terminal device supports WiFi internet Access, each connected WiFi router (including the condition that the terminal device is used as a mobile hotspot) has a globally unique Media Access Control Address (MAC). WiFi routers are deployed at low cost and are therefore very popular, with many WiFi hotspots on one floor. Thus, once there is an actual location of each router around the world, the current location of the user can be determined.
(3) GPS positioning
If the terminal equipment is outdoors or at the window, the terminal equipment can receive signals transmitted by the positioning satellites on the sky, and based on the signals, the distance from the terminal equipment to each satellite and the position of the satellite can be calculated, so that the position of the terminal equipment can be calculated. It should be noted that this solution is completed in the GPS chip, and on the operating system level of the terminal device, the result of the solution and the error radius can be directly obtained through an Application Programming Interface (API).
(4) Assisted Global Positioning System (AGPS) Positioning, i.e. a combination of GPS + base stations
The AGPS utilizes the network, firstly, the terminal equipment sends the approximate position obtained by the base station positioning or the WIFI positioning to the remote server, the server carries out inquiry and calculation to obtain the current satellite information at the position and feeds the current satellite information back to the terminal equipment, the terminal equipment can directly use the information to receive satellite signals, the position of a satellite can be known without waiting for the completion of the broadcasting of the satellite orbit information, and the satellite searching time is greatly shortened.
102. Acquiring a first map tile corresponding to a target object based on the position information of the target object, wherein the first map tile is a map tile where the target object is located;
in this embodiment, the client carries the longitude coordinate and the latitude coordinate corresponding to the target object according to the service access instruction, where the longitude coordinate may be obtained by calculation according to a latitude, and the latitude coordinate may be obtained by calculation according to a longitude. The map tile map generation method comprises the steps of calculating to obtain a tile abscissa based on a longitude coordinate, calculating to obtain a tile ordinate based on a latitude coordinate, obtaining a tile number corresponding to a target object according to the tile abscissa and the tile ordinate, and determining a first map tile according to the tile number, wherein the first map tile is the map tile where the target object is located.
The tile number is similar to the table cell number with the origin positive up and to the right and negative down and to the left. The cells X and Y are numbered starting from 0, with the first cell X being 0 and Y being 0 in the upper right corner, X being the right direction, i.e. horizontal, and Y being the up direction, i.e. vertical.
103. Generating a target map according to the first map tiles, wherein the target map comprises a second map tile set, the second map tile set has an association relationship with the first map tiles, and the second map tile set comprises at least one second map tile;
in this embodiment, the client obtains a second map tile set according to the first map tile, where the second map tile set includes at least one second map tile. The client obtains the first map tile under the corresponding scaling according to the given longitude coordinate and the latitude coordinate, and it can be understood that after the tile Level (Level) of the map tile is determined, the map can be scaled according to the requirement, and the initial scaling can be set to 1. And then, obtaining surrounding map tiles according to the tile abscissa and the tile ordinate of the first map tile, and obtaining a second map tile set. The location of one map tile can be deduced as long as the location of the other map tiles is known. Thus, a map tile can be determined using the tile abscissa, tile ordinate, and zoom.
Assuming that the screen of one client can display 6 map tiles at the maximum, the surrounding 5 second map tiles can be obtained from the first map tile, and assuming that the screen of one client can display 2 map tiles at the maximum, the surrounding 1 second map tile can be obtained from the first map tile. A target map is generated from the first set of map tiles and the second set of map tiles. Wherein the target map can be positioned to own position information and provide display of own azimuth.
104. And displaying the target map.
In this embodiment, the client displays the target map through the target application, and since the target map needs to be displayed in the target application, the size of the target map needs to be smaller than or equal to the size of the display interface of the target application.
The embodiment of the invention provides a map service-based service processing method which is applied to a unity engine, when a service access instruction is obtained, a map service is accessed in a target application, the map service is a service generated by the unity engine, then a first map tile corresponding to a target object is obtained, wherein the first map tile is a map tile where the target object is located, a target map is generated according to the first map tile, the target map comprises a second map tile set, the second map tile set has an incidence relation with the first map tile, the second map tile set comprises at least one second map tile, and finally the target map can be displayed through the target application. By the mode, the map service developed based on the unity engine can support the realization of cross-platform access, so that the same map service can be accessed when applications under different operating systems are developed, and the undifferentiated development of the applications is realized.
Optionally, on the basis of the foregoing embodiments corresponding to fig. 3, in a first optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, the obtaining a first map tile corresponding to a target object may include:
acquiring a longitude coordinate and a latitude coordinate corresponding to a target object according to the service access instruction;
determining a tile abscissa and a tile ordinate according to the longitude coordinate and the latitude coordinate;
determining a pixel abscissa and a pixel ordinate according to the longitude coordinate and the latitude coordinate;
and determining the position of the first map tile on the target map according to the tile abscissa, the tile ordinate, the pixel abscissa and the pixel ordinate.
In this embodiment, a manner of obtaining a first map tile is introduced, and the map service provided by the present invention is mainly made based on a map tile service, where a map tile is a picture and contains a small amount of data, so that the loading speed of the device can be increased. The client side can obtain data of the map tiles through calculation by obtaining longitude coordinates and latitude coordinates of the target object, namely tile horizontal coordinates and tile vertical coordinates, then obtains the target map through rendering of a drawing plug-in (Canvas), and finally presents the target map in front of a user. The Canvas is a native plug-in, and is equivalent to a Canvas with a customizable size, and assuming that the Canvas is as large as the screen of the client, when each map is created, the Canvas is told about the position and pixel of each vertex, and then the Canvas can draw a map through the information.
Specifically, referring to fig. 4, fig. 4 is a schematic diagram of a mercator projection in an embodiment of the present invention, as shown in the figure, since the earth itself is a sphere, the mercator projection can be mapped into a two-dimensional plane for display, and the mercator projection is an orthogonal-axis equiangular cylindrical projection, which is also called an equiangular cylindrical projection, which is a cylindrical projection. A cylinder which is consistent with the direction of the earth axis is supposed to be cut or cut on the earth, the graticule is projected onto the cylindrical surface according to the equiangular condition, and the planar graticule mesh is obtained after the cylindrical surface is expanded into a plane. After projection, the warps are a group of vertical parallel straight lines with equal distance, and the wefts are a group of parallel straight lines perpendicular to the warps. The interval between adjacent weft yarns increases from the equator to the two poles. The length ratios in any direction are equal at one point, i.e. there is no angular distortion, while the area distortion is significant, increasing with distance from the reference weft. The projection has the characteristic that the equiangular route is expressed as a straight line, so that the projection can be used for map generation and drawing of map business. It should be noted that the mercator projection is not a coordinate system, but a spatial mapping performed to represent the three-dimensional earth on a two-dimensional plane. In mapping and map visualization, map data needs to be presented by projection.
For a world map projected as a plane through the mercator, the world map is divided into map units with 256 × 256 pixels by means of cutting under different map resolutions (namely, the pixel size of the whole world map), and each divided map unit is called a map tile. The map tile has the following characteristics:
(1) with unique tile levels (Level) and tile coordinates (tileX, tileY).
(2) The tile resolution is 256 x 256.
(3) The minimum map level is 0, and when the map level is 0, the world map is composed of only one map tile.
(4) The higher the tile level, the greater the number of map tiles that make up the world map, the more detailed the map can be presented, i.e., more description space is needed to describe more details, i.e., more map tiles are used to describe details.
(5) The tiles of a certain tile grade map are formed by a plurality of tiles cut from the tiles at the lower level, and a tile pyramid is formed. For convenience of understanding, please refer to fig. 5, fig. 5 is a schematic diagram of a tile pyramid according to an embodiment of the present invention, and as shown in the diagram, the tile pyramid has a plurality of tile levels, and map tiles between different tile levels can achieve the purpose of displaying different details through different spans, in a simple manner, a map tile at a previous level is split into a plurality of map tiles at a next level, for example, as shown in fig. 5, a map tile at a tile level of 0 includes only 1 map tile, a map tile at a tile level of 1 includes 4 map tiles, a map tile at a tile level of 2 includes 16 map tiles, a map tile at a tile level of 3 includes 64 map tiles, and so on, this time is merely an illustration, and in an actual application, the tile level and the number of map tiles at a tile level are not limited thereto.
The coordinates of the tiles at each tile level are set in the coordinate system at the upper left corner, please refer to fig. 6, fig. 6 is a schematic diagram of the map tiles in the coordinate system according to the embodiment of the present invention, as shown in the figure, taking 16 map tiles included at the tile level of 2 as an example, each map tile has a tile coordinate, and the tile coordinate includes a tile abscissa and a tile ordinate. Before calculating the row and column number of a map tile, it is necessary to determine how many meters of actual distance 1 pixel on the map represents. Assuming that the coordinate unit of the map is meter, the Dots Per Inch (DPI) is 96, since 1 inch is 2.54 cm and 1 inch is 96 pixels, assuming that the current map scale is 1:125000000, it represents that 1 meter on the map is equal to 125000000 meters of the solid, and if the conversion formula between meters and pixels is 1 inch to 0.0254 meter to 96 pixels, 1 pixel is 0.0254/96 meters, and according to the 1:125000000 scale, 1 pixel on the map represents that the solid distance is 125000000 × 0.0254/96 to 33072.9166666667 meters.
Specifically, the client obtains a first map tile under a corresponding scaling according to a given longitude and latitude, and then obtains a second map tile on the periphery according to the coordinates of the first map tile. The way in which the tile abscissa and tile ordinate are calculated based on the longitude and latitude coordinates will be described below.
The tile abscissa is calculated using:
wherein tileX represents a tile abscissa, lng represents a longitude coordinate, and Level represents a tile Level.
The tile ordinate is calculated using:
wherein tileY represents the tile abscissa and lat represents the latitude coordinate.
The manner in which the pixel abscissa and pixel ordinate are calculated based on the longitude coordinate and the latitude coordinate will be described below.
The pixel abscissa is calculated using:
where pixelX represents the pixel abscissa and 256% 256 represents a map tile size of 256 x 256 pixels.
The pixel ordinate is calculated using:
where pixelY represents the pixel ordinate.
It can be seen that the selected first map tile can be determined using the tile abscissa and the tile ordinate, and the position on the client display interface at which the first map tile should be located can be determined from the pixel abscissa and the pixel ordinate.
Secondly, in the embodiment of the present invention, a manner of obtaining the first map tile is provided, and the client may obtain a longitude coordinate and a latitude coordinate corresponding to the target object according to the service access instruction, calculate based on the longitude coordinate to obtain a tile abscissa and a pixel abscissa, calculate based on the latitude coordinate to obtain a tile ordinate and a pixel ordinate, and finally determine the position of the first map tile on the target map by combining the tile abscissa, the tile ordinate, the pixel abscissa and the pixel ordinate. By the method, the position where the map tile should appear on the display interface of the client can be accurately positioned based on the map service, so that the feasibility and operability of the scheme are improved.
Optionally, on the basis of each embodiment corresponding to fig. 3, in a second optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, after displaying the target map, the method may further include:
acquiring a screen sliding instruction;
determining an overlapping area of a first display area and a second display area according to the screen sliding instruction, wherein the first display area is used for displaying a preset map, and the second display area is used for displaying a target map;
determining a first compensation area according to the first display area and the overlapping area, and determining a second compensation area according to the second display area and the overlapping area;
and processing the target map according to the first compensation area and the second compensation area.
In the embodiment, a screen vacancy filling algorithm based on map service is provided. The map is frequently slid by a user when the map service is used, but considering that the memory of the terminal device is limited, if images of a large number of map tiles are stored all the time, too many resources are occupied, or if the map tiles are frequently created, a large amount of calculation is consumed, and the performance of the device is not maintained, so that the problem can be well solved by the screen shortage algorithm provided by the invention.
Specifically, for easy understanding, please refer to fig. 7, fig. 7 is a schematic diagram of a screen gap-filling algorithm according to an embodiment of the present invention, and as shown in the drawing, the area shown in S1 is a larger area, map tiles in the area are already loaded, the area shown in S2 is a smaller area, the size of the area is equal to the size of the display interface of the client, i.e., the size of the visible range, and when the area shown in S2 is moved, if the area does not exceed the area shown in S1, map tiles around the area are directly loaded. Once the region indicated by S2 moves out of the region indicated by S1, it is necessary to determine whether screen blanking is required. In short, since not all the images of the map tiles are loaded at the beginning, only the part displayed in the screen is loaded, so that when the map is slid and zoomed, the position and the required map tile are calculated in real time and loaded.
Referring to fig. 8, fig. 8 is a schematic view of an embodiment of a screen gap algorithm according to an embodiment of the present invention, where an area indicated by a1 is a first display area for displaying a preset map, an area indicated by a2 is a second display area for displaying a target map. When the screen sliding instruction is triggered, the overlapping area between the first display area and the second display area changes, and the overlapping area shown in fig. 8 is the area a. The client determines a first compensation area according to the first display area and the overlapping area, the first compensation area being an area B, and determines a second compensation area according to the second display area and the overlapping area, the second compensation area being an area C. Since the second display area shown in a2 is an area corresponding to the display interface, when the user moves the target map, the size of the target map in the second display area will be reduced, and therefore, a new map tile needs to be loaded to completely fill the second display area, and the client can select a way of filling the second display area according to the size of the first compensation area and the size of the second compensation area, and process the target map based on different ways.
Secondly, in the embodiment of the invention, a screen gap filling algorithm based on a map service is provided, and the method comprises the steps of firstly, obtaining a screen sliding instruction by a client, then determining an overlapping area of a first display area and a second display area according to the screen sliding instruction, then determining a first compensation area according to the first display area and the overlapping area, determining a second compensation area according to the second display area and the overlapping area, and finally processing a target map according to the first compensation area and the second compensation area. By the method, after the serial number of the tile map and the pixel points of the tile map are calculated according to the longitude and latitude, the serial number can be displayed on a display interface of the terminal equipment. Whenever, can establish the picture quantity of the tile map that the display screen needs, and recycle, thus promote feasibility and maneuverability of the scheme, and can load the map tile in real time.
Optionally, on the basis of the foregoing embodiments corresponding to fig. 3, in a third optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, processing the target map according to the first compensation area may include:
if the first compensation area is larger than or equal to the second compensation area, screen position information corresponding to the first compensation area is obtained;
determining the screen position information corresponding to the first compensation area as the screen position information of the second compensation area;
and loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
In this embodiment, a manner of selectively filling the second display area based on the first compensation area and the second compensation area is described. For convenience of description, please refer to fig. 8 again, fig. 8 is a schematic diagram of an embodiment of the screen gap-based algorithm according to the embodiment of the present invention, as shown in the figure, the first compensation area is an area B, the second compensation area is an area C, after the target map is moved, only a part of the target map can be displayed in the second display area shown in a2, and the part of the target map is displayed in the area a. Obviously, the map cannot be completely displayed in the second display area shown in a2, and at this time, screen position information needs to be extracted from the first compensation area (i.e., area B), where the screen position information includes coordinates of a Canvas, the coordinates of the Canvas are used to determine the position where the rendering block appears, and the map tile can be loaded according to the position where the rendering block appears. The client uses the screen position information of the first compensation area as the screen position information of the second compensation area (i.e., area C), i.e., a new map tile can be loaded based on the coordinates of the Canvas, where the new map tile is at least one third map tile. And finally, splicing the target map and at least one third map tile to obtain a new map, wherein the map is displayed in the second area.
The embodiment of the present invention provides another screen gap filling algorithm based on a map service, where if the first compensation area is greater than or equal to the second compensation area, the client obtains screen position information corresponding to the first compensation area, then determines the screen position information corresponding to the first compensation area as screen position information of the second compensation area, and finally loads at least one third map tile according to the screen position information of the second compensation area. In this way, when the first compensation area is greater than or equal to the second compensation area, new screen position information does not need to be created again, and the screen position information of the missing part is supplemented by the created screen position information, so that the number of created screen position information is reduced, the processing efficiency of the device is improved, and meanwhile, the computing resources are saved.
Optionally, on the basis of the foregoing embodiments corresponding to fig. 3, in a fourth optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, processing the target map according to the first compensation area may include:
if the first compensation area is smaller than the second compensation area, screen position information is created;
and loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
In this embodiment, another way of selectively filling the second display area based on the first compensation area and the second compensation area is described. For convenience of introduction, please refer to fig. 9, where fig. 9 is a diagram illustrating another embodiment of the screen gap filling algorithm according to an embodiment of the present invention, and as shown in the drawing, it is assumed that a user performs an enlargement process on a target map, at this time, a second display area shown in a2 and a first display area larger than a1 are used, in such a case, the first compensation area is the same as the overlapped area (i.e., area a) and the first compensation area is smaller than the second compensation area (i.e., area C), so that a client needs to create new screen position information, where the screen position information includes coordinates of a Canvas, where the coordinates of the Canvas are used to determine a position where a rendering block appears, and a map tile can be loaded according to the position where the rendering block appears. And the client loads a new map tile based on the coordinates of the Canvas, wherein the new map tile is at least one third map tile. And finally, splicing the target map and at least one third map tile to obtain a new map, wherein the map is displayed in the second area.
In the embodiment of the present invention, another screen gap filling algorithm based on a map service is provided, where if the first compensation area is smaller than the second compensation area, the client needs to create screen position information, and then loads at least one third map tile according to the screen position information of the second compensation area, and in the above manner, new screen position information needs to be created again only when the first compensation area is smaller than the second compensation area, so that the number of created screen position information is reduced, the processing efficiency of the device is improved, and meanwhile, the computing resources are saved.
Optionally, on the basis of each embodiment corresponding to fig. 3, in a fifth optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, after displaying the target map, the method may further include:
acquiring a first moving instruction;
and if the latitude boundary is determined to be reached according to the first moving instruction, the control target map stops moving, wherein the latitude boundary represents the latitude line where the north pole is located and the latitude line where the south pole is located.
In this embodiment, a moving manner to reach a latitude boundary is described, first, a client obtains a first moving instruction, where the first moving instruction represents an instruction to move to a south pole direction or a north pole direction, for convenience of description, refer to fig. 10, where fig. 10 is a schematic diagram based on latitude and longitude of the earth in the embodiment of the present invention, and as shown in the drawing, the latitude and longitude form a coordinate system, which is called a geographic coordinate system, and is a spherical coordinate system that defines a space on the earth by using a sphere of a three-dimensional space, and can mark any position on the earth. The latitude lines and the longitude lines are auxiliary lines which are assumed by human beings for measuring convenience and are defined as tracks formed by the rotation of a certain point on the earth surface along with the earth. Any one weft is round and parallel two by two. The length of the weft is the circumference of the equator multiplied by the cosine of the latitude of the weft, so that the equator is the longest, and the longer the weft is away from the equator, the shorter the circumference is, and the two poles are reduced to 0. The important wefts include north pole circles, return-to-north lines, equator, return-to-south lines and south pole circles, and the wefts are different in length, i.e., the farther from the equator, the shorter the weft is. The latitude boundaries represent latitude lines where the north pole is located and latitude lines where the south pole is located, the latitude boundaries are parallel to the equator, and the latitude boundaries pass through the south pole or the north pole.
Specifically, if a first movement instruction is triggered at the target map, and if it is determined that the latitude boundary has been reached according to the first movement instruction, the client will control the target map to stop moving, that is, the map cannot be moved after the south and north latitudes reach the end, and similar to a globe, only rotation in longitude is possible, but rotation in latitude is impossible.
Secondly, in the embodiment of the present invention, a moving manner to reach a latitude boundary is provided, that is, the client acquires the first moving instruction, and if it is determined according to the first moving instruction that the latitude boundary is reached, the client controls the target map to stop moving, and the latitude boundary indicates the latitude line where the north pole is located and the latitude line where the south pole is located. In this way, considering that the world map is latitudinally spanned, in order to be close to reality, a limit needs to be made when moving to the south-most end and the north-most end, so that the feasibility and operability of the scheme are facilitated, and the limit is applied to limit the maximum area of the map not to be exceeded in the moving process.
Optionally, on the basis of each embodiment corresponding to fig. 3, in a sixth optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, after displaying the target map, the method may further include:
acquiring a second movement instruction, wherein the longitude movement instruction corresponds to the target direction;
and if the longitude boundary is determined to be reached according to the second moving instruction, controlling the target map to continuously move from the longitude boundary along the target direction, wherein the longitude boundary is preset longitude.
In this embodiment, a moving manner to reach a longitude boundary is described, first, a client acquires a second moving instruction, where the second moving instruction represents an instruction to move to an east longitude direction or a west longitude direction, for convenience of description, please refer to fig. 10 again, fig. 10 is a schematic diagram based on the longitude and latitude of the earth in the embodiment of the present invention, and as shown in the drawing, the longitude and the latitude form a coordinate system, which is called a geographic coordinate system, and is a spherical coordinate system that defines a space on the earth by using a sphere of a three-dimensional space, and can mark any position on the earth. The meridian is also called meridian, is an auxiliary line which is assumed by human beings for measurement convenience like the weft, and is defined as a semicircular arc on a big circular line connecting the north and south poles on the earth surface. Any two longitude lines have equal length and intersect at the north and south poles. Each meridian has its corresponding value, called longitude, which indicates the north-south direction. Important meridian includes this first meridian, the paris meridian, 180 degrees meridian, the west meridian 20 degrees and the east meridian 160 degrees, all of which are equal in length. Longitude is the number of degrees east or west a place on the earth runs from north to south called the present meridian. The longitude of this initial meridian is 0 °, and the longitude of other points on the earth is east to 180 ° or west to 180 °. Unlike the latitude having the equator as the natural origin and the longitude having no natural origin, the line as the present initial meridian is selected. It is understood that the longitude boundary in the present invention is also a preset meridian, for example, the meridian may be the original meridian, may be a 180-degree meridian, and may also be a meridian of another degree, which is not limited herein.
The longitude on the world map is a closed loop, which means that the longitude can go from head to tail and then start from head, for example, east longitude and west longitude can be directly circled without inversion, so that a cycle can be made. For easy understanding, please refer to fig. 11, fig. 11 is a schematic diagram of an embodiment of the present invention based on boundary limitation and cycle display, and as shown in the figure, it is assumed that the second move instruction is a leftward slide instruction, and when the second move instruction reaches a longitude boundary when sliding to the leftmost end of the map, the next cycle is started, i.e., the right cycle is started, so that the map can be displayed from right to left again. Assuming that the second move instruction is a slide right instruction, when sliding to the rightmost end of the map, the longitude boundary is reached, and then the next cycle is started, i.e. the left cycle is started, so that the map can be presented again from left to right.
Secondly, in the embodiment of the present invention, a moving manner of reaching a longitude boundary is provided, that is, the client acquires a second moving instruction, the longitude moving instruction corresponds to the target direction, and if it is determined according to the second moving instruction that the longitude boundary has been reached, the target map is controlled to move continuously along the target direction from the longitude boundary, and the longitude boundary is a preset longitude. By the method, the world map is continuous in longitude, and in order to be close to reality, a cycle needs to be performed when the world map moves in the east longitude or west longitude direction, namely, the map can be continuously visited by a user by using a cycle display mode, so that the feasibility and operability of a scheme are improved.
Optionally, on the basis of the foregoing embodiments corresponding to fig. 3, in a seventh optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, the method may further include:
acquiring a nearby searching instruction, wherein the nearby searching instruction carries a longitude coordinate, a latitude coordinate and a radius longitude and latitude of a target object;
acquiring object information of N associated objects according to the longitude coordinate, the latitude coordinate and the radius longitude and latitude, wherein N is an integer greater than or equal to 0;
and displaying the object information of the N associated objects.
In the embodiment, a map service-based vicinity search mode is introduced, and first, a client acquires a vicinity search instruction triggered by a target object, where the vicinity search instruction carries a longitude coordinate, a latitude coordinate, and a radius longitude and latitude of the target object, where the longitude coordinate and the latitude coordinate are used to indicate a location where the target object is located, the radius longitude and latitude are used to indicate a search range requested by the target object, and a circular range can be determined based on the radius longitude and latitude. In practical application, when the moving range of the client is greater than the preset longitude coordinate and the preset latitude coordinate, the client may send a vicinity search instruction to the server, and the server determines the longitude coordinate, the latitude coordinate, and the radius longitude and latitude where the target object is located based on the vicinity search instruction, so that the server may issue object information of N associated objects within the search range to the client.
It should be noted that, in order to better approximate the visual effect, the client may determine the longitude coordinate and the latitude coordinate of the target object according to the pixel abscissa and the pixel ordinate of the target object, and a manner of calculating the longitude coordinate and the latitude coordinate based on the pixel abscissa and the pixel ordinate will be described below.
Longitude coordinates are calculated using:
where lng represents longitude coordinates, tileX represents tile abscissa, pixelX represents pixel abscissa, and Level represents tile Level.
The latitude coordinates were calculated as follows:
where lat represents the latitude coordinate, tileY represents the tile abscissa, and pixelY represents the pixel ordinate.
Since the longitude at each tile level is different, if a nearby person is refreshed while directly fixing a certain longitude (e.g., 50 degrees), the changed longitude and latitude on the map with the highest tile level is greatly different from that on the map with the lowest tile level, but the screen pixel sliding at which tile level is the same, and therefore, the algorithm of screen pixel conversion longitude is used here.
Specifically, the following description will be given with reference to two scenarios, please refer to fig. 12, and fig. 12 is an interface schematic diagram of finding nearby people in the embodiment of the present invention, as shown in the figure, assuming that the target object is the position "1" in fig. 12, a user triggers a nearby finding instruction through a client, that is, the clicked position "1" slides outward, and the sliding distance is used to determine the radius longitude and latitude U. The client feeds back a nearby searching instruction to the server, and the server determines that 2 associated objects exist in the circular range of the radius longitude and latitude U according to the nearby searching instruction, wherein the 2 associated objects are respectively an associated object A corresponding to the position of the number 3 and an associated object B corresponding to the position of the number 4. Further, referring to fig. 13, fig. 13 is another interface schematic diagram of the embodiment of the present invention for finding nearby people, as shown in the figure, the user may further click a specific associated object, for example, click the location of the associated object B, at this time, a window related to the associated object B may pop up on the interface of the client, and information related to the associated object B is displayed on the window, for example, the user name of the associated object B is "xiaoming", the server of the associated object B is "C8", the game help of the associated object B is "happy", and in addition, the server may be requested to view game data related to the associated object B by clicking "view personal information" and "view fighting power".
It will be appreciated that other functions may be extended on the map, such as displaying the location of nearby restaurants, killing game objects in a city, ranking players in a city area, locating boarding, etc., without limitation.
Further, in the embodiment of the present invention, a map service-based proximity finding method is provided, that is, a client first obtains a proximity finding instruction, where the proximity finding instruction carries a longitude coordinate, a latitude coordinate, and a radius longitude and latitude of a target object, then determines a pixel abscissa and a pixel ordinate of the target object according to the longitude coordinate and the latitude coordinate, and finally obtains object information of N associated objects according to the radius longitude and latitude, the pixel abscissa, and the pixel ordinate, and displays the object information of the N associated objects. By the method, other objects in a range can be requested to be searched, so that the interactivity among different objects is increased, and the retention degree of the application is improved.
Optionally, on the basis of the foregoing embodiments corresponding to fig. 3, in an eighth optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, the method may further include:
obtaining a map moving instruction, wherein the map moving instruction comprises a pixel abscissa and a pixel ordinate;
determining a moving distance according to the pixel abscissa and the pixel ordinate;
acquiring screen position information of a second compensation area according to the moving distance;
loading at least one third map tile according to the screen location information of the second compensation area.
In this embodiment, a map moving method based on a map service is introduced. The user can trigger a map moving instruction through a display interface of the client, the map moving instruction can be an instruction initiated by the user through clicking a mouse or an instruction initiated by touching a screen, and the map moving instruction comprises a pixel abscissa and a pixel ordinate. For convenience of introduction, please refer to fig. 14, where fig. 14 is an interface schematic diagram of the moving map according to the embodiment of the present invention, and as shown in the figure, a user may press a point P on a display screen to slide leftward, so that the map moves leftward and is displayed.
Specifically, the client may calculate a sliding screen pixel based on each frame of the operation, convert the sliding screen pixel into coordinates of a Canvas according to the sliding screen pixel, and then move parent nodes corresponding to all map tiles, where each map tile corresponds to a node, and the map tiles are all hung under one parent node, where the parent node is a node of the entire map, so that when the user moves the parent node, all map tiles under the parent node may be moved. A Canvas is a container of all User Interface (UI) components in an application. In one scenario, the existence of multiple Canvas objects may be allowed, and nesting between the Canvas objects may be allowed. Note that any UI object in a scene is a child of a Canvas object.
In practical applications, the map tiles have corresponding sizes, for example, each map tile has a size of 256 × 256, and if the magnitude of the sliding is small, the resulting movement distance is also small, and assuming that it is determined according to the pixel abscissa and the pixel ordinate that only 10 pixels are moved on the pixel abscissa and 10 pixels are not moved on the pixel ordinate. It can be seen that the moving distance is 10 pixels, and the moving distance does not exceed the size of the map tile, so that the client obtains the screen position information of the second compensation area. The second compensation area refers to a map area that needs to be displayed, the size of the second compensation area has a correlation with the movement distance, and in general, the larger the movement distance, the larger the size of the second compensation area. The screen position information of the second compensation area specifically refers to a position of an image (image) on a screen coordinate, and based on a screen vacancy filling algorithm, after the screen position information is acquired, the map tile on the position is directly loaded, that is, at least one third map tile is loaded.
If the sliding amplitude is larger, the obtained moving distance is also larger, and if it is determined that only 1000 pixels are moved on the pixel abscissa and 2000 pixels are moved on the pixel ordinate according to the pixel abscissa and the pixel ordinate, it can be seen that the moving distance is 2000 pixels and 1000 pixels, which exceeds the size of one map tile, and thus the client acquires the screen position information of the second compensation area. The screen position information of the second compensation area needs to be created again, and the screen position information of the map tile cannot be directly used. Based on the screen gap filling algorithm, after the screen position information is created, the map tile at the position is directly loaded, namely, at least one third map tile is loaded.
It should be noted that the screen gap filling algorithm is as described in the second embodiment, the third embodiment and the fourth embodiment corresponding to fig. 3, and is not described herein again.
Further, in the embodiment of the present invention, a map moving method based on map services is provided, that is, a client first obtains a map moving instruction, where the map moving instruction includes a pixel abscissa and a pixel ordinate, then the client may determine a moving distance according to the pixel abscissa and the pixel ordinate, the client obtains screen position information of a second compensation area according to the moving distance, and finally the client loads at least one third map tile according to the screen position information of the second compensation area. Through the mode, the user can slide on the display interface of the client according to the requirement, so that different areas on the map can be seen on the display interface, and the flexibility and operability of map operation are improved.
Optionally, on the basis of the foregoing embodiments corresponding to fig. 3, in a ninth optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, the method may further include:
acquiring a map zooming instruction, wherein the map zooming instruction carries a pixel coordinate of a first position and a pixel coordinate of a second position, the pixel coordinate of the first position comprises a first pixel abscissa and a first pixel ordinate, and the pixel coordinate of the second position comprises a second pixel abscissa and a second pixel ordinate;
determining the position of a central point according to the pixel coordinates of the first position and the pixel coordinates of the second position, wherein the central point is the central position of the straight-line distance between the first position and the second position;
controlling the map to zoom by taking the central point as a father node;
and when the scaling of the zooming processing reaches a preset scale, acquiring the updated map according to the target depth value.
In this embodiment, a map zooming mode based on a map service is introduced, and in practical applications, there are two general map zooming modes, the first mode is fixed zooming, that is, a "+" and "-" touch modules are provided on a display interface, and when a user clicks the "+" module, the map is correspondingly enlarged, so that a finer structure on the map can be seen. Conversely, when the user clicks on the "-" module, the map is correspondingly zoomed out, thereby allowing a larger area on the map to be seen. The second way is selective zooming, that is, a user can select two touch points on the display interface, and when the two touch points are pressed to slide towards the edge of the screen, the map can be controlled to be correspondingly enlarged, so that a finer structure on the map can be seen. When two touch points are pressed to slide towards the center of the screen, the map can be controlled to shrink correspondingly, so that a larger range on the map can be seen. The second control method will be described as an example in the present embodiment.
For the second control method, the position of zooming may be the center position between two touch points. Specifically, referring to fig. 15, fig. 15 is an interface schematic diagram of zooming a map according to an embodiment of the present invention, as shown in the figure, after obtaining a map zooming instruction, a client may determine a pixel coordinate of a first position and a pixel coordinate of a second position according to the map zooming instruction, where the first position may be a position shown by a point a in fig. 15, and the second position may be a position shown by a point B in fig. 15, so that the pixel coordinate of the first position is a pixel coordinate of the point a, and the pixel coordinate of the first position includes a first pixel abscissa and a first pixel ordinate. Similarly, the pixel coordinate of the second position is the pixel coordinate of the point B, and the pixel coordinate of the second position includes a second pixel abscissa and a second pixel ordinate. The client may determine a center point position between the pixel coordinates of the first position and the pixel coordinates of the second position, and the center point position between the points a and B in fig. 15 may be point C.
The client controls the map to zoom by taking a central point position (for example, point C) as a parent node, specifically, the parent node is moved to the central point position (for example, point C), wherein each map tile corresponds to one node, taking fig. 15 as an example, the parent node is a node corresponding to the map tile where the point C is located, and then the map is zoomed in proportion, and if the zoom ratio reaches a preset ratio, the updated map needs to be obtained according to a target depth value. This is because the map is already at the maximum size or the minimum size at the current scale when it is zoomed to a certain extent, and therefore, it is necessary to convert the depth value of the current map and then change the map to the original normal size, that is, when the map is zoomed to a value, the tile level is directly changed to obtain the map tile at the latest tile level. The new map tile is retrieved according to the latest depth value (i.e., the target depth value), and an updated map is generated based on the new map tile. And after the zooming is finished, the father node is moved to the original position, so that the normal movement is ensured.
Further, in the embodiment of the present invention, a map scaling manner based on a map service is provided, that is, a client first obtains a map scaling instruction, then determines a center point position according to a pixel coordinate of a first position and a pixel coordinate of a second position, then controls a map to be scaled by using the center point position as a parent node, and when a scaling of the scaling reaches a preset scale, obtains an updated map according to a target depth value. Through the mode, a user can zoom the map on the display interface of the client according to requirements, so that areas with different description accuracies on the map can be seen on the display interface, the fine structure of the map can be seen under the condition of zooming in, the rough structure of the map can be seen under the condition of zooming out, and the flexibility and operability of map operation are improved. In addition, the zoom can be performed on a specific area, and the purpose of targeted zoom is achieved.
Optionally, on the basis of the foregoing embodiments corresponding to fig. 3, in a tenth optional embodiment of the map service-based service processing method provided in the embodiment of the present invention, the method may further include:
acquiring a first object selection instruction and a second object selection instruction;
determining a first longitude coordinate and a first latitude coordinate corresponding to the first position according to the first object selection instruction, and determining a second longitude coordinate and a second latitude coordinate corresponding to the second position according to the second object selection instruction;
determining a distance between the first location and the second location according to the first longitude coordinate, the first latitude coordinate, the second longitude coordinate and the second latitude coordinate;
the distance between the first and second positions is shown.
In this example, a way of determining the actual distance between two locations is described, it being understood that the earth is a nearly standard ellipsoid with an equator radius of 6378.140 km, a polar radius of 6356.755 km, and an average radius of 6371.004 km. Assuming that the earth is a sphere, the radius of the sphere is the average radius of the earth and can be denoted as R. If the meridian of 0 degree is taken as a reference, the earth surface distance between any two points on the earth surface can be calculated according to the longitude and latitude of the two points. It should be noted that errors in the calculation due to the earth surface topography are ignored here, and are only theoretically estimated values.
Specifically, for convenience of description, please refer to fig. 16, and fig. 16 is an interface schematic diagram illustrating an embodiment of obtaining a linear distance between two points, where as shown in the figure, a user selects two positions on a display interface of a client, that is, triggers a first object selection instruction and a second object selection instruction, where the first object selection instruction is an instruction for selecting a first position, and the second object selection instruction is an instruction for selecting a second position. Taking fig. 16 as an example, the first position is point a, and the second position is point B. Based on the LBS, a first longitude coordinate corresponding to the first position and a first latitude coordinate may be determined, the first longitude coordinate may be represented as LonA, and the first latitude coordinate may be represented as LatA. And a second longitude coordinate and a second latitude coordinate corresponding to the second position, where the second longitude coordinate may be denoted as LonB and the second latitude coordinate may be denoted as LatB. Next, according to the reference of 0 degree warp, the east warp takes the positive value of Longitude (Longitude), the west warp takes the negative value of Longitude (-Longitude), the north weft takes the 90 degree-Latitude value (90 ° -Latitude), the south weft takes the 90 degree + Latitude value (90 ° + Latitude), then the first position (point a) after the above processing is marked as (MLonA, mlataa), and the second position (point B) is marked as (MLonB, MLatB).
The way to calculate the distance between two points can be derived from the trigonometric derivation, and the distance between the first position and the second position is calculated as follows:
C=sin(MLatA)*sin(MLatB)*cos(MLonA-MLonB)+cos(MLatA)*cos(MLatB);
Distance=R*arccos(C)*Pi/180
where C denotes an offset angle, MLatA denotes a longitude coordinate obtained after the first position processing, MLatB denotes a longitude coordinate obtained after the second position processing, MLonA denotes a latitude coordinate obtained after the first position processing, MLonB denotes a latitude coordinate obtained after the second position processing, R denotes an average radius of the earth, which may be 6371.004 km, Pi denotes a circumference ratio, which may be 3.1415, and Distance denotes a Distance between the first position and the second position.
As can be seen from fig. 16, after the distances between the points a and B are obtained, presentation can also be performed on the display interface of the client.
Further, in the embodiment of the present invention, a manner of determining an actual distance between two locations is provided, that is, the client may trigger the first object selection instruction and the second object selection instruction, then determine a first longitude coordinate and a first latitude coordinate corresponding to the first location according to the first object selection instruction, determine a second longitude coordinate and a second latitude coordinate corresponding to the second location according to the second object selection instruction, and finally calculate and display the distance between the first location and the second location by combining the first longitude coordinate, the first latitude coordinate, the second longitude coordinate, and the second latitude coordinate. Through the mode, the user can click any two positions on the display interface, so that the distance between the two positions is obtained, the user can conveniently check the distance between the user and other users, or check the distance between different positions, and the convenience and flexibility of interaction are improved.
Referring to fig. 17, fig. 17 is a schematic view of an embodiment of a client according to the present invention, where the client 20 is applied to a unity engine, and the client 20 includes:
an access module 201, configured to acquire a service access instruction, where the service access instruction carries location information of a target object;
an obtaining module 202, configured to obtain, based on the location information of the target object, a first map tile corresponding to the target object, where the first map tile is a map tile where the target object is located;
a generating module 203, configured to generate a target map according to the first map tile acquired by the acquiring module 202, where the target map includes a second map tile set, the second map tile set has an association relationship with the first map tile, and the second map tile set includes at least one second map tile;
a display module 204, configured to display the target map generated by the generation module 203 through the target application.
Optionally, the service access instruction is used for accessing a map service in the target application, where the map service is a service generated by a unity engine.
In this embodiment, when the service access instruction is obtained, the access module 201 accesses the map service in the target application, wherein the map service is a service generated by a unity engine, the service access instruction carries position information of a target object, the obtaining module 202 obtains a first map tile corresponding to the target object based on the position information of the target object, wherein the first map tile is a map tile where the target object is located, the generating module 203 generates the target map according to the first map tile acquired by the acquiring module 202, wherein the target map comprises a second set of map tiles having an association relationship with the first map tile, the second map tile set comprises at least one second map tile, and the display module 204 displays the target map generated by the generation module 203 through the target application.
In the embodiment of the invention, a map service-based client is provided, and a map service developed based on a unity engine can support the realization of cross-platform access, so that the same map service can be accessed when applications under different operating systems are developed, thereby realizing the undifferentiated development of the applications.
Optionally, on the basis of the embodiment corresponding to fig. 17, in another embodiment of the client 20 provided in the embodiment of the present invention,
the obtaining module 202 is specifically configured to obtain a longitude coordinate and a latitude coordinate corresponding to the target object according to the service access instruction;
determining a tile abscissa and a tile ordinate according to the longitude coordinate and the latitude coordinate;
determining a pixel abscissa and a pixel ordinate according to the longitude coordinate and the latitude coordinate;
determining a location of the first map tile on the target map according to the tile abscissa, the tile ordinate, the pixel abscissa, and the pixel ordinate.
Secondly, in the embodiment of the present invention, a manner of obtaining the first map tile is provided. By the method, the position where the map tile should appear on the display interface of the client can be accurately positioned based on the map service, so that the feasibility and operability of the scheme are improved.
Optionally, on the basis of the embodiment corresponding to fig. 17, please refer to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention, the client 20 further includes a processing module 205;
the processing module 205 is configured to obtain a screen sliding instruction after the display module displays the target map;
determining an overlapping area of a first display area and a second display area according to the screen sliding instruction, wherein the first display area is used for displaying a preset map, and the second display area is used for displaying the target map;
determining a first compensation area according to the first display area and the overlapping area, and determining a second compensation area according to the second display area and the overlapping area;
and processing the target map according to the first compensation area and the second compensation area.
Secondly, the embodiment of the invention provides a screen filling algorithm based on map services, and the number of the tile map and the pixel points of the tile map can be calculated according to the longitude and latitude and then can be displayed on a display interface of the terminal equipment. The number of pictures of the tile map required by the display screen can be created and recycled whenever, so that the feasibility and operability of the scheme are improved.
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is specifically configured to, if the first compensation area is greater than or equal to the second compensation area, obtain screen position information corresponding to the first compensation area;
determining the screen position information corresponding to the first compensation area as the screen position information of the second compensation area;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
The embodiment of the present invention provides another screen gap filling algorithm based on a map service, where if the first compensation area is greater than or equal to the second compensation area, the client obtains screen position information corresponding to the first compensation area, then determines the screen position information corresponding to the first compensation area as screen position information of the second compensation area, and finally loads at least one third map tile according to the screen position information of the second compensation area. In this way, when the first compensation area is greater than or equal to the second compensation area, new screen position information does not need to be created again, and the screen position information of the missing part is supplemented by the created screen position information, so that the number of created screen position information is reduced, the processing efficiency of the device is improved, and meanwhile, the computing resources are saved.
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is specifically configured to create screen position information if the first compensation area is smaller than the second compensation area;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
In the embodiment of the present invention, another screen gap filling algorithm based on a map service is provided, where if the first compensation area is smaller than the second compensation area, the client needs to create screen position information, and then loads at least one third map tile according to the screen position information of the second compensation area, and in the above manner, new screen position information needs to be created again only when the first compensation area is smaller than the second compensation area, so that the number of created screen position information is reduced, the processing efficiency of the device is improved, and meanwhile, the computing resources are saved.
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is further configured to obtain a first moving instruction after the display module 204 displays the target map;
and if the target map is determined to reach a latitude boundary according to the first moving instruction, controlling the target map to stop moving, wherein the latitude boundary represents the latitude line where the north pole is located and the latitude line where the south pole is located.
Secondly, in the embodiment of the invention, a moving mode reaching a latitude boundary is provided, considering that a world map has a striding property in latitude, in order to be close to reality, a limit needs to be made when moving to the south-most end and the north-most end, so that the feasibility and operability of a scheme are improved, and the limit is applied to limit the moving process not to exceed the maximum area of the map.
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is further configured to, after the displaying module 204 displays the target map, obtain a second moving instruction, where the longitude moving instruction corresponds to a target direction;
and if the longitude boundary is determined to be reached according to the second movement instruction, controlling the target map to continuously move from the longitude boundary along the target direction, wherein the longitude boundary is preset longitude.
Secondly, in the embodiment of the present invention, a moving manner of reaching a longitude boundary is provided, that is, the client acquires a second moving instruction, the longitude moving instruction corresponds to the target direction, and if it is determined according to the second moving instruction that the longitude boundary has been reached, the target map is controlled to move continuously along the target direction from the longitude boundary, and the longitude boundary is a preset longitude. By the method, the world map is continuous in longitude, and in order to be close to reality, a cycle needs to be performed when the world map moves in the east longitude or west longitude direction, namely, the map can be continuously visited by a user by using a cycle display mode, so that the feasibility and operability of a scheme are improved.
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is further configured to obtain a nearby search instruction, where the nearby search instruction carries the longitude coordinate, the latitude coordinate, and the radius longitude and latitude of the target object;
acquiring object information of N associated objects according to the longitude coordinate, the latitude coordinate and the radius longitude and latitude, wherein N is an integer greater than or equal to 0;
and displaying the object information of the N associated objects.
Further, the embodiment of the invention provides a map service-based proximity searching method, which can request to search other objects in a range, thereby increasing interactivity among different objects and improving retention of applications.
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is further configured to obtain a map moving instruction, where the map moving instruction includes a pixel abscissa and a pixel ordinate;
determining a moving distance according to the pixel abscissa and the pixel ordinate;
acquiring screen position information of a second compensation area according to the moving distance;
loading at least one third map tile according to the screen location information of the second compensation area.
Further, in the embodiment of the present invention, a map moving method based on map services is provided, and a user can slide on a display interface of a client according to a requirement, so that different areas on a map can be seen on the display interface, and thus, flexibility and operability of map operations are improved.
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is further configured to obtain a map zooming instruction, where the map zooming instruction carries a pixel coordinate of a first location and a pixel coordinate of a second location, the pixel coordinate of the first location includes a first pixel abscissa and a first pixel ordinate, and the pixel coordinate of the second location includes a second pixel abscissa and a second pixel ordinate;
determining a central point position according to the pixel coordinates of the first position and the pixel coordinates of the second position, wherein the central point position is the central position of the straight-line distance between the first position and the second position;
carrying out zooming processing by taking the central point position as a father node control map;
and when the scaling of the zooming processing reaches a preset scale, acquiring the updated map according to the target depth value.
Further, in the embodiment of the present invention, a map scaling method based on a map service is provided, and a user may scale a map on a display interface of a client according to a requirement, so that areas with different description accuracies on the map can be seen on the display interface, and not only a fine structure of the map can be seen in an enlarged condition, but also a rough structure of the map can be seen in a reduced condition, thereby improving flexibility and operability of map operations. In addition, the zoom can be performed for a specific area, so that the purpose of targeted zoom is achieved,
Alternatively, on the basis of the embodiment corresponding to fig. 18, in another embodiment of the client 20 provided in the embodiment of the present invention,
the processing module 205 is further configured to obtain a first object selection instruction and a second object selection instruction;
determining a first longitude coordinate and a first latitude coordinate corresponding to a first position according to the first object selection instruction, and determining a second longitude coordinate and a second latitude coordinate corresponding to a second position according to the second object selection instruction;
determining a distance between the first location and the second location based on the first longitude coordinate, the first latitude coordinate, a second longitude coordinate, and a second latitude coordinate;
showing a distance between the first location and the second location.
Furthermore, in the embodiment of the present invention, a manner of determining an actual distance between two positions is provided, and a user can click any two positions on a display interface, so as to obtain a distance between the two positions, which is convenient for the user to view the distance between the user and other users, or to view the distances between different positions, and is beneficial to improving convenience and flexibility of interaction.
As shown in fig. 19, for convenience of description, only the parts related to the embodiment of the present invention are shown, and details of the specific technology are not disclosed, please refer to the method part of the embodiment of the present invention. The terminal device may be any terminal device including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a Point of Sales (POS), a vehicle-mounted computer, and the like, taking the terminal device as the mobile phone as an example:
fig. 19 is a block diagram showing a partial structure of a cellular phone related to a terminal device provided in an embodiment of the present invention. Referring to fig. 19, the cellular phone includes: radio Frequency (RF) circuit 310, memory 320, input unit 330, display unit 340, sensor 350, audio circuit 360, wireless fidelity (WiFi) module 370, processor 380, and power supply 390. Those skilled in the art will appreciate that the handset configuration shown in fig. 19 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 19:
the RF circuit 310 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information of a base station and then processes the received downlink information to the processor 380; in addition, the data for designing uplink is transmitted to the base station. In general, the RF circuit 310 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuit 310 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to global system for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
The memory 320 may be used to store software programs and modules, and the processor 380 executes various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 320. The memory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 320 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 330 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 330 may include a touch panel 331 and other input devices 332. The touch panel 331, also referred to as a touch screen, can collect touch operations of a user (e.g., operations of the user on the touch panel 331 or near the touch panel 331 using any suitable object or accessory such as a finger, a stylus, etc.) on or near the touch panel 331, and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 331 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch panel 331 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 330 may include other input devices 332 in addition to the touch panel 331. In particular, other input devices 332 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 340 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 340 may include a display panel 341, and optionally, the display panel 341 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 331 can cover the display panel 341, and when the touch panel 331 detects a touch operation on or near the touch panel 331, the touch panel is transmitted to the processor 380 to determine the type of the touch event, and then the processor 380 provides a corresponding visual output on the display panel 341 according to the type of the touch event. Although in fig. 19, the touch panel 331 and the display panel 341 are two separate components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 331 and the display panel 341 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 350, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 341 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 341 and/or the backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 370, and provides wireless broadband internet access for the user. Although fig. 19 shows the WiFi module 370, it is understood that it does not belong to the essential constitution of the handset, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 380 is a control center of the mobile phone, connects various parts of the whole mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory 320, thereby performing overall monitoring of the mobile phone. Optionally, processor 380 may include one or more processing units; optionally, processor 380 may integrate an application processor, which primarily handles operating systems, user interfaces, application programs, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 380.
The handset also includes a power supply 390 (e.g., a battery) for powering the various components, optionally, the power supply may be logically connected to the processor 380 through a power management system, so that the power management system may be used to manage charging, discharging, and power consumption.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In this embodiment of the present invention, the processor 380 included in the terminal device further has the following functions:
acquiring a service access instruction, wherein the service access instruction carries position information of a target object;
acquiring a first map tile corresponding to the target object based on the position information of the target object, wherein the first map tile is a map tile where the target object is located;
generating a target map according to the first map tiles, wherein the target map comprises a second map tile set, the second map tile set has an association relationship with the first map tiles, and the second map tile set comprises at least one second map tile;
and displaying the target map.
Optionally, the service access instruction is used for accessing a map service in the target application, where the map service is a service generated by a unity engine.
Optionally, the processor 380 is specifically configured to perform the following steps:
acquiring a longitude coordinate and a latitude coordinate corresponding to the target object according to the service access instruction;
determining a tile abscissa and a tile ordinate according to the longitude coordinate and the latitude coordinate;
determining a pixel abscissa and a pixel ordinate according to the longitude coordinate and the latitude coordinate;
determining a location of the first map tile on the target map according to the tile abscissa, the tile ordinate, the pixel abscissa, and the pixel ordinate.
Optionally, the processor 380 is further configured to perform the following steps:
acquiring a screen sliding instruction;
determining an overlapping area of a first display area and a second display area according to the screen sliding instruction, wherein the first display area is used for displaying a preset map, and the second display area is used for displaying the target map;
determining a first compensation area according to the first display area and the overlapping area, and determining a second compensation area according to the second display area and the overlapping area;
and processing the target map according to the first compensation area and the second compensation area.
Optionally, the processor 380 is specifically configured to perform the following steps:
if the first compensation area is larger than or equal to the second compensation area, screen position information corresponding to the first compensation area is obtained;
determining the screen position information corresponding to the first compensation area as the screen position information of the second compensation area;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
Optionally, the processor 380 is specifically configured to perform the following steps:
if the first compensation area is smaller than the second compensation area, screen position information is created;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
Optionally, the processor 380 is further configured to perform the following steps:
acquiring a first moving instruction;
and if the target map is determined to reach a latitude boundary according to the first moving instruction, controlling the target map to stop moving, wherein the latitude boundary represents the latitude line where the north pole is located and the latitude line where the south pole is located.
Optionally, the processor 380 is further configured to perform the following steps:
obtaining a second movement instruction, wherein the longitude movement instruction corresponds to a target direction;
and if the longitude boundary is determined to be reached according to the second movement instruction, controlling the target map to continuously move from the longitude boundary along the target direction, wherein the longitude boundary is preset longitude.
Optionally, the processor 380 is further configured to perform the following steps:
acquiring a nearby searching instruction, wherein the nearby searching instruction carries the longitude coordinate, the latitude coordinate and the radius longitude and latitude of the target object;
acquiring object information of N associated objects according to the longitude coordinate, the latitude coordinate and the radius longitude and latitude, wherein N is an integer greater than or equal to 0;
and displaying the object information of the N associated objects.
Optionally, the processor 380 is further configured to perform the following steps:
obtaining a map moving instruction, wherein the map moving instruction comprises a pixel abscissa and a pixel ordinate;
determining a moving distance according to the pixel abscissa and the pixel ordinate;
acquiring screen position information of a second compensation area according to the moving distance;
loading at least one third map tile according to the screen location information of the second compensation area.
Optionally, the processor 380 is further configured to perform the following steps:
obtaining a map zooming instruction, wherein the map zooming instruction carries a pixel coordinate of a first position and a pixel coordinate of a second position, the pixel coordinate of the first position comprises a first pixel abscissa and a first pixel ordinate, and the pixel coordinates of the second position comprises a second pixel abscissa and a second pixel ordinate;
determining a central point position according to the pixel coordinates of the first position and the pixel coordinates of the second position, wherein the central point position is the central position of the straight-line distance between the first position and the second position;
carrying out zooming processing by taking the central point position as a father node control map;
and when the scaling of the zooming processing reaches a preset scale, acquiring the updated map according to the target depth value.
Optionally, the processor 380 is further configured to perform the following steps:
acquiring a first object selection instruction and a second object selection instruction;
determining a first longitude coordinate and a first latitude coordinate corresponding to a first position according to the first object selection instruction, and determining a second longitude coordinate and a second latitude coordinate corresponding to a second position according to the second object selection instruction;
determining a distance between the first location and the second location based on the first longitude coordinate, the first latitude coordinate, a second longitude coordinate, and a second latitude coordinate;
showing a distance between the first location and the second location.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (15)
1. A service processing method based on map service is characterized by comprising the following steps:
acquiring a service access instruction, wherein the service access instruction carries position information of a target object;
acquiring a first map tile corresponding to the target object based on the position information of the target object, wherein the first map tile is a map tile where the target object is located;
generating a target map according to the first map tiles, wherein the target map comprises a second map tile set, the second map tile set has an association relationship with the first map tiles, and the second map tile set comprises at least one second map tile;
and displaying the target map.
2. The method of claim 1, wherein the service access instruction is used for accessing a map service in a target application, wherein the map service is a service generated by a unity engine.
3. The method of claim 1, wherein the obtaining the first map tile corresponding to the target object based on the location information of the target object comprises:
acquiring a longitude coordinate and a latitude coordinate corresponding to the target object according to the service access instruction;
determining a tile abscissa and a tile ordinate according to the longitude coordinate and the latitude coordinate;
determining a pixel abscissa and a pixel ordinate according to the longitude coordinate and the latitude coordinate;
determining a location of the first map tile on the target map according to the tile abscissa, the tile ordinate, the pixel abscissa, and the pixel ordinate.
4. The method of claim 1, wherein after said presenting the target map, the method further comprises:
acquiring a screen sliding instruction;
determining an overlapping area of a first display area and a second display area according to the screen sliding instruction, wherein the first display area is used for displaying a preset map, and the second display area is used for displaying the target map;
determining a first compensation area according to the first display area and the overlapping area, and determining a second compensation area according to the second display area and the overlapping area;
and processing the target map according to the first compensation area and the second compensation area.
5. The method of claim 4, wherein the processing the target map according to the first compensation zone comprises:
if the first compensation area is larger than or equal to the second compensation area, screen position information corresponding to the first compensation area is obtained;
determining the screen position information corresponding to the first compensation area as the screen position information of the second compensation area;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
6. The method of claim 4, wherein the processing the target map according to the first compensation zone comprises:
if the first compensation area is smaller than the second compensation area, screen position information is created;
loading at least one third map tile according to the screen position information of the second compensation area, wherein the at least one third map tile is displayed in the second display area.
7. The method of claim 1, wherein after said presenting the target map, the method further comprises:
acquiring a first moving instruction;
and if the target map is determined to reach a latitude boundary according to the first moving instruction, controlling the target map to stop moving, wherein the latitude boundary represents the latitude line where the north pole is located and the latitude line where the south pole is located.
8. The method of claim 1, wherein after said presenting the target map, the method further comprises:
obtaining a second movement instruction, wherein the longitude movement instruction corresponds to a target direction;
and if the longitude boundary is determined to be reached according to the second movement instruction, controlling the target map to continuously move from the longitude boundary along the target direction, wherein the longitude boundary is a preset longitude.
9. The method according to any one of claims 1 to 8, further comprising:
acquiring a nearby searching instruction, wherein the nearby searching instruction carries the longitude coordinate, the latitude coordinate and the radius longitude and latitude of the target object;
acquiring object information of N associated objects according to the longitude coordinate, the latitude coordinate and the radius longitude and latitude, wherein N is an integer greater than or equal to 0;
and displaying the object information of the N associated objects.
10. The method according to any one of claims 1 to 8, further comprising:
obtaining a map moving instruction, wherein the map moving instruction comprises a pixel abscissa and a pixel ordinate;
determining a moving distance according to the pixel abscissa and the pixel ordinate;
acquiring screen position information of a second compensation area according to the moving distance;
loading at least one third map tile according to the screen location information of the second compensation area.
11. The method according to any one of claims 1 to 8, further comprising:
obtaining a map zooming instruction, wherein the map zooming instruction carries a pixel coordinate of a first position and a pixel coordinate of a second position, the pixel coordinate of the first position comprises a first pixel abscissa and a first pixel ordinate, and the pixel coordinates of the second position comprises a second pixel abscissa and a second pixel ordinate;
determining a central point position according to the pixel coordinates of the first position and the pixel coordinates of the second position, wherein the central point position is the central position of the straight-line distance between the first position and the second position;
carrying out zooming processing by taking the central point position as a father node control map;
and when the scaling of the zooming processing reaches a preset scale, acquiring the updated map according to the target depth value.
12. The method according to any one of claims 1 to 8, further comprising:
acquiring a first object selection instruction and a second object selection instruction;
determining a first longitude coordinate and a first latitude coordinate corresponding to a first position according to the first object selection instruction, and determining a second longitude coordinate and a second latitude coordinate corresponding to a second position according to the second object selection instruction;
determining a distance between the first location and the second location based on the first longitude coordinate, the first latitude coordinate, a second longitude coordinate, and a second latitude coordinate;
showing a distance between the first location and the second location.
13. A client, comprising:
the access module is used for acquiring a service access instruction, wherein the service access instruction carries the position information of a target object;
an obtaining module, configured to obtain, based on location information of the target object, a first map tile corresponding to the target object, where the first map tile is a map tile where the target object is located;
a generating module, configured to generate a target map according to the first map tile acquired by the acquiring module, where the target map includes a second map tile set, the second map tile set has an association relationship with the first map tile, and the second map tile set includes at least one second map tile;
and the display module is used for displaying the target map generated by the generation module.
14. A terminal device, comprising: a memory, a transceiver, a processor, and a bus system;
wherein the memory is used for storing programs;
the processor is configured to execute the program in the memory, including performing the method of any of steps 1-12 above;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
15. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1 to 12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910954560.3A CN110704057B (en) | 2019-10-09 | 2019-10-09 | Service processing method based on map service and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910954560.3A CN110704057B (en) | 2019-10-09 | 2019-10-09 | Service processing method based on map service and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110704057A true CN110704057A (en) | 2020-01-17 |
CN110704057B CN110704057B (en) | 2021-04-27 |
Family
ID=69198921
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910954560.3A Active CN110704057B (en) | 2019-10-09 | 2019-10-09 | Service processing method based on map service and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110704057B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111445576A (en) * | 2020-03-17 | 2020-07-24 | 腾讯科技(深圳)有限公司 | Map data acquisition method and device, storage medium and electronic device |
CN111858822A (en) * | 2020-07-28 | 2020-10-30 | 自然资源部第一海洋研究所 | Method and device for displaying spliced pictures of GIS map |
CN112055216A (en) * | 2020-10-30 | 2020-12-08 | 成都四方伟业软件股份有限公司 | Method and device for rapidly loading mass of oblique photography based on Unity |
CN112131332A (en) * | 2020-09-25 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Information point updating method and device, electronic equipment and computer storage medium |
CN112717385A (en) * | 2021-01-20 | 2021-04-30 | 上海莉莉丝网络科技有限公司 | Attribution control method, system and computer readable storage medium of map pixels in game map |
CN112802143A (en) * | 2021-01-26 | 2021-05-14 | 北京世纪高通科技有限公司 | Spherical map drawing method, spherical map drawing device and storage medium |
CN114061599A (en) * | 2020-07-31 | 2022-02-18 | 华为技术有限公司 | Navigation positioning method, electronic equipment and navigation positioning system |
CN114299142A (en) * | 2021-12-24 | 2022-04-08 | 北京庚图科技有限公司 | Missile threat range determining method and device on two-dimensional world map |
CN115727869A (en) * | 2021-08-31 | 2023-03-03 | 北京嘀嘀无限科技发展有限公司 | Map display method, map display device, computer equipment, medium and program product |
CN117573917A (en) * | 2024-01-19 | 2024-02-20 | 成都深瑞同华科技有限公司 | Map picture intercepting method, system, electronic equipment and medium |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103425655A (en) * | 2012-05-16 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Method and device for searching venue information for location based service |
CN104537068A (en) * | 2014-12-29 | 2015-04-22 | 浙江宇视科技有限公司 | Electronic map accessing method and device |
CN104898947A (en) * | 2015-05-26 | 2015-09-09 | 中国民航大学 | Method for implementing scaling and translation of GDI electronic vector map based on mouse position |
US20160275904A1 (en) * | 2005-07-14 | 2016-09-22 | Telecommunication Systems, Inc. | Tiled map display on a wireless device |
CN106325731A (en) * | 2015-07-03 | 2017-01-11 | Lg电子株式会社 | Display device and method of controlling therefor |
CN106471488A (en) * | 2013-09-05 | 2017-03-01 | 脸谱公司 | Tiling technique for the server controls based on positional information |
CN106775225A (en) * | 2016-12-02 | 2017-05-31 | 西安电子科技大学 | The method that across document seamless roam browses PDF maps |
CN107423445A (en) * | 2017-08-10 | 2017-12-01 | 腾讯科技(深圳)有限公司 | A kind of map data processing method, device and storage medium |
CN108681453A (en) * | 2018-05-21 | 2018-10-19 | 京东方科技集团股份有限公司 | The implementation method and device of engine map |
CN109726368A (en) * | 2017-10-31 | 2019-05-07 | 腾讯科技(深圳)有限公司 | Map label method and device |
CN110222130A (en) * | 2019-04-25 | 2019-09-10 | 五八有限公司 | Map dense information disperses methods of exhibiting, device, electronic equipment and storage medium |
-
2019
- 2019-10-09 CN CN201910954560.3A patent/CN110704057B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160275904A1 (en) * | 2005-07-14 | 2016-09-22 | Telecommunication Systems, Inc. | Tiled map display on a wireless device |
CN103425655A (en) * | 2012-05-16 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Method and device for searching venue information for location based service |
CN106471488A (en) * | 2013-09-05 | 2017-03-01 | 脸谱公司 | Tiling technique for the server controls based on positional information |
CN104537068A (en) * | 2014-12-29 | 2015-04-22 | 浙江宇视科技有限公司 | Electronic map accessing method and device |
CN104898947A (en) * | 2015-05-26 | 2015-09-09 | 中国民航大学 | Method for implementing scaling and translation of GDI electronic vector map based on mouse position |
CN106325731A (en) * | 2015-07-03 | 2017-01-11 | Lg电子株式会社 | Display device and method of controlling therefor |
CN106775225A (en) * | 2016-12-02 | 2017-05-31 | 西安电子科技大学 | The method that across document seamless roam browses PDF maps |
CN107423445A (en) * | 2017-08-10 | 2017-12-01 | 腾讯科技(深圳)有限公司 | A kind of map data processing method, device and storage medium |
CN109726368A (en) * | 2017-10-31 | 2019-05-07 | 腾讯科技(深圳)有限公司 | Map label method and device |
CN108681453A (en) * | 2018-05-21 | 2018-10-19 | 京东方科技集团股份有限公司 | The implementation method and device of engine map |
CN110222130A (en) * | 2019-04-25 | 2019-09-10 | 五八有限公司 | Map dense information disperses methods of exhibiting, device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
杨万里: "基于HTML5的多种地图数据混合显示", 《中国优秀硕士学位论文全文数据库工程科技II辑》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111445576B (en) * | 2020-03-17 | 2022-09-13 | 腾讯科技(深圳)有限公司 | Map data acquisition method and device, storage medium and electronic device |
CN111445576A (en) * | 2020-03-17 | 2020-07-24 | 腾讯科技(深圳)有限公司 | Map data acquisition method and device, storage medium and electronic device |
CN111858822A (en) * | 2020-07-28 | 2020-10-30 | 自然资源部第一海洋研究所 | Method and device for displaying spliced pictures of GIS map |
CN114061599A (en) * | 2020-07-31 | 2022-02-18 | 华为技术有限公司 | Navigation positioning method, electronic equipment and navigation positioning system |
CN112131332A (en) * | 2020-09-25 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Information point updating method and device, electronic equipment and computer storage medium |
CN112055216A (en) * | 2020-10-30 | 2020-12-08 | 成都四方伟业软件股份有限公司 | Method and device for rapidly loading mass of oblique photography based on Unity |
CN112055216B (en) * | 2020-10-30 | 2021-01-22 | 成都四方伟业软件股份有限公司 | Method and device for rapidly loading mass of oblique photography based on Unity |
CN112717385B (en) * | 2021-01-20 | 2022-04-22 | 上海莉莉丝网络科技有限公司 | Attribution control method, system and computer readable storage medium of map pixels in game map |
CN112717385A (en) * | 2021-01-20 | 2021-04-30 | 上海莉莉丝网络科技有限公司 | Attribution control method, system and computer readable storage medium of map pixels in game map |
CN112802143A (en) * | 2021-01-26 | 2021-05-14 | 北京世纪高通科技有限公司 | Spherical map drawing method, spherical map drawing device and storage medium |
CN115727869A (en) * | 2021-08-31 | 2023-03-03 | 北京嘀嘀无限科技发展有限公司 | Map display method, map display device, computer equipment, medium and program product |
CN114299142A (en) * | 2021-12-24 | 2022-04-08 | 北京庚图科技有限公司 | Missile threat range determining method and device on two-dimensional world map |
CN114299142B (en) * | 2021-12-24 | 2022-11-04 | 北京庚图科技有限公司 | Missile threat range determining method and device on two-dimensional world map |
CN117573917A (en) * | 2024-01-19 | 2024-02-20 | 成都深瑞同华科技有限公司 | Map picture intercepting method, system, electronic equipment and medium |
CN117573917B (en) * | 2024-01-19 | 2024-03-29 | 成都深瑞同华科技有限公司 | Map picture intercepting method, system, electronic equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN110704057B (en) | 2021-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110704057B (en) | Service processing method based on map service and related device | |
CN105005457B (en) | Geographical location methods of exhibiting and device | |
US20220207821A1 (en) | Image rendering method and related apparatus, terminal and storage medium | |
CN104457767B (en) | The method and apparatus for realizing location-based service | |
CN103069370B (en) | For automatically generating the method for the Information Level of suggestion, device and computer program in augmented reality | |
US9367961B2 (en) | Method, device and storage medium for implementing augmented reality | |
CN109933638B (en) | Target area contour determination method and device based on electronic map and storage medium | |
US11394871B2 (en) | Photo taking control method and system based on mobile terminal, and storage medium | |
CN108513671B (en) | Display method and terminal for 2D application in VR equipment | |
EP2672400A1 (en) | Apparatus and method of tracking location of wireless terminal based on image | |
CN107493311B (en) | Method, device and system for realizing control equipment | |
US20150002539A1 (en) | Methods and apparatuses for displaying perspective street view map | |
CN109726368B (en) | Map marking method and device | |
CN111464825B (en) | Live broadcast method based on geographic information and related device | |
CN105303591B (en) | Method, terminal and server for superimposing location information on jigsaw puzzle | |
US9495773B2 (en) | Location map submission framework | |
CN103458362B (en) | Numeric value transfer, terminal, server and system | |
CN110536236B (en) | Communication method, terminal equipment and network equipment | |
CN110891122A (en) | Wallpaper pushing method and electronic equipment | |
CN106204588B (en) | Image processing method and device | |
CN110209449A (en) | Cursor positioning method and device in a kind of game | |
CN114422644A (en) | Device control method, device, user equipment and computer readable storage medium | |
CN109862607A (en) | A kind of network recommendation method and mobile terminal | |
CN103455588A (en) | Image indexing method and device | |
CN110168599A (en) | A kind of data processing method and terminal |
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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40020116 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |