Offline map loading method and device, computer equipment and readable storage medium
By generating multi-level offline map files, the problem of difficult loading of satellite maps in areas with poor network coverage is solved, enabling flexible map loading and display, saving costs, and improving the efficiency of insurance business.
Patent Information
- Application Number
- CN202511053342.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-18
AI Technical Summary
Existing satellite maps are difficult to load in remote areas with poor network conditions, resulting in low efficiency in insurance operations. Furthermore, replacing the map frame with an offline map package would consume a lot of time and manpower, affecting business stability.
By determining the target area and map level, calculating the range of regional projection coordinates, downloading and packaging map tiles, and generating multi-level offline map files, the client loads the map tiles to display the target area map in an offline state, avoiding map framework modifications and compatibility adjustments.
It enables flexible map loading in different business scenarios, saving time and manpower costs, avoiding impact on the stable operation of existing businesses, and has good compatibility without consuming terminal memory.
Smart Images

Figure CN120973853A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence and financial technology, and in particular to an offline map loading method and device, a computer device and a readable storage medium. BACKGROUND
[0002] In recent years, satellite maps have been widely used in many fields due to their comprehensive, accurate and real-time characteristics, and the insurance industry is one of them. Satellite maps have a wide range of applications in the insurance industry, covering risk assessment, actuarial modeling, claim investigation, disaster emergency response, customer management and precision marketing, and many other key links. For example, in the risk assessment stage, satellite maps can provide intuitive information about the geographical environment and surrounding facilities of the insurance target area, providing a strong basis for accurate risk assessment. In related technologies, the existing satellite map functions are highly dependent on network environment, and even require good network conditions to successfully load the satellite map. However, in the rural insurance scenario of the insurance industry, most of the inspection tasks are concentrated in rural areas or even remote areas such as mountains, and the network infrastructure in these areas is relatively weak, with insufficient network signal coverage and poor stability, making it difficult for satellite maps to load in such an environment, or even completely unable to display. This not only seriously affects the normal use of related tools, but also greatly reduces the work efficiency, bringing many inconveniences to the development of rural insurance business. Therefore, to solve the problem of satellite maps not being able to be used due to poor network environment, some map providers currently provide offline map packages.
[0003] However, the applicant realizes that map providers require insurance companies to replace their map framework with a framework that matches the offline map package in order to use the offline map package. However, different insurance companies may have chosen a specific map framework based on their business needs and technical architecture. If the map framework is replaced due to the use of offline map packages, companies with inconsistent map frameworks must re-engineer the entire map framework. This process involves a large amount of code modification, system testing and compatibility adjustment, which is time-consuming and labor-intensive, and may affect the stable operation of existing businesses, making it difficult to meet the map loading needs of different business scenarios and having high limitations. SUMMARY
[0004] The present application provides an offline map loading method, device, computer device and medium to solve the technical problem of being difficult to meet the map loading needs of different business scenarios and having high limitations.
[0005] In a first aspect, an offline map loading method is provided, comprising:
[0006] The target area of the offline map to be downloaded is determined, and at least one map level selected by the user for the target area is determined, wherein each of the at least one map level displays map details according to its corresponding level scaling ratio when the map is displayed;
[0007] Obtain the regional projection coordinates of the target area, and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level;
[0008] Referring to the horizontal and vertical coordinate ranges corresponding to each map level, at least one map tile is downloaded for each map level, and the at least one map tile corresponding to each map level is packaged to obtain a multi-level offline map file of the target area;
[0009] The multi-level offline map file is transmitted to the user's client, which stores the multi-level offline map file. When the client detects a user request to display a map of the target area while offline, it loads the map tiles included in the multi-level offline map file to display the offline map of the target area.
[0010] Secondly, an offline map loading device is provided, including:
[0011] A determination module is used to determine the target area of the offline map to be downloaded, and to determine at least one map level selected by the user for the target area, wherein each of the at least one map level displays map details according to its corresponding level scaling ratio when displaying the map;
[0012] The calculation module is used to obtain the regional projection coordinates of the target area and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level.
[0013] The download module is used to download at least one map tile corresponding to each map level by referring to the horizontal and vertical coordinate ranges corresponding to each map level, and to package at least one map tile corresponding to each map level to obtain a multi-level offline map file of the target area.
[0014] The transmission module is used to transmit the multi-level offline map file to the user's client, whereby the client stores the multi-level offline map file. When the client detects a user request to display a map of the target area while offline, it loads the map tiles included in the multi-level offline map file to display the offline map of the target area.
[0015] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the offline map loading method as described in any of the first aspects above.
[0016] Fourthly, a readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the offline map loading method as described in any of the first aspects above.
[0017] The solution implemented by the aforementioned offline map loading method, apparatus, computer equipment, and readable storage medium determines the area to be downloaded as an offline map based on the user's selection and downloads map tiles according to the map layer selected by the user. This enables the loading and display of the offline map without modifying the map framework. No modifications to map framework-related code are required, nor is testing and compatibility adjustments necessary for modified map frameworks. This saves significant time and manpower costs, avoids impacting the stable operation of existing services, and allows for the download of only a portion of map resources based on user needs. While meeting users' map loading requirements in different business scenarios, it avoids consuming excessive memory on the user's terminal, demonstrating good compatibility. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of an application environment for an offline map loading method according to an embodiment of the present invention;
[0020] Figure 2 This is a flowchart illustrating an offline map loading method according to an embodiment of the present invention;
[0021] Figure 3 This is a flowchart illustrating a specific implementation of step S20;
[0022] Figure 4 This is a flowchart illustrating a specific implementation of step S22;
[0023] Figure 5 This is a flowchart illustrating a specific implementation of step S30;
[0024] Figure 6 This is a flowchart illustrating another specific implementation of step S30;
[0025] Figure 7 This is another flowchart illustrating the offline map loading method in one embodiment of the present invention;
[0026] Figure 8 This is a schematic diagram of an offline map loading device according to an embodiment of the present invention;
[0027] Figure 9 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;
[0028] Figure 10 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] The offline map loading method provided in this embodiment of the invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can determine the target area of the offline map to be downloaded, as well as at least one map level selected by the user for the target area. It obtains the regional projection coordinates of the target area, calculates the x and y coordinate ranges corresponding to each map level, and downloads at least one map tile for each map level based on these ranges. The server then packages these at least one map tile for each map level to obtain a multi-level offline map file for the target area. This multi-level offline map file is transmitted to the user's client, which stores it. When the client detects a user request to display the map of the target area while offline, it uses the map tiles included in the multi-level offline map file to display the offline map of the target area. In this invention, the area to be downloaded as an offline map is determined based on the user's selection, and map tiles are downloaded according to the map layer selected by the user. This enables the loading and display of the offline map without modifying the map framework. No modifications to map framework-related code are required, nor is testing and compatibility adjustments necessary for a modified map framework. This saves significant time and manpower costs, avoids impacting the stable operation of existing services, and allows for the download of only a portion of map resources based on user needs. This satisfies users' map loading requirements in different business scenarios while minimizing the consumption of large amounts of memory on the user's device, resulting in good compatibility. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.
[0031] Please see Figure 2 As shown, Figure 2 A flowchart illustrating an offline map loading method provided in an embodiment of the present invention includes the following steps:
[0032] S10: Determine the target area of the offline map to be downloaded, and determine at least one map level selected by the user for the target area.
[0033] The offline map loading method provided by this invention can be applied to map display tools such as map software and navigation software in various application scenarios. Map display tools are usually implemented through a server, which can provide users with multi-level offline map files in real time according to user needs. For example, in the field of insurance applications, when agents, claims adjusters, and other users need to go to areas with poor network connectivity for claims investigation, they can request to download offline maps from the server. The server will generate multi-level offline map files based on the area selected by the user and provide them to the user's client, allowing the client to cache them locally. This enables the client to display offline maps normally even without a network connection.
[0034] In the user interface of insurance-related apps, the map display tool provides users with a region selection function. Users can determine the target area to download the offline map by manually entering the address, clicking or selecting on the map, or drawing a box. Simultaneously, users can select at least one map level from the map level options provided in the interface, based on their business needs. Map levels refer to different zoom levels of the map display. Each map level corresponds to a specific zoom ratio, and each map level displays map details according to its corresponding zoom ratio. For example, level 1 can provide an overall overview of the area, showing fewer details; level 5 can provide a more detailed view of the area, showing more information such as roads and buildings. In insurance application scenarios, for example, if an agent only needs a general understanding of the target area's location, they can choose a lower level; if they need to view details such as plots of land and enclosures, they can choose a higher level.
[0035] Furthermore, in practical applications, users can select the map display resolution to meet their specific requirements. This invention allows users to independently determine the areas and map layers requiring offline map downloads based on their actual business needs, avoiding unnecessary map resource downloads, saving terminal memory, and meeting different map information requirements in various business scenarios. For example, consider an insurance agent using an app. The agent receives a task to verify agricultural insurance claims in a remote rural area with poor network signal. Before departure, the agent uses the offline map download function of the insurance app, selects the approximate area of the rural area as the target region, and chooses higher map layers (8 and 9) for download, considering the need for detailed examination of farmland plots, to prepare for subsequent verification work in a network-free environment.
[0036] In step S10, which involves determining the target area for the offline map to be downloaded, the following two methods can be used:
[0037] One method is text input. When a user requests to specify the target area for the offline map to be downloaded via text input, a text input box pops up for the user to operate. The user can enter administrative division information, such as the name of different levels of administrative region, like province, city, county, and township, for example, "XX Province, XX City, XX County". The map display tool obtains the administrative division information entered by the user and uses the administrative region indicated by the administrative division information as the target area. Text input is simple to operate and is especially suitable for scenarios where users are familiar with the name of the target area and can quickly and accurately enter administrative division information, thus efficiently determining the target area. For example, consider an insurance agent using an insurance business app to go to a remote area to verify livestock insurance claims. Agent A is assigned to go to "a remote livestock farm in XX Province, XX City, XX County". He is familiar with the specific location of the farm and knows its administrative division. Therefore, A selects the text input method in the map display tool and enters "XX Province, XX City, XX County" in the input box. After obtaining the entered administrative division information, the map display tool determines that county area as the target area for the offline map to be downloaded.
[0038] Another method is manual drawing. When a user requests to manually draw the target area for the offline map to be downloaded, the map display tool will show a pre-stored map view on the user's device screen. This map view is an electronic map containing basic geographic information, and the user can select the area on the map view by touching it with their finger (on mobile devices) or using a mouse (on computers, etc.). The map display tool will track the user's selection action in real time, and once the user completes the selection, the area selected by the user on the map view will be designated as the target area for the offline map to be downloaded. The manual drawing method provides users with greater flexibility. When the target area is not a standard administrative division, or when the user wants to precisely select a specific range, the target area can be accurately determined through intuitive selection, meeting the diverse needs of different users in different business scenarios and improving user experience and operational efficiency. For example, salesperson B is tasked with going to a breeding area that does not have a clearly defined administrative division, but whose general location he knows on a map. In the map display tool, B selects the manual drawing mode. The map display tool shows a pre-stored map view. B draws the area containing the breeding area on the screen with his finger. The map display tool tracks and records his selection action in real time. After B completes the selection, the selected area is determined as the target area for the offline map to be downloaded.
[0039] S20: Obtain the regional projection coordinates of the target area and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level.
[0040] After acquiring the target area specified by the user, the map display tool converts the latitude and longitude coordinates of the target area into regional projected coordinates. Regional projected coordinates are a method of representing geographical locations on the Earth's surface as planar coordinates, facilitating calculations and processing on the map. Then, for each map level selected by the user, the map display tool calculates the corresponding x and y coordinate ranges for that map level, thereby determining the map area that needs to be covered at that level. This provides a precise range basis for subsequently downloading accurate map tiles, ensuring that the downloaded map tiles completely cover the target area, avoiding missing or redundant maps, and improving the accuracy and efficiency of map downloading.
[0041] Continuing with the example of an insurance agent, after receiving the target area and map level information selected by the agent, the map display tool converts the latitude and longitude coordinates of the target area into regional projected coordinates. For map levels 8 and 9 selected by the agent, the map display tool calculates that the horizontal coordinate range of the target area at level 8 is 100-200, and the vertical coordinate range is 50-150; while at level 9, the horizontal coordinate range is 120-180, and the vertical coordinate range is 70-130, preparing for the subsequent download of suitable map tiles.
[0042] Among them, such as Figure 3 As shown, step S20, which involves obtaining the regional projected coordinates of the target area and calculating the range of horizontal and vertical coordinates corresponding to the regional projected coordinates at each map level, includes the following steps:
[0043] S21: Query the latitude and longitude coordinates of the target area, perform Mercator projection transformation on the latitude and longitude coordinates of the area, and use the coordinates obtained after transformation as the area projection coordinates.
[0044] In this embodiment of the invention, the map display tool first queries the latitude and longitude coordinates of the target area. Regional latitude and longitude coordinates refer to the longitude and latitude information of the target area on the Earth's surface. They can accurately locate the target area's position on Earth, such as the latitude and longitude values corresponding to the boundary points of a city or a specific geographical region. These coordinate data can be obtained through various means, such as retrieving them from a pre-stored geographic information database containing detailed latitude and longitude information for various geographical regions; or through on-site measurement or data import using Geographic Information System (GIS) tools. This invention does not specifically limit the method of obtaining regional latitude and longitude coordinates. Furthermore, to facilitate subsequent processing of the regional latitude and longitude coordinates, the coordinates can be converted to the standard wgs84 format geographic coordinates, thereby facilitating subsequent unified calculations.
[0045] After obtaining the latitude and longitude coordinates of the region, the map display tool performs a Mercator projection transformation on them. The Mercator projection is a method for converting latitude and longitude coordinates on the Earth's surface into Cartesian coordinates. It projects the Earth's spherical surface onto a plane, accurately representing directions and angles on the map, facilitating various geographic calculations and map creation. Using a preset Mercator projection algorithm, the map display tool converts the region's latitude and longitude coordinates into planar coordinates. The resulting coordinates are the region's projected coordinates, providing a foundation for calculating coordinate ranges at different map levels. This makes the calculation process more intuitive and easier to handle, avoiding the difficulties of complex calculations in a spherical coordinate system.
[0046] For example, suppose we need to obtain the regional projected coordinates of a coastal city. We can first query a geographic information database to find the latitude and longitude coordinates of multiple key points on the city's boundary. These coordinates are accurate to several decimal places, accurately describing the city's geographical location and extent. Then, using the Mercator projection algorithm, the latitude and longitude coordinates of each key point are converted into Cartesian coordinates. For instance, if the latitude and longitude of a boundary point are (120.5°E, 30.2°N), after Mercator projection, the corresponding Cartesian coordinates are (X1, Y1). By converting all key points in the entire city area in this way, we can finally obtain the regional projected coordinates of the city area.
[0047] S22: Query the scaling ratio corresponding to each map level, and calculate the range of horizontal and vertical coordinates of the region projection coordinates at each map level based on the scaling ratio and region projection coordinates corresponding to each map level.
[0048] In this embodiment of the invention, the map display tool queries the zoom level corresponding to each map level. Map levels represent different levels of detail in the map display, and the zoom level indicates the degree of zoom of the map at that level, determining the level of detail and area of the content displayed on the map. For example, a lower map level may display a larger geographical area with less detail, while a higher map level displays a smaller geographical area with richer detail. The zoom level can be obtained through interfaces or documentation provided by map service providers; different map services may have different ways of defining the zoom level.
[0049] Based on the scaling ratio and regional projected coordinates of each map level, the map display tool calculates the range of horizontal and vertical coordinates for each map level. Specifically, the regional projected coordinates can be scaled according to the scaling ratio. Combining this with the map's coordinate system and display rules, the minimum and maximum numbers of the region on the horizontal and vertical axes at that level are determined, thus obtaining the range of horizontal and vertical coordinates. In this way, by calculating the range of horizontal and vertical coordinates at different map levels, the display boundaries of the target area on each map level can be clearly defined. This provides crucial information for accurately downloading offline map data at the corresponding level, ensuring that the downloaded map data fully covers the target area and meets the display requirements at different levels.
[0050] Among them, such as Figure 4 As shown, step S22, which involves calculating the range of horizontal and vertical coordinates of the region projection coordinates at each map level based on the level scaling ratio and region projection coordinates, includes the following steps:
[0051] S221: For each map level, refer to the scaling ratio of the map level to calculate the projected abscissa in the region's projected coordinates, and obtain the minimum and maximum abscissa numbers corresponding to the projected abscissa on the map level.
[0052] In this embodiment of the invention, calculations are performed for each map level. Map levels represent different levels of detail in the map presentation; different levels correspond to different display ranges and levels of detail. The level scaling ratio reflects the scaling of the map at that level, determining the actual geographical distance represented by a unit length on the map. For the projected abscissa in the region's projected coordinates, the map display tool calculates based on the level scaling ratio corresponding to the current map level, scaling and converting the projected abscissa according to the scaling ratio. For example, if the level scaling ratio indicates that the map is magnified by a certain factor at that level, the projected abscissa will be adjusted accordingly to adapt to this scaling change. Through this calculation, the minimum and maximum abscissa numbers corresponding to the projected abscissa at the current map level can be obtained. These two numbers are used to define the horizontal boundary of the target area, laying the foundation for subsequently determining the complete coordinate range. Thus, by accurately calculating the minimum and maximum abscissa numbers, the horizontal range of the target area at each map level can be accurately determined, ensuring that the subsequently downloaded offline map completely covers the target area horizontally, avoiding omissions or redundancies.
[0053] Taking Hekou Village in the county as an example, let's assume we calculate its projected abscissa range at level 15. First, we obtain the scaling factor corresponding to level 15, which reflects the map's scaling degree at this level. Then, based on the projected abscissa data in the regional projected coordinates, combined with the map's coordinate system, we scale and transform the projected abscissa. Assume that after calculation, the minimum abscissa number corresponding to Hekou Village's projected abscissa at level 15 is 13579, and the maximum abscissa number is 13583.
[0054] S222: Refer to the scaling ratio of the map level to calculate the projected ordinate in the region's projected coordinates, and obtain the minimum and maximum ordinate numbers of the ordinate on the map level.
[0055] Similar to step S221, the calculation continues for the projected ordinate. Again, referring to the scaling ratio corresponding to the current map level, the calculation is performed on the projected ordinate in the region's projected coordinates. The projected ordinate represents the target area's vertical position information. When scaling and transforming according to the scaling ratio, it follows similar rules and algorithms as the horizontal coordinate calculation, but takes into account the characteristics of the vertical coordinate system. Through calculation, the map display tool obtains the minimum and maximum vertical axis numbers corresponding to the projected ordinate at the current map level. These two numbers are used to determine the target area's vertical boundary position, together with the horizontal axis numbers, constituting the complete boundary information of the target area at the map level. Thus, by accurately calculating the minimum and maximum vertical axis numbers, the range of the target area can be precisely defined vertically. Combined with the horizontal axis range, this ensures a more accurate location of the target area on the map, providing a reliable basis for downloading suitable offline map data.
[0056] Continuing with the example of level 15 in Hekou Village, the projected ordinate in the regional projection coordinates is calculated based on the scaling ratio of level 15. Assume that after a series of calculations and transformations, the minimum ordinate number corresponding to the projected ordinate of Hekou Village at level 15 is 26618, and the maximum ordinate number is 26622.
[0057] S223: Construct the range of the horizontal coordinate using the minimum and maximum numbers of the horizontal axis, and construct the range of the vertical coordinate using the minimum and maximum numbers of the vertical axis.
[0058] In this embodiment of the invention, the map display tool constructs the horizontal coordinate range using the previously calculated minimum and maximum horizontal axis numbers. Specifically, the minimum and maximum horizontal axis numbers are represented in a specific format, such as "minimum horizontal axis number - maximum horizontal axis number," clearly defining the horizontal coordinate range of the target area at the current map level. Similarly, the vertical coordinate range is constructed using the minimum and maximum vertical axis numbers, employing a similar representation, such as "minimum vertical axis number - maximum vertical axis number." By constructing the horizontal and vertical coordinate ranges, the horizontal and vertical boundary information of the target area at the map level is integrated and standardized, making the target area's extent clearer and easier to process. This facilitates the subsequent download of accurate map tiles, improving the efficiency and accuracy of the entire process, and also allows for a more intuitive understanding and viewing of the target area's extent.
[0059] For example, for the 15th level of Hekou Village in the county, based on the previously calculated minimum horizontal axis number 13579, maximum horizontal axis number 13583, minimum vertical axis number 26618, and maximum vertical axis number 26622, the horizontal coordinate range is constructed as 13579-13583, and the vertical coordinate range is 26618-26622.
[0060] S224: Combine the range of horizontal and vertical coordinates to obtain the range of horizontal and vertical coordinates of the region's projected coordinates on the map level.
[0061] In this embodiment of the invention, the previously constructed horizontal and vertical coordinate ranges are combined to obtain the horizontal and vertical coordinate ranges of the region's projected coordinates on the map layer. Specifically, the horizontal and vertical coordinate ranges can be integrated in a specific format, such as "horizontal coordinate range, vertical coordinate range," thereby completely expressing the coordinate range of the target area on the current map layer. The horizontal and vertical coordinate ranges can accurately describe the position and size of the target area on this map layer, providing precise positioning information for subsequent downloading of satellite map data at the corresponding layer. This ensures that the downloaded map data accurately covers the target area, meets the user's needs for viewing and using maps at different layers, and improves the relevance and effectiveness of map downloads.
[0062] For example, for the 15th level of Hekou Village in the county, combining the horizontal coordinate range of 13579-13583 and the vertical coordinate range of 26618-26622 yields the following range of projected coordinates for the region at the 15th level: 13579-13583 and 26618-26622. This is the coordinate range information required for Hekou Village in the county on the 15th level satellite map, which can be used to accurately download satellite map data at this level later.
[0063] S30: Referring to the horizontal and vertical coordinate ranges corresponding to each map level, download at least one map tile corresponding to each map level, and package at least one map tile corresponding to each map level to obtain a multi-level offline map file of the target area.
[0064] In this embodiment of the invention, map tiles are created by dividing a map into multiple small blocks according to certain rules. Each small block is called a map tile, which facilitates storage, transmission, and loading. The map display tool downloads map tiles that conform to the horizontal and vertical coordinate range corresponding to each map level from the map data source. For example, for the horizontal and vertical coordinate range determined for level 8, the map display tool finds the corresponding map tiles from the map data source and downloads them; similarly, a similar operation is performed for level 9. After downloading the map tiles corresponding to each map level, the map display tool categorizes and packages these map tiles according to map levels, packaging all map tiles of level 8 into one file and all map tiles of level 9 into another file, ultimately obtaining a multi-level offline map file of the target area containing multiple map levels.
[0065] In this way, by downloading and packaging map tiles, multi-level map data of the target area is integrated, facilitating transmission and storage. Simultaneously, the map tile approach makes map loading more flexible and efficient, allowing clients to quickly load map tiles for specific areas as needed, improving map display speed and performance. For example, in an insurance business scenario, the map display tool downloads the corresponding map tiles from the map data source based on the previously calculated horizontal and vertical coordinate ranges of levels 8 and 9. After downloading, all map tiles of level 8 are packaged into a file named "target area_level 8_offline map.zip", and all map tiles of level 9 are packaged into a file named "target area_level 9_offline map.zip". These two files together constitute the multi-level offline map file of the target area, ready for subsequent transmission to the client.
[0066] Among them, such as Figure 5 As shown, in step S30, that is, referring to the horizontal and vertical coordinate ranges corresponding to each map level, at least one map tile is downloaded for each map level, including the following steps:
[0067] S31: For each map level, retrieve the preset map level corresponding to that map level.
[0068] Operations are performed for each map level. Preset level maps are collections of map data created in advance according to the specifications and standards of map service providers, categorized by different levels. They contain complete geographic information for that level and are stored and presented in a specific format. For each map level, the map display tool interacts with the map service provider through an interface or retrieves the corresponding preset level map from locally stored map data resources.
[0069] For example, if processing a level 10 map, it's necessary to obtain preset map data created for level 10. This provides the foundational data for determining the map extent and downloading map tiles, ensuring the entire process operates based on correct map data and preventing problems in subsequent steps due to incorrect map data. Taking the download scenario of Hekou Village in the county as an example, assuming the current requirement is to download map tiles for Hekou Village at level 12, the map display tool retrieves the preset map data for level 12 from the map database and performs preliminary verification and parsing to ensure data integrity and accuracy, thus successfully obtaining the preset level map corresponding to level 12.
[0070] S32: Map the horizontal and vertical coordinate ranges corresponding to the map level to the preset level map, and determine the map range covered by the horizontal and vertical coordinate ranges on the preset level map.
[0071] In this embodiment of the invention, the map display tool maps the horizontal and vertical coordinate ranges corresponding to a map level to a preset level map. The horizontal and vertical coordinate ranges, calculated in previous steps, define the position and size of the target area on the current map level. The mapping process requires converting the horizontal and vertical coordinate ranges into their corresponding positions on the preset level map based on the coordinate system and projection method of the preset level map. Different map services may use different coordinate systems and projection methods, therefore, appropriate conversion algorithms and parameters are needed for accurate mapping. Through the mapping operation, the map display tool can determine the specific map area covered by the horizontal and vertical coordinate ranges on the preset level map. This range clearly defines the boundaries of the area where map tiles need to be downloaded, providing a clear target area for accurate subsequent downloading of map tiles and avoiding the downloading of unnecessary or missing map tiles in key areas.
[0072] Continuing with the example of downloading the 12th-level map of Hekou Village, let's assume that the previously calculated x and y coordinate ranges for Hekou Village at the 12th level are 15000-15020 (x-axis) and 28000-28020 (y-axis). Based on the Mercator projection coordinate system and related transformation parameters used in the preset 12th-level map, these coordinate ranges are mapped to a rectangular area on the preset 12th-level map. This rectangular area covers the main part of Hekou Village on the 12th-level map; this is the map area covered by the x and y coordinate ranges on the preset 12th-level map.
[0073] S33: Download at least one map tile that constitutes the map range to obtain at least one map tile corresponding to the map layer.
[0074] In this embodiment of the invention, the map display tool downloads at least one map tile constituting the map area. Map tiles are a method of storing and displaying maps, dividing the map into multiple small blocks according to certain rules. Each small block is a map tile, facilitating fast map loading and display, as well as convenient downloading and management. Based on the previously determined map area, the map display tool, combining the map tile segmentation rules and numbering method, identifies all map tiles constituting the map area. Then, by establishing a connection with the map service provider's server, a download request is sent to download these map tiles one by one. During the download process, the downloaded data needs to be verified to ensure that the downloaded map tiles are complete and undamaged. After the download is complete, at least one map tile corresponding to the map layer is obtained, meeting the user's needs for using maps of specific areas and specific layers. At the same time, the map tile method also improves the efficiency of map loading and display.
[0075] Taking the download of the 12th level map of Hekou Village in the county as an example, based on the previously determined map area, and according to the map tile segmentation rules specified by the map service provider (e.g., each tile is 256×256 pixels in size and arranged according to certain row and column numbers), all map tile numbers constituting the map area are identified. Assume that four map tiles numbered A1, A2, B1, and B2 need to be downloaded. The map display tool sends a request to the map service provider's server to download these four map tiles. After receiving the request, the server sends the corresponding map tile data to the map display tool. During the data reception process, the map display tool performs an integrity check on the data of each tile. After the check passes, the four map tiles are stored in a specified local directory, thus completing the download of the 12th level map tiles for Hekou Village in the county.
[0076] Among them, such as Figure 6As shown, step S30, which involves packaging at least one map tile corresponding to each map level to obtain a multi-level offline map file of the target area, includes the following steps:
[0077] S34: Organize at least one map tile corresponding to each map level to obtain the tile file corresponding to each map level, and name the corresponding tile file using the level number of each map level and its corresponding horizontal and vertical coordinate range.
[0078] As mentioned above, each map layer corresponds to multiple map tiles, which together present the map information of the target area at that layer. Therefore, the map display tool first collects and organizes all map tiles at each map layer, grouping tiles belonging to the same map layer together to form the tile file corresponding to that map layer. Next, for easier management and retrieval, the tile file is named using the layer number of each map layer and the horizontal and vertical coordinate ranges corresponding to the map tiles at that layer. For example, for map layer number 10, if a tile has an horizontal coordinate range of 100-110 and a vertical coordinate range of 200-210, then the tile file could be named "10_100-110_200-210". Next, create folders according to the hierarchical structure of level, vertical axis, and horizontal axis. For example, first create a folder with level 10, then create folders corresponding to the vertical axis range under this folder, and then create folders corresponding to the horizontal axis range under the vertical axis folders. Place the named tile files into the corresponding folders.
[0079] In this way, by organizing and naming, each map tile has a unique and clear identifier, which facilitates quick location and retrieval of map tiles at specific map levels and coordinate ranges. Moreover, creating folders according to the hierarchical structure of levels, vertical axis, and horizontal axis further enhances the orderliness of file management, improves the efficiency of file storage and retrieval, and lays a good foundation for the subsequent generation of multi-level offline map files.
[0080] S35: Obtain multiple tile files corresponding to multiple map layers, package and compress the multiple tile files to obtain multi-level offline map files.
[0081] After organizing and naming the map tiles, the map display tool obtains the tile files corresponding to all map layers. These tile files contain map information for different layers and coordinate ranges of the target area. Next, these tile files are integrated, packaged, and compressed. The packaging process combines multiple scattered tile files into a single file collection, while compression uses algorithms to reduce the storage space occupied by the files, ultimately generating a multi-level offline map file, typically in the form of a compressed archive, such as ZIP format. Simultaneously, the map display tool saves these unpackaged tile files for future decompression, viewing, or modification needs. The packaged and compressed multi-level offline map file is significantly smaller in size, facilitating storage and transmission. For example, when insurance agents travel to rural or mountainous areas with poor network connectivity for map verification work, they can download the offline map file to their mobile devices in advance. This allows for quick loading and use of the map without relying on the network, avoiding slow or unloading issues caused by network problems, thus improving the efficiency and reliability of the verification work. Furthermore, saving the original tile files provides convenience for future map updates or modifications.
[0082] S40: Transfer the multi-level offline map file to the user's client, and store the multi-level offline map file. When the client detects that the user requests to display the map of the target area while offline, it can display the offline map of the target area by loading the map tiles included in the multi-level offline map file.
[0083] Map display tools transmit packaged multi-level offline map files to the user's client (such as a mobile phone or tablet) via wireless networks (such as Wi-Fi or mobile data networks, in an environment with network access). After receiving the files, the client stores them in its local storage device, such as the phone's internal storage or an external memory card. When the client is offline (no network connection), if it detects a user request to display a map of a target area, the client reads the multi-level offline map files from its local storage. Based on the map level selected by the user (if a specified level is provided) or the default level, it loads the map tiles for the corresponding level and stitches these tiles together to display the offline map of the target area. For example, if a user requests to display a map of a target area at level 8, the client locates the file "target area_level 8_offline map.zip" locally, decompresses it, and loads the map tiles from it for display.
[0084] For example, when an insurance agent arrives in a remote rural area, they find their mobile phone has no network signal. At this point, the agent opens the insurance business app and clicks to view a previously downloaded map of the target area. The app detects the offline status and the user requests to display the target area map. Since multiple levels of offline map files have been stored previously, the app reads the files from local storage. Based on the level of detail the agent might need (assuming default or previously set to display level 8), it loads the map tiles from the "target area_level 8_offline map.zip" file and displays the map of the target area. The agent can then perform tasks such as delineating and photographing plots for agricultural insurance on the map, without network limitations, ensuring the smooth conduct of the business. In this way, the above process enables map display functionality even in offline environments, allowing users to use map services normally in environments with poor or no network coverage, meeting the needs of insurance agents and other users conducting business in remote areas. Furthermore, because map resources are downloaded and stored in advance, the reliance on network bandwidth for real-time map loading is avoided, improving the stability and response speed of map display.
[0085] In step S40, when the client displays the offline map of the target area using map tiles included in the multi-level offline map file, the client first needs to load the multi-level offline map file. As mentioned earlier, the multi-level offline map file is a compressed package containing a collection of map tiles corresponding to multiple different map levels. Then, the client decompresses the multi-level offline map file to obtain multiple tile files. Next, it determines the target map level currently selected by the user, queries the target tile file corresponding to the target map level among the multiple tile files, loads and displays the map tiles included in the target tile file, completing the offline map display of the target area. In practical applications, after the client obtains the multi-level offline map file, it decompresses it. Then, based on the ArcGIS framework, it can automatically calculate Mercator projection coordinates when accessing map resources. In online scenarios, it automatically accesses online map tile resources based on the coordinates. However, in the offline scenario of this embodiment, it changes to accessing map tile resources in the local multi-level offline map file, thus loading the offline map.
[0086] In addition, when displaying an offline map of a target area, the client also retrieves locally cached image service data. This image service data can be data related to the current insurance verification business, presented in image form. For example, for agricultural insurance, this could include land parcel information, livestock pen information, etc. The client adjusts the image service data according to the scaling ratio corresponding to the currently displayed map layer to match its size. Then, the adjusted image service data is displayed as a semi-transparent overlay on the currently displayed offline map, achieving the overlay display of service layers on the offline map.
[0087] In practical applications, for the insurance industry, the map display tool allows users to delineate and photograph plots and enclosures for planting insurance and livestock insurance on offline maps for verification purposes. The coordinates of the delineated plots and the photographed images are saved locally and then uploaded when connected to the internet. In summary, the map display tool proposed in this invention supports rapid server access, configurable management of offline map resources and resolutions, and conversion between multiple coordinate system formats. Users can customize the offline map resource packages they need to download. This map display tool supports fast and lightweight access, is compatible with various map frameworks, and allows users to personalize the map resources they need. Furthermore, the offline map package allows users to personalize the offline map package for the desired area, and supports manually delineating map areas and selecting administrative divisions to download the corresponding offline map package. Additionally, the map display tool allows users to select the desired map layer and resolution as needed, reducing the size of the offline map package, minimizing the burden on mobile phone memory, and meeting the needs of different business scenarios. The logical process of the offline map loading method proposed in this invention is summarized as follows:
[0088] See Figure 7 The user first outlines or inputs administrative division information, then the map display tool performs geographic coordinate system conversion, then calculates Mercator projection coordinates at each level, and then downloads and packages map tile resources. During this process, a server connection is required to provide computing power and map tile resources. The offline map package has features such as compatibility with various map frames, configurable map resources, and selectable resolution. Afterwards, the APP downloads the generated offline package, decompresses it, loads it, and displays it, ultimately providing it to the user for work.
[0089] As can be seen, in the above solution, the area to be downloaded as an offline map is determined based on the user's selection, and map tiles are downloaded according to the map layer selected by the user. This enables the loading and display of the offline map without modifying the map framework. There is no need to modify the code related to the map framework, nor is it necessary to test and adjust the compatibility of the modified map framework. This saves a lot of time and manpower costs, avoids affecting the stable operation of existing businesses, and can download only a portion of map resources according to the user's needs. This satisfies the user's map loading needs in different business scenarios while avoiding occupying a large amount of memory on the user's terminal, resulting in good compatibility.
[0090] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0091] In one embodiment, an offline map loading device is provided, which corresponds one-to-one with the offline map loading method in the above embodiments. For example... Figure 8 As shown, the offline map loading device includes a determination module 801, a calculation module 802, a download module 803, and a transmission module 804. Detailed descriptions of each functional module are as follows:
[0092] The determining module 801 is used to determine the target area of the offline map to be downloaded, and to determine at least one map level selected by the user for the target area, wherein each of the at least one map level displays map details according to its corresponding level scaling ratio when displaying the map.
[0093] Calculation module 802 is used to obtain the regional projection coordinates of the target area and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level;
[0094] The download module 803 is used to download at least one map tile corresponding to each map level by referring to the horizontal and vertical coordinate ranges corresponding to each map level, and to package at least one map tile corresponding to each map level to obtain a multi-level offline map file of the target area.
[0095] The transmission module 804 is used to transmit the multi-level offline map file to the client held by the user, and the client stores the multi-level offline map file so that when the client detects that the user requests to display the map of the target area in an offline state, it can realize the offline map display of the target area by loading the map tiles included in the multi-level offline map file.
[0096] In one embodiment, the determining module 801 is configured to, when detecting that the user requests to determine the target area of the offline map to be downloaded by text input, obtain the administrative division information input by the user and take the administrative region indicated by the administrative division information as the target area; or, when detecting that the user requests to determine the target area of the offline map to be downloaded by manual drawing, display a pre-stored map view and determine the area circled by the user on the map view as the target area.
[0097] In one embodiment, the calculation module 802 is used to query the latitude and longitude coordinates of the target area, perform Mercator projection transformation on the latitude and longitude coordinates of the area, and use the coordinates obtained after transformation as the projection coordinates of the area; query the level scaling ratio corresponding to each map level, and calculate the range of horizontal and vertical coordinates of the projection coordinates of the area at each map level based on the level scaling ratio corresponding to each map level and the projection coordinates of the area.
[0098] In one embodiment, the calculation module 802 is configured to, for each map level, calculate the projected abscissa in the region's projected coordinates with reference to the level scaling ratio corresponding to the map level, to obtain the minimum and maximum abscissa numbers corresponding to the projected abscissa on the map level; calculate the projected ordinate in the region's projected coordinates with reference to the level scaling ratio corresponding to the map level, to obtain the minimum and maximum ordinate numbers corresponding to the projected ordinate on the map level; construct a range of abscissas using the minimum and maximum abscissa numbers, and construct a range of ordinates using the minimum and maximum ordinate numbers; and combine the range of abscissas and the range of ordinates to obtain the range of abscissas and ordinates of the region's projected coordinates on the map level.
[0099] In one embodiment, the download module 803 is configured to, for each map level, obtain a preset level map corresponding to the map level; map the horizontal and vertical coordinate ranges corresponding to the map level onto the preset level map, determine the map range covered by the horizontal and vertical coordinate ranges on the preset level map; and download at least one map tile constituting the map range to obtain at least one map tile corresponding to the map level.
[0100] In one embodiment, the download module 803 is used to organize at least one map tile corresponding to each map level to obtain a tile file corresponding to each map level, and to name the corresponding tile file using the level number of each map level and its corresponding horizontal and vertical coordinate range; to obtain multiple tile files corresponding to the multiple map levels, and to package and compress the multiple tile files to obtain the multi-level offline map file.
[0101] In one embodiment, when the client displays an offline map of the target area using map tiles included in the multi-level offline map file, it loads the multi-level offline map file, decompresses the multi-level offline map file to obtain multiple tile files, determines the target map level currently selected by the user, queries the multiple tile files for the target tile file corresponding to the target map level, loads and displays the map tiles included in the target tile file, and completes the offline map display of the target area. Furthermore, when displaying the target area offline, the client obtains locally cached image service data, adjusts the image service data according to the scaling ratio corresponding to the currently displayed map level, and displays the adjusted image service data in a semi-transparent overlay on the currently displayed offline map.
[0102] This invention provides an offline map loading device. It determines the area to be downloaded as an offline map based on user selection and downloads map tiles according to the user-selected map layer, thus enabling the loading and display of offline maps. This does not involve modifying the map framework, requires no modification to map framework-related code, and eliminates the need for testing and compatibility adjustments to any modified map framework. This saves significant time and manpower costs, avoids impacting the stable operation of existing services, and can download only a portion of map resources according to user needs. This satisfies users' map loading requirements in different business scenarios while avoiding excessive memory consumption on the user's terminal, demonstrating good compatibility.
[0103] Specific limitations regarding the offline map loading device can be found in the limitations of the offline map loading method described above, and will not be repeated here. Each module in the aforementioned offline map loading device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0104] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of an offline map loading method on the server side.
[0105] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the functions or steps of an offline map loading method on the client side.
[0106] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0107] The target area of the offline map to be downloaded is determined, and at least one map level selected by the user for the target area is determined, wherein each of the at least one map level displays map details according to its corresponding level scaling ratio when the map is displayed;
[0108] Obtain the regional projection coordinates of the target area, and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level;
[0109] Referring to the horizontal and vertical coordinate ranges corresponding to each map level, at least one map tile is downloaded for each map level, and the at least one map tile corresponding to each map level is packaged to obtain a multi-level offline map file of the target area;
[0110] The multi-level offline map file is transmitted to the user's client, which stores the multi-level offline map file. When the client detects a user request to display a map of the target area while offline, it loads the map tiles included in the multi-level offline map file to display the offline map of the target area.
[0111] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0112] The target area of the offline map to be downloaded is determined, and at least one map level selected by the user for the target area is determined, wherein each of the at least one map level displays map details according to its corresponding level scaling ratio when the map is displayed;
[0113] Obtain the regional projection coordinates of the target area, and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level;
[0114] Referring to the horizontal and vertical coordinate ranges corresponding to each map level, at least one map tile is downloaded for each map level, and the at least one map tile corresponding to each map level is packaged to obtain a multi-level offline map file of the target area;
[0115] The multi-level offline map file is transmitted to the user's client, which stores the multi-level offline map file. When the client detects a user request to display a map of the target area while offline, it loads the map tiles included in the multi-level offline map file to display the offline map of the target area.
[0116] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0118] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0119] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An offline map loading method, characterized in that, include: The target area of the offline map to be downloaded is determined, and at least one map level selected by the user for the target area is determined, wherein each of the at least one map level displays map details according to its corresponding level scaling ratio when the map is displayed; Obtain the regional projection coordinates of the target area, and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level; Referring to the horizontal and vertical coordinate ranges corresponding to each map level, at least one map tile is downloaded for each map level, and the at least one map tile corresponding to each map level is packaged to obtain a multi-level offline map file of the target area; The multi-level offline map file is transmitted to the user's client, which stores the multi-level offline map file. When the client detects a user request to display a map of the target area while offline, it loads the map tiles included in the multi-level offline map file to display the offline map of the target area.
2. The method according to claim 1, characterized in that, The process of determining the target area for the offline map to be downloaded includes: When it is detected that the user requests to specify the target area of the offline map to be downloaded via text input, the administrative division information input by the user is obtained, and the administrative region indicated by the administrative division information is taken as the target area; or, When it is detected that the user requests to manually draw to determine the target area of the offline map to be downloaded, a pre-stored map view is displayed, and the area circled by the user on the map view is determined as the target area.
3. The method according to claim 1, characterized in that, The step of obtaining the regional projection coordinates of the target area and calculating the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level includes: Query the latitude and longitude coordinates of the target area, perform Mercator projection transformation on the latitude and longitude coordinates of the area, and use the coordinates obtained after transformation as the projected coordinates of the area; Query the scaling ratio corresponding to each map level, and calculate the range of horizontal and vertical coordinates of the region projection coordinates for each map level based on the scaling ratio and the region projection coordinates.
4. The method according to claim 3, characterized in that, The step of calculating the range of horizontal and vertical coordinates of the region projection coordinates at each map level based on the level scaling ratio and the region projection coordinates includes: For each map level, the projected abscissa in the region's projected coordinates is calculated with reference to the scaling ratio of the map level, to obtain the minimum and maximum abscissa numbers of the projected abscissa on the map level. Referring to the scaling ratio of the map level, the projected ordinate in the region's projected coordinates is calculated to obtain the minimum and maximum ordinate numbers corresponding to the projected ordinate on the map level. The range of the horizontal axis is constructed using the minimum number and the maximum number of the horizontal axis, and the range of the vertical axis is constructed using the minimum number and the maximum number of the vertical axis. The range of horizontal coordinates and the range of vertical coordinates are combined to obtain the range of horizontal and vertical coordinates of the projected coordinates of the region on the map level.
5. The method according to claim 1, characterized in that, The step of downloading at least one map tile corresponding to each map level by referring to the horizontal and vertical coordinate ranges corresponding to each map level includes: For each map level, obtain the preset level map corresponding to that map level; Map the horizontal and vertical coordinate ranges corresponding to the map level to the preset level map, and determine the map range covered by the horizontal and vertical coordinate ranges on the preset level map; Download at least one map tile that constitutes the map range to obtain at least one map tile corresponding to the map layer.
6. The method according to claim 1, characterized in that, The step of packaging at least one map tile corresponding to each map level to obtain a multi-level offline map file of the target area includes: At least one map tile corresponding to each map level is organized to obtain a tile file corresponding to each map level, and the tile file corresponding to each map level is named using the level number of each map level and its corresponding horizontal and vertical coordinate range. Obtain multiple tile files corresponding to the multiple map layers, package and compress the multiple tile files to obtain the multi-level offline map file.
7. The method according to claim 6, characterized in that, When the client displays the offline map of the target area using the map tiles included in the multi-level offline map file, it loads the multi-level offline map file, decompresses the multi-level offline map file to obtain the multiple tile files, determines the target map level currently selected by the user, queries the multiple tile files for the target tile file corresponding to the target map level, loads and displays the map tiles included in the target tile file, and completes the offline map display of the target area. When the client displays the target area as an offline map, it obtains locally cached image service data, adjusts the image service data according to the scaling ratio corresponding to the currently displayed map level, and displays the adjusted image service data in a semi-transparent form overlaid on the currently displayed offline map.
8. An offline map loading device, characterized in that, include: A determination module is used to determine the target area of the offline map to be downloaded, and to determine at least one map level selected by the user for the target area, wherein each of the at least one map level displays map details according to its corresponding level scaling ratio when displaying the map; The calculation module is used to obtain the regional projection coordinates of the target area and calculate the range of horizontal and vertical coordinates corresponding to the regional projection coordinates at each map level. The download module is used to download at least one map tile corresponding to each map level by referring to the horizontal and vertical coordinate ranges corresponding to each map level, and to package at least one map tile corresponding to each map level to obtain a multi-level offline map file of the target area. The transmission module is used to transmit the multi-level offline map file to the user's client, whereby the client stores the multi-level offline map file. When the client detects a user request to display a map of the target area while offline, it loads the map tiles included in the multi-level offline map file to display the offline map of the target area.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the offline map loading method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the offline map loading method as described in any one of claims 1 to 7.
Citation Information
Cited By
A page loading method, system, device, storage medium and electronic equipment
CN122450574A