CN116980397B - Tile downloading method, electronic equipment and storage medium - Google Patents

Tile downloading method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116980397B
CN116980397B CN202311237097.3A CN202311237097A CN116980397B CN 116980397 B CN116980397 B CN 116980397B CN 202311237097 A CN202311237097 A CN 202311237097A CN 116980397 B CN116980397 B CN 116980397B
Authority
CN
China
Prior art keywords
map
tile
downloaded
data
tiles
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311237097.3A
Other languages
Chinese (zh)
Other versions
CN116980397A (en
Inventor
祁建红
汤子楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunli Intelligent Technology Co ltd
Original Assignee
Yunli Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunli Intelligent Technology Co ltd filed Critical Yunli Intelligent Technology Co ltd
Priority to CN202311237097.3A priority Critical patent/CN116980397B/en
Publication of CN116980397A publication Critical patent/CN116980397A/en
Application granted granted Critical
Publication of CN116980397B publication Critical patent/CN116980397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a tile downloading method, electronic equipment and a storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: responding to a map tile downloading request, loading a superimposed tile layer on map data, carrying out style modification on the tile layer in the loading process, and carrying out content addition on the map data, and determining target map data and a plurality of map tiles to be downloaded; and fixing the 1 st map tile to be downloaded in the plurality of map tiles to be downloaded in the target map data, and downloading the plurality of map tiles to be downloaded based on the fixed result. Before downloading the map tiles, the invention realizes the purpose of accurately and efficiently downloading the personalized map tiles meeting different flexibility requirements for different users by adding the content of the original map data provided by the third party and modifying the style of the overlapped map layers according to the flexibility requirements of the users for downloading the map tiles.

Description

Tile downloading method, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a tile downloading method, an electronic device, and a storage medium.
Background
In the technical field of computers, map tiles refer to map slice files containing a series of scales and within a certain map range, and are organized according to a pyramid structure, and each tile can be uniquely marked by a rank and a rank number. Therefore, the map tiles can meet the higher demands of users for map display and transmission, and how to download the map tiles meeting the demands of users naturally becomes a key problem to be solved in urgent need at present.
In the related art, when a user needs to download map tiles of a certain city, determining tile numbers according to the map level and the download range of the map of the city, and then splicing the tile access address of the server with the tile numbers to form a tile file download address, and then downloading the map tiles.
However, since the map tiles are downloaded directly from the static resources provided by the third party according to the download address, the downloaded map tiles are also fixed and cannot meet the flexibility requirement of the user for the map tiles.
Disclosure of Invention
The invention provides a tile downloading method, electronic equipment and a storage medium, which are used for solving the defect that map tiles directly downloaded from static resources provided by a third party in the prior art cannot meet the flexibility requirements of users on the map tiles, realizing the purpose of accurately and efficiently downloading personalized map tiles meeting different flexibility requirements aiming at different flexibility requirements of different users, and improving the flexibility and reliability of downloading the map tiles.
The invention provides a tile downloading method, which comprises the following steps:
responding to a map tile downloading request, loading a superimposed tile layer on map data, carrying out style modification on the tile layer in the loading process, and carrying out content addition on the map data, so as to determine target map data and a plurality of map tiles to be downloaded;
and fixing the 1 st map tile to be downloaded in the map data to be downloaded, and downloading the map tiles to be downloaded based on a fixed result.
According to the tile downloading method provided by the invention, the 1 st map tile to be downloaded in the map tiles to be downloaded is fixed in the target map data, and the map tiles to be downloaded are downloaded based on the fixed result, and the method comprises the following steps:
fixing the 1 st map tile to be downloaded in the target map data, and determining the DataURL map data and the complete map tiles;
cutting the data of the DataURL corresponding to the complete map tile from the data of the DataURL map under the condition that the complete map tile exists in the map tiles to be downloaded, and downloading the data of the DataURL; characterizing that a corresponding number of map tiles to be downloaded are downloaded when the data URL data is successfully downloaded;
Removing the downloaded map tiles to be downloaded from the plurality of map tiles to be downloaded to obtain updated map tiles to be downloaded;
and determining the updated map tile to be downloaded as a new plurality of map tiles to be downloaded, and repeatedly executing the steps until the updated map tile to be downloaded is empty, so as to obtain the plurality of map tiles to be downloaded.
According to the tile downloading method provided by the invention, the 1 st map tile to be downloaded in the plurality of map tiles to be downloaded is fixed in the target map data, and the data URL map data and the complete map tiles are determined, comprising the following steps:
based on the four-way information of the 1 st map tile to be downloaded and the four-way information of the target map data, fixing the upper left corner of the 1 st map tile to be downloaded to the upper left corner of the target map data, and determining the DataURL map data added to a new canvas;
determining area IV to information of a visual area of a browser in a screen and all second tile numbers of the area IV to information under a map level corresponding to the area IV to information based on the DataURL map data;
and determining a plurality of complete map tiles based on all the second tile numbers.
According to the tile downloading method provided by the invention, the process of determining the map tiles to be downloaded comprises the following steps:
for each map level of tiles to be downloaded, determining a first tile number under the map level based on four-to-information corresponding to the map level;
and determining the map tiles to be downloaded based on the first tile number at each map level.
According to the tile downloading method provided by the invention, when the complete map tile exists in the plurality of map tiles to be downloaded, the data url data corresponding to the complete map tile is cut from the data url map data, which comprises the following steps:
searching for a second tile number in all first tile numbers under the condition that each map tile to be downloaded corresponds to a first tile number and the complete map tile corresponds to a second tile number;
and cutting the data of the DataURL corresponding to the complete map tile from the map data of the DataURL based on the searched second tile number.
According to the tile downloading method provided by the invention, the downloaded map tiles to be downloaded are removed from the plurality of map tiles to be downloaded, and updated map tiles to be downloaded are obtained, and the tile downloading method comprises the following steps:
Determining the positions of the searched second tile numbers in all the first tile numbers, and removing the map tiles to be downloaded corresponding to the positions from the plurality of map tiles to be downloaded to obtain the updated map tiles to be downloaded.
According to the tile downloading method provided by the invention, the tile layer is subjected to style modification and the map data is subjected to content addition in the loading process, wherein the style modification comprises at least one of the following steps:
setting layer filter parameters of a grid tile layer, changing image channel attributes of the grid tile layer, modifying a display style of a first tile element in a vector tile layer, and deleting a second tile element in the vector tile layer;
the content addition includes at least one of: an overlay is added over the map data and POI points are added over the map data.
According to the tile downloading method provided by the invention, the method further comprises the following steps:
and storing the downloaded map tiles to be downloaded to a server, and/or feeding back the downloaded map tiles to be downloaded to a client.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the tile downloading method as described above when executing the program.
The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a tile downloading method as described in any of the above.
According to the tile downloading method, the electronic equipment and the storage medium, when a map tile downloading request is processed, firstly, the superimposed tile layers on map data are loaded, in the loading process, the pattern modification is carried out on the tile layers, the content addition is carried out on the map data, the target map data and a plurality of map tiles to be downloaded are determined, and then the 1 st map tile to be downloaded in the plurality of map tiles to be downloaded is fixed in the target map data, and the plurality of map tiles to be downloaded are downloaded based on the fixed result. Therefore, by combining the front-end map technology, before map tiles are downloaded, according to the flexibility requirement of users on map tiles to be downloaded, original map data provided by a third party are subjected to content addition and style modification on superimposed layers, and each map tile required by the users is downloaded based on the loaded rendering effect, so that the static resources are not required to be directly downloaded for map tiles with fixed styles and fixed contents, and can be combined and edited, and therefore, the purpose of accurately and efficiently downloading personalized map tiles meeting different flexibility requirements can be achieved according to different flexibility requirements of different users, and the flexibility and reliability of the downloaded map tiles are improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a tile downloading method according to the present invention;
FIG. 2 is a second flow chart of the tile downloading method according to the present invention;
FIG. 3 is a schematic diagram of a tile downloading device according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The tile downloading method, the electronic device and the storage medium of the present invention are described below with reference to fig. 1 to 4, wherein the execution subject of the tile downloading method may be a personal computer (Personal Computer, PC), a portable device, a notebook computer, a smart phone, a tablet computer, a portable wearable device or other electronic devices; the server may be one server, or may be a server cluster formed by a plurality of servers, a cloud computing center, or the like; further, the tile downloading method can be applied to a tile downloading device arranged in an electronic device or a server, and the tile downloading device can be realized by software, hardware or a combination of the two. The tile download method will be described below by taking an electronic device as an example of an execution subject of the tile download method.
In order to facilitate understanding of the tile downloading method provided by the embodiments of the present invention, the tile downloading method provided by the present invention will be described in detail by the following several exemplary embodiments. It is to be understood that the following several exemplary embodiments may be combined with each other and that some embodiments may not be repeated for the same or similar concepts or processes.
Referring to fig. 1, one of the flow diagrams of the tile downloading method provided by the present invention, as shown in fig. 1, includes the following steps 110 and 120.
Step 110, loading the superimposed tile layers on the map data in response to the map tile downloading request, and carrying out style modification and content addition on the tile layers and the map data in the loading process to determine target map data and a plurality of map tiles to be downloaded.
The map tile downloading request carries information of a city of a map tile requested to be downloaded by a user and a flexibility requirement for the map tile of the city to be downloaded, the flexibility requirement can be, but is not limited to, a display requirement for patterns and/or data in the map tile, for example, changing a default color provided by a third party static resource in the map tile to be downloaded into a color required by the user and adding content required by the user to default data provided by the third party static resource in the map tile to be downloaded. In addition, the number of the tile layers superimposed on the map data can be determined according to actual requirements; for example, when the user requires the manhole cover and the street lamp to be displayed on the map tile which is finally downloaded, a tile layer containing the manhole cover and a tile layer containing the street lamp can be superimposed on the map data; the tile layers may include, but are not limited to, a grid tile layer and a vector tile layer.
Specifically, since OpenLayers is a JavaScript (JavaScript) library package specially provided for network geographic information system (Web Geographic Information System, web GIS) client development, and is used for realizing map data access issued in a standard format, when an electronic device detects a map tile downloading request, firstly, after instantiating a map object of a user-specified city based on an open-source two-dimensional map engine OpenLayers, map data capable of overlapping a tile layer can be created, namely, the map data is a carrier of the tile layer, and the map data can be original map data provided by a third party for the specified city; further, when the tile layers are superimposed on the map data, the superimposed tile layers are loaded, and after style modification is performed on the superimposed tile layers on the map data and content addition is performed on the map data in the loading process, target map data is obtained, so that a plurality of map tiles to be downloaded, which need to be downloaded, are determined based on the target map data.
Here, style modification is performed on the superimposed tile layers on the map data, wherein the style modification includes at least one of: setting layer filter parameters of a grid tile layer, changing image channel attributes of the grid tile layer, modifying a display style of a first tile element in a vector tile layer, and deleting a second tile element in the vector tile layer; here, the map data is subjected to content addition, wherein the content addition comprises at least one of the following: an overlay is added to the map data and a point of interest (Point of Interest, POI) point location is added to the map data.
It should be noted that, the layer filter parameters include, but are not limited to, at least one of softening degree, high light intensity, brightness, saturation, transparency, and other parameters, the image channel attributes include R (Red ), G (Green), B (Blue), and a (transparency, alpha), and the display patterns of the first tile element may include, but are not limited to, display patterns of other tile elements such as a pure black line pattern, a road grading color pattern, and a dotted line pattern; the second tile element may be a vector tile element that the user requests to delete, such as deleting all county level roads, etc.; the overlay may be a custom overlay with increased user demand, such as a key area outline specifying a city or specifying a province; POI spots may be markers of interest for increased user demand.
And 120, fixing the 1 st map tile to be downloaded in the target map data, and downloading the map tiles to be downloaded based on the fixed result.
Specifically, for the determined multiple map tiles to be downloaded and the target map data, the electronic device may fix the 1 st map tile to be downloaded in the target map data, so that the 1 st map tile to be downloaded can be loaded when the target map data is loaded, and thus the multiple map tiles to be downloaded are downloaded based on the fixed result.
It should be noted that, when the 1 st map tile to be downloaded from the plurality of map tiles to be downloaded is fixed in the target map data, if the screen size of the electronic device is large enough, the map tiles to be downloaded may be loaded into the plurality of map tiles to be downloaded in the process of loading the target map data, so that the efficiency of downloading the plurality of map tiles to be downloaded may be improved.
When a map tile downloading request is processed, the method for downloading the tiles firstly loads the superimposed tile layers on the map data, modifies the patterns of the tile layers and adds the contents of the map data in the loading process, determines target map data and a plurality of map tiles to be downloaded, and then further fixes the 1 st map tile to be downloaded in the target map data in the plurality of map tiles to be downloaded, and downloads the map tiles to be downloaded based on a fixed result. Therefore, by combining the front-end map technology, before map tiles are downloaded, according to the flexibility requirement of users on map tiles to be downloaded, original map data provided by a third party are subjected to content addition and style modification on superimposed layers, and each map tile required by the users is downloaded based on the loaded rendering effect, so that the static resources are not required to be directly downloaded for map tiles with fixed styles and fixed contents, and can be combined and edited, and therefore, the purpose of accurately and efficiently downloading personalized map tiles meeting different flexibility requirements can be achieved according to different flexibility requirements of different users, and the flexibility and reliability of the downloaded map tiles are improved.
Based on the tile downloading method shown in fig. 1, in an exemplary embodiment, considering the screen size display of the electronic device, the determined map tiles to be downloaded cannot be loaded onto the screen of the electronic device at one time, so that the downloading can be completed by multiple loading methods. Based on this, the specific implementation procedure of step 120 may include:
fixing a 1 st map tile to be downloaded in target map data in a plurality of map tiles to be downloaded, and determining data URL map data and complete map tiles; under the condition that a complete map tile exists in a plurality of map tiles to be downloaded, cutting data of the DataURL corresponding to the complete map tile from the data of the DataURL map, and downloading the data of the DataURL; characterizing that a corresponding number of map tiles to be downloaded are downloaded when the data URL data is successfully downloaded; removing the downloaded map tiles to be downloaded from the plurality of map tiles to be downloaded to obtain updated map tiles to be downloaded; and determining the updated map tile to be downloaded as a new plurality of map tiles to be downloaded, and repeatedly executing the steps until the updated map tile to be downloaded is empty, so as to obtain a plurality of map tiles to be downloaded.
The DataURL map Data may be base64 format Data URL image Data derived after fixing a 1 st map tile to be downloaded in the target map Data, and the 1 st map tile to be downloaded may be displayed in a screen visible area of the electronic device after being fixed in the target map Data; the english language of DataURL is called Data Uniform Resource Locator and refers specifically to the uniform resource locator of the data type, i.e. the address of the standard resource on the internet.
Specifically, a 1 st map tile to be downloaded in a plurality of map tiles to be downloaded is fixed in target map data, at this time, in order to determine the position of the 1 st map tile to be downloaded in the target map data, after the 1 st map tile to be downloaded is fixed in the target map data, the DataURL map data can be determined to obtain the DataURL map data, the complete map tile displayed in the current screen is determined based on the DataURL map data, whether the complete map tile is a map tile required by a user is further determined, that is, whether the complete map tile exists in the plurality of map tiles to be downloaded, and when the complete map tile exists in the plurality of map tiles to be downloaded, the DataURL data corresponding to the complete map tile can be cut from the DataURL map data and then downloaded; at this time, the number of the map tiles to be downloaded is updated, namely, the downloaded map tiles to be downloaded are removed from the map tiles to be downloaded, and when the number of the updated map tiles to be downloaded is not 0, the process is repeatedly executed; until the number of updated map tiles to be downloaded is 0.
It should be noted that, when the number of the complete map tiles determined in each repeated operation is plural, it is not necessary that the plural complete map tiles are all map tiles to be downloaded required by the user, so that whether each complete map tile is a map tile to be downloaded required by the user can be determined one by one until the map tile to be downloaded meeting the user requirement is searched from the plural complete map tiles and downloaded. In this way, it can be ensured that each map tile that is finally downloaded meets the flexibility requirements of the user.
Based on the tile downloading method shown in fig. 1, in an exemplary embodiment, since the map level of the map tile to be downloaded and the four-way information corresponding to the map level are known, the tile number of the map tile to be downloaded can be calculated, and then each map tile to be downloaded can be calculated based on the tile number. Based on this, the specific process of determining the plurality of map tiles to be downloaded in step 110 may include:
firstly, determining a first tile number under a map level based on four-to-information corresponding to the map level for the map level of each tile to be downloaded; and determining a plurality of map tiles to be downloaded based on the first tile number at each map level.
The map level may be a map zoom level, and the larger the map level is, the smaller the corresponding download range is. For example, the map level may be from 10 to 16. And, each first tile number characterizes the corresponding tile as a map tile to be downloaded.
Specifically, before downloading the map tile, firstly determining a map level (zoom) of the map tile to be downloaded and a download range (extension) corresponding to the map level, namely four-to-information corresponding to the map level; for example, the number of the cells to be processed,
[{zoom:10,extent:[115.423411,39.442758,117.514583,41.0608]}...,{zoom:16,extent:[115.423411,39.442758,117.514583,41.0608]}]。
when the determined map levels are multiple, determining the minimum tile number and the maximum tile number under each map level according to the four-to-information corresponding to each map level, wherein the minimum tile number is obtained by converting the minimum longitude and the maximum latitude in the four-to-information corresponding to the corresponding map level, and the maximum tile number is obtained by converting the maximum longitude and the minimum latitude in the four-to-information corresponding to the corresponding map level; illustratively, all first tile numbers determined at a map level of 10 may be referred to in table 1, and all first tile numbers determined at a map level of 16 may be referred to in table 2.
TABLE 1
TABLE 2
At this time, based on the minimum tile number and the maximum tile number of each map level, all the first tile numbers of the corresponding map level are determined, and then all the first tile numbers of all the map levels are summarized, so that all the first tile numbers of all the map tiles required to be downloaded can be obtained.
For all the first tile numbers, the map level may be set to be the z value in the first tile number, then the upper left corner longitude of the map tile to be downloaded corresponding to the first tile number is calculated based on formula (1), the upper left corner latitude of the map tile to be downloaded corresponding to the first tile number is calculated based on formula (2), and a map tile to be downloaded is determined based on the upper left corner longitude of the map tile to be downloaded and the upper left corner latitude of the map tile to be downloaded, where the target map data also includes the map tile to be downloaded. And repeatedly executing the process until all map tiles to be downloaded corresponding to all the first tile numbers are determined.
(1)
(2)
In the formulas (1) and (2),representing map level +.>Representing a first tileTransverse number in the sheet number, +.>Representing the longitudinal number in the first tile number, < +.>Representing the longitude of the upper left corner of the map tile to be downloaded corresponding to the first tile number,/->Representing the latitude of the left upper corner of the map tile to be downloaded corresponding to the first tile number, < >>Representing a hyperbolic sine function +.>Representing the circumference ratio>Representing an arctangent function.
Based on the tile download method shown in fig. 1 described above, in an example embodiment, to ensure that the 1 st map tile to be downloaded is fixed in the target map data to be loadable and downloaded, the DataURL map data may be determined by fixing the 1 st map tile to be downloaded to the upper left corner of the target map data, and a complete map tile that is completely displayable in the browser visible area in the screen may be determined from the DataURL map data. Based on this, the 1 st map tile to be downloaded of the plurality of map tiles to be downloaded is fixed in the target map data, and the DataURL map data and the complete map tile are determined, and the specific implementation process may include:
Based on the fourth-to-information of the 1 st map tile to be downloaded and the fourth-to-information of the target map data, fixing the upper left corner of the 1 st map tile to be downloaded to the upper left corner of the target map data, and determining the DataURL map data added to the new canvas; determining all second tile numbers of the visual area of the browser in the screen under the map level corresponding to the area IV to information based on the DataURL map data; based on all of the second tile numbers, a plurality of complete map tiles are determined.
Wherein each second tile number characterizes the corresponding tile as a complete map tile.
Specifically, after fixing the upper left corner of the 1 st map tile to be downloaded to the upper left corner of the target map data, exporting the current whole target map data into a base format image, and further adding the exported base format image onto a new canvas (canvas) to obtain the DataURL map data added to the new canvas so as to facilitate subsequent cutting of the tiles. At this time, the area four to information of the visual area of the browser in the screen can be determined according to the DataURL map data, the minimum longitude and the maximum latitude in the area four to information are converted into the minimum tile number, the maximum longitude and the minimum latitude in the area four to information are converted into the maximum tile number, and all the second tile numbers in the visual area of the current browser are obtained based on the minimum tile number and the maximum tile number. Illustratively, all second tile numbers may refer to table 3.
TABLE 3 Table 3
At this time, for all the second tile numbers, the map level corresponding to the area four to information may be set as the z value in the second tile number, then the upper left corner longitude of the complete map tile corresponding to the second tile number is calculated based on equation (1), the upper left corner latitude of the complete map tile corresponding to the second tile number is calculated based on equation (2), and a complete map tile is determined based on the upper left corner longitude of the complete map tile and the upper left corner latitude of the complete map tile, where the complete map tile is displayed in the current browser visible area. And repeatedly executing the process until all the complete map tiles corresponding to all the second tile numbers are determined.
Based on the tile downloading method shown in fig. 1, in an exemplary embodiment, when each map tile to be downloaded and the complete map tile correspond to the tile number, the complete map tile may be searched for in the plurality of map tiles to be downloaded based on the tile number. Based on the above, in the case that a complete map tile exists in a plurality of map tiles to be downloaded, cutting the DataURL data corresponding to the complete map tile from the DataURL map data, wherein the specific implementation process includes:
searching for a second tile number in all the first tile numbers under the condition that each map tile to be downloaded corresponds to the first tile number and the complete map tile corresponds to the second tile number; and cutting the data of the DataURL corresponding to the complete map tile from the map data of the DataURL based on the searched second tile number.
The DataURL map data is in a base64 format, and the cut DataURL data is also in a base64 format.
Specifically, when each map tile to be downloaded corresponds to a first tile number and the complete map tile corresponds to a second tile number, the second tile number may be searched in all the first tile numbers, and when the second tile number is searched, the complete map tile corresponding to the second tile number may be determined to be the map tile to be downloaded, and at this time, the DataURL data corresponding to the complete map tile may be cut from the DataURL map data.
It should be noted that, when the number of the complete map tiles and the number of the second tile numbers are respectively plural, the ith second tile number can be searched in all the first tile numbers, and if the ith second tile number is searched, the DataURL data corresponding to the complete map tile corresponding to the ith second tile number can be cut from the DataURL map data; if the ith second tile number is not searched, the (i+1) th second tile number can be used as a new ith second tile number, and the process of searching for the ith second tile number in all the first tile numbers is repeatedly performed. Until the plurality of complete map tiles are traversed, the map tiles to be downloaded required by all users in the plurality of complete map tiles can be completely downloaded. It should be noted that, the initial value of i is 1, and the maximum values of i and i+1 are the total number of complete map tiles.
Based on the tile downloading method shown in fig. 1, in an exemplary embodiment, when the second tile number is searched in the plurality of first tile numbers, the position of the complete map tile in the plurality of map tiles to be downloaded may be determined first, and then the plurality of map tiles to be downloaded may be updated in a manner of removing the downloaded tile from the plurality of map tiles to be downloaded. Based on this, the downloaded map tile to be downloaded is removed from the plurality of map tiles to be downloaded, and an updated map tile to be downloaded is obtained, and the specific implementation process may include:
determining the positions of the searched second tile numbers in all the first tile numbers, and removing the map tiles to be downloaded corresponding to the positions from the plurality of map tiles to be downloaded to obtain updated map tiles to be downloaded.
Specifically, since each first tile number corresponds to one map tile to be downloaded respectively, and each second tile number corresponds to one complete map tile respectively, sequence numbers can be identified for all first tile numbers respectively in advance, for example, a plurality of map tiles to be downloaded respectively identify sequence numbers representing different positions, for example, when there are 100 map tiles to be downloaded, the sequence numbers of 100 first tile numbers can be identified as 1,2,3, … …,100, and the different sequence numbers represent the positions corresponding to the first tile numbers. In this way, when the second tile number is searched in all the first tile numbers, the serial numbers of the searched second tile numbers in all the first tile numbers can be determined, and the positions of the complete map tiles corresponding to the second tile numbers in the plurality of map tiles to be downloaded are determined based on the serial numbers and the serial numbers respectively identified by all the first tile numbers, so that the map tiles corresponding to the positions to be downloaded are removed from the plurality of map tiles to be downloaded, and updated map tiles to be downloaded are obtained.
Based on the tile downloading method shown in fig. 1, in an exemplary embodiment, after all map tiles to be downloaded required by the user are downloaded, the user may be saved or fed back. Based on this, the tile downloading method provided by the invention may further include:
and storing the downloaded map tiles to be downloaded to a server, and/or feeding back the downloaded map tiles to be downloaded to the client.
Specifically, after all map tiles to be downloaded required by the user are downloaded, a preset interface can be improved, a plurality of downloaded map tiles to be downloaded are saved to a server, and/or the downloaded map tiles to be downloaded are fed back to the corresponding user of the client.
For example, referring to fig. 2, in fig. 2, tiles represent a plurality of map tiles to be downloaded for determining a required download, tiles are represented by tiles, tiles > 0 represents the total number of map tiles to be downloaded, the total number of map tiles to be downloaded is not empty and is used for limiting the number of loops, completitiles.length represents the total number of complete map tiles, j < completitiles.length represents whether all complete map tiles are completely traversed and is used for limiting the number of loops; each complete map tile in the plurality of complete map tiles can be marked as completitiles [ j ], j is the subscript of each complete map tile, namely completitiles [ j ] represents the complete map tile with the subscript of j in M complete map tiles, j is [0, M-1], M complete map tiles can be marked as completitiles [0] to completitiles [ M-1], and M is a positive integer larger than 0; determining subscript k of completitiles [ j ] in tiles, wherein the subscript k represents the position of a complete map tile completitiles [ j ] with subscript j in all map tiles to be downloaded when the map tiles to be downloaded are required by a user; k > -1 indicates that complete map tile completeTiles [ j ] with subscript j is searched in all map tiles to be downloaded. Reference may be made to the foregoing embodiments for specific implementation procedures. And will not be described in detail herein.
The tile downloading device provided by the invention is described below, and the tile downloading device and the tile downloading method described below can be correspondingly referred to each other.
Referring to fig. 3, a schematic structural diagram of a tile downloading device according to the present invention, as shown in fig. 3, the tile downloading device 300 may include a tile layer editing module 310 and a map tile downloading module 320.
The tile layer editing module 310 is configured to respond to a map tile downloading request, load a tile layer that is already superimposed on the map data, modify a style of the tile layer during the loading process, and add content to the map data, and determine the target map data and a plurality of map tiles to be downloaded.
The map tile downloading module 320 is configured to fix a 1 st map tile to be downloaded from the plurality of map tiles to be downloaded in the target map data, and download the plurality of map tiles to be downloaded based on the fixed result.
Optionally, the map tile downloading module 320 is specifically configured to fix the 1 st map tile to be downloaded in the target map data, and determine the DataURL map data and the complete map tile; under the condition that a complete map tile exists in a plurality of map tiles to be downloaded, cutting data of the DataURL corresponding to the complete map tile from the data of the DataURL map, and downloading the data of the DataURL; characterizing that a corresponding number of map tiles to be downloaded are downloaded when the data URL data is successfully downloaded; removing the downloaded map tiles to be downloaded from the plurality of map tiles to be downloaded to obtain updated map tiles to be downloaded; and determining the updated map tile to be downloaded as a new plurality of map tiles to be downloaded, and repeatedly executing the steps until the updated map tile to be downloaded is empty, so as to obtain a plurality of map tiles to be downloaded.
Optionally, the map tile downloading module 320 is specifically further configured to fix the top left corner of the 1 st map tile to be downloaded to the top left corner of the target map data based on the four-way information of the 1 st map tile to be downloaded and the four-way information of the target map data, and determine the DataURL map data added to the new canvas; determining all second tile numbers of the visual area of the browser in the screen under the map level corresponding to the area IV to information based on the DataURL map data; based on all of the second tile numbers, a plurality of complete map tiles are determined.
Optionally, the map tile downloading module 320 is specifically further configured to determine, for each map level of the tiles to be downloaded, a first tile number under the map level based on four-to-information corresponding to the map level; based on the first tile number at each map level, a plurality of map tiles to be downloaded are determined.
Optionally, the map tile downloading module 320 is specifically further configured to search for a second tile number in all the first tile numbers when each map tile to be downloaded corresponds to a first tile number and a complete map tile corresponds to a second tile number; and cutting the data of the DataURL corresponding to the complete map tile from the map data of the DataURL based on the searched second tile number.
Optionally, the map tile downloading module 320 is further specifically configured to determine the position of the searched second tile number in all the first tile numbers, and reject the map tile to be downloaded corresponding to the position from the plurality of map tiles to be downloaded, thereby obtaining the updated map tile to be downloaded.
The tile layer editing module 310 is specifically configured to perform style modification on the tile layer and content addition on the map data during loading, where the style modification includes at least one of the following: setting layer filter parameters of a grid tile layer, changing image channel attributes of the grid tile layer, modifying a display style of a first tile element in a vector tile layer, and deleting a second tile element in the vector tile layer; the content addition includes at least one of: an overlay is added to the map data and POI points are added to the map data.
Optionally, the tile downloading device provided by the invention may further include a map tile processing module, configured to save the downloaded map tiles to be downloaded to the server, and/or feed back the downloaded map tiles to be downloaded to the client.
Fig. 4 illustrates a physical schematic diagram of an electronic device, as shown in fig. 4, which may include: processor 410, communication interface 420, memory 430 and communication bus 440, wherein processor 410, communication interface 420 and memory 430 communicate with each other through communication bus 440. Processor 410 may invoke logic instructions in memory 430 to perform a tile download method comprising:
Responding to a map tile downloading request, loading a superimposed tile layer on map data, carrying out style modification on the tile layer in the loading process, and carrying out content addition on the map data, and determining target map data and a plurality of map tiles to be downloaded; and fixing the 1 st map tile to be downloaded in the plurality of map tiles to be downloaded in the target map data, and downloading the plurality of map tiles to be downloaded based on the fixed result.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-only memory (ROM), a random access memory (RAM, randomAccessMemory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of performing the tile download method provided by the methods described above, the method comprising:
responding to a map tile downloading request, loading a superimposed tile layer on map data, carrying out style modification on the tile layer in the loading process, and carrying out content addition on the map data, and determining target map data and a plurality of map tiles to be downloaded; and fixing the 1 st map tile to be downloaded in the plurality of map tiles to be downloaded in the target map data, and downloading the plurality of map tiles to be downloaded based on the fixed result.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the tile download method provided by the above methods, the method comprising:
responding to a map tile downloading request, loading a superimposed tile layer on map data, carrying out style modification on the tile layer in the loading process, and carrying out content addition on the map data, and determining target map data and a plurality of map tiles to be downloaded; and fixing the 1 st map tile to be downloaded in the plurality of map tiles to be downloaded in the target map data, and downloading the plurality of map tiles to be downloaded based on the fixed result.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A tile downloading method, comprising:
responding to a map tile downloading request, loading a superimposed tile layer on map data, carrying out style modification on the tile layer in the loading process, and carrying out content addition on the map data, so as to determine target map data and a plurality of map tiles to be downloaded;
fixing a 1 st map tile to be downloaded in the map tiles to be downloaded in the target map data, and downloading the map tiles to be downloaded based on a fixed result;
the step of fixing the 1 st map tile to be downloaded in the target map data, and downloading the map tiles to be downloaded based on a fixing result includes:
Fixing the 1 st map tile to be downloaded in the target map data, and determining the DataURL map data and the complete map tiles; the DataURL map data is base64 format DataURL image data derived after fixing the 1 st map tile to be downloaded in the target map data; the DataURL refers to a uniform resource locator for the data type;
cutting the data of the DataURL corresponding to the complete map tile from the data of the DataURL map under the condition that the complete map tile exists in the map tiles to be downloaded, and downloading the data of the DataURL; characterizing that a corresponding number of map tiles to be downloaded are downloaded when the data URL data is successfully downloaded;
removing the downloaded map tiles to be downloaded from the plurality of map tiles to be downloaded to obtain updated map tiles to be downloaded;
and determining the updated map tile to be downloaded as a new plurality of map tiles to be downloaded, and repeatedly executing the steps until the updated map tile to be downloaded is empty, so as to obtain the plurality of map tiles to be downloaded.
2. The tile downloading method according to claim 1, wherein the fixing the 1 st one of the plurality of map tiles to be downloaded in the target map data, determining the DataURL map data and the complete map tile, comprises:
based on the four-way information of the 1 st map tile to be downloaded and the four-way information of the target map data, fixing the upper left corner of the 1 st map tile to be downloaded to the upper left corner of the target map data, and determining the DataURL map data added to a new canvas;
determining area IV to information of a visual area of a browser in a screen and all second tile numbers of the area IV to information under a map level corresponding to the area IV to information based on the DataURL map data;
and determining a plurality of complete map tiles based on all the second tile numbers.
3. The tile download method according to claim 1 or 2, wherein the process of determining the plurality of map tiles to be downloaded comprises:
for each map level of tiles to be downloaded, determining a first tile number under the map level based on four-to-information corresponding to the map level;
and determining the map tiles to be downloaded based on the first tile number at each map level.
4. The tile downloading method according to claim 1, wherein, in the case that the complete map tile exists in the plurality of map tiles to be downloaded, cutting the DataURL data corresponding to the complete map tile from the DataURL map data includes:
searching for a second tile number in all first tile numbers under the condition that each map tile to be downloaded corresponds to a first tile number and the complete map tile corresponds to a second tile number;
and cutting the data of the DataURL corresponding to the complete map tile from the map data of the DataURL based on the searched second tile number.
5. The tile downloading method according to claim 4, wherein the removing the downloaded map tile from the plurality of map tiles to be downloaded to obtain an updated map tile to be downloaded comprises:
determining the positions of the searched second tile numbers in all the first tile numbers, and removing the map tiles to be downloaded corresponding to the positions from the plurality of map tiles to be downloaded to obtain the updated map tiles to be downloaded.
6. The tile download method according to claim 1 or 2, wherein the style modification to the tile layer and the content addition to the map data are performed during loading, wherein the style modification comprises at least one of:
setting layer filter parameters of a grid tile layer, changing image channel attributes of the grid tile layer, modifying a display style of a first tile element in a vector tile layer, and deleting a second tile element in the vector tile layer;
the content addition includes at least one of: an overlay is added over the map data and a point of interest POI is added over the map data.
7. The tile download method according to claim 1 or 2, wherein the method further comprises:
and storing the downloaded map tiles to be downloaded to a server, and/or feeding back the downloaded map tiles to be downloaded to a client.
8. A tile downloading device, comprising:
the tile layer editing module is used for responding to a map tile downloading request, loading the superimposed tile layers on the map data, carrying out style modification on the tile layers in the loading process and carrying out content addition on the map data, and determining target map data and a plurality of map tiles to be downloaded;
The map tile downloading module is used for fixing the 1 st map tile to be downloaded in the target map data and downloading the map tiles to be downloaded based on a fixed result;
the step of fixing the 1 st map tile to be downloaded in the target map data, and downloading the map tiles to be downloaded based on a fixing result includes:
fixing the 1 st map tile to be downloaded in the target map data, and determining the DataURL map data and the complete map tiles; the DataURL map data is base64 format DataURL image data derived after fixing the 1 st map tile to be downloaded in the target map data; the DataURL refers to a uniform resource locator for the data type;
cutting the data of the DataURL corresponding to the complete map tile from the data of the DataURL map under the condition that the complete map tile exists in the map tiles to be downloaded, and downloading the data of the DataURL; characterizing that a corresponding number of map tiles to be downloaded are downloaded when the data URL data is successfully downloaded;
Removing the downloaded map tiles to be downloaded from the plurality of map tiles to be downloaded to obtain updated map tiles to be downloaded;
and determining the updated map tile to be downloaded as a new plurality of map tiles to be downloaded, and repeatedly executing the steps until the updated map tile to be downloaded is empty, so as to obtain the plurality of map tiles to be downloaded.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the tile download method according to any one of claims 1 to 7 when executing the program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the tile download method according to any one of claims 1 to 7.
CN202311237097.3A 2023-09-25 2023-09-25 Tile downloading method, electronic equipment and storage medium Active CN116980397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311237097.3A CN116980397B (en) 2023-09-25 2023-09-25 Tile downloading method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311237097.3A CN116980397B (en) 2023-09-25 2023-09-25 Tile downloading method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116980397A CN116980397A (en) 2023-10-31
CN116980397B true CN116980397B (en) 2023-12-12

Family

ID=88477102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311237097.3A Active CN116980397B (en) 2023-09-25 2023-09-25 Tile downloading method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116980397B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117330055A (en) * 2023-11-30 2024-01-02 棱镜数聚(北京)信息技术有限公司 High-definition map generation method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105359189A (en) * 2013-05-15 2016-02-24 谷歌公司 Use of map data difference tiles to iteratively provide map data to a client device
CN105447101A (en) * 2015-11-12 2016-03-30 北京锐安科技有限公司 Map engine implementation method and apparatus
CN110033644A (en) * 2019-04-22 2019-07-19 泰华智慧产业集团股份有限公司 Parking position reserves air navigation aid and system
WO2021129883A1 (en) * 2019-12-25 2021-07-01 威创集团股份有限公司 Map tile processing method and related apparatus applied to large visual screen

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105359189A (en) * 2013-05-15 2016-02-24 谷歌公司 Use of map data difference tiles to iteratively provide map data to a client device
CN105447101A (en) * 2015-11-12 2016-03-30 北京锐安科技有限公司 Map engine implementation method and apparatus
CN110033644A (en) * 2019-04-22 2019-07-19 泰华智慧产业集团股份有限公司 Parking position reserves air navigation aid and system
WO2021129883A1 (en) * 2019-12-25 2021-07-01 威创集团股份有限公司 Map tile processing method and related apparatus applied to large visual screen

Also Published As

Publication number Publication date
CN116980397A (en) 2023-10-31

Similar Documents

Publication Publication Date Title
CN116980397B (en) Tile downloading method, electronic equipment and storage medium
CN103678631B (en) page rendering method and device
CN111930381B (en) Personalized page configuration method supporting SaaS multi-tenant system
US20140040817A1 (en) Visual treatment for a tile-based user interface in a content integration framework
CN107885867A (en) The synthetic method and synthesis system of map slice of data
CN110990516A (en) Map data processing method and device and server
CN114020756B (en) Remote sensing image real-time map service publishing method and device
CN110968808B (en) Method and device for realizing webpage theme update
CN110941686A (en) Positioning map processing method and device
WO2017093039A1 (en) Mobile device control of wifi hotspot access
CN112131332A (en) Information point updating method and device, electronic equipment and computer storage medium
CN111767417A (en) Application picture management method, device, equipment and storage medium
WO2022126646A9 (en) Automated platform for managing, deploying and orchestrating highly distributed service applications
CN113297132B (en) Migration file list generation method and device, electronic equipment and computer readable medium
CN113626747A (en) Method and device for generating breadcrumb navigation
CN112015416A (en) Verification method and device for developing webpage, electronic equipment and computer readable medium
CN113918861A (en) Icon library display method and device
CN112966041A (en) Data processing method, device, equipment and storage medium
CN111225005B (en) Push content generation method and device, electronic equipment and computer storage medium
CN114741139A (en) sketch graphic file processing method and device, electronic equipment and storage medium
CN111179378A (en) Global electric power meteorological atlas drawing method applicable to webGIS
CN111414106A (en) Title display method and device, electronic equipment and computer readable medium
CN111435089A (en) Map data compiling method, device, medium and server
CN112764849B (en) Desktop icon transformation method and system based on IOS system
CN114840620B (en) Evidence-providing material management method, intelligent terminal and storage medium

Legal Events

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