Map display method and system based on grid map layer and medium

By using a pre-tiered loading cache and a raster layer display method that controls the visibility and transparency attributes, the problems of uncontrollable tile timing and texture switching flickering are solved, achieving smooth switching of raster layers and performance optimization.

CN120910107APending Publication Date: 2025-11-07STATE GRID SICHUAN ELECTRIC POWER CORP ELECTRIC POWER RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511096702.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing raster-layer-based map display methods cannot effectively solve the problems of uncontrollable tile timing and texture switching flickering, which limits the user experience in high-frequency carousel services such as real-time monitoring and time-series animation.

Method used

By pre-loading cached raster layers in a hierarchical manner and controlling the visibility and transparency attributes, the overlay and layer carousel of raster layers can be achieved, avoiding the layer loading and destruction process and only switching the display attributes to achieve smooth transitions.

Benefits of technology

It effectively solved the problems of layer flickering and lag when switching, optimized the scaling performance of raster layers, reduced the amount of data requests, and improved the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910107A_ABST
    Figure CN120910107A_ABST
Patent Text Reader

Abstract

The invention discloses a map display method and system based on a grid map layer and a medium, and relates to the technical field of visual display. According to the scheme, a new technical concept is provided, starting from the control display logic of the grid layers, the problem of the layer loading sequence is solved through pre-hierarchical loading and caching of the grid layers, and grid layer superposition and layer carousel are achieved in cooperation with control over the display-hidden attributes and the transparency attributes of the grid layers; in the layer carousel process, only the display attributes of different grid layers need to be switched, and the whole grid layers do not need to be destroyed and loaded, so that the gap of transition time is avoided, and the problems of layer flickering and switching lagging are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of visual display, and particularly relates to a map display method and system based on a grid layer and a medium. BACKGROUND

[0002] With the rapid development of web geographic information systems and mobile geographic information systems, the grid layer has become a core display method of online map services. The basic idea is to cut a continuous surface (such as a digital elevation model, remote sensing image, meteorological element field, etc.) into small size tiles, and store them in the form of a quadtree pyramid, and the client requests and splices the tiles on demand, thereby realizing the rapid visual rendering and interaction of large-scale continuous surfaces.

[0003] Through the multi-resolution tile pyramid, global scale smoothing zooming can be realized, and continuous scenes such as terrain, temperature, and precipitation can be truly restored; and rapid visual rendering and cross-platform compatibility can be more easily realized.

[0004] However, in actual business scenarios, layer rotation (time sequence comparison, animation demonstration, real-time monitoring) has higher requirements for visual fluency, and the existing grid layer technology exposes the following defects: 1. Tile loading order is uncontrollable: factors such as browser parallel request, network bandwidth difference, server cache hit rate, etc. cause the tile arrival order to be random, and the phenomenon of "puzzle" gradual filling appears; for continuous field layers with transparency gradient or color mapping, local tile delayed loading will form obvious "holes" or "jaggies".

[0005] 2. Layer switching flicker: the traditional method is to unload the old layer first and then load the new layer when switching, and there is a blank frame of graphics processor texture release and reconstruction during this period, resulting in instantaneous black field or white field; if a "fade-in and fade-out" transition is used, due to the fact that the texture size and color depth of new and old tiles are not completely consistent, visual artifacts such as color bands and halos are easily generated when superimposed.

[0006] The current common solutions in the industry (such as tile preloading, placeholder, transition mask, and web graphics language double buffering) can only alleviate the impact in local scenarios, and cannot fundamentally solve the contradiction between uncontrollable tile time sequence and texture switching flicker, thereby limiting the user experience of the grid layer in high-frequency rotation business such as real-time monitoring and time sequence animation. SUMMARY

[0007] The technical problems to be solved by the present application are: the existing map display method based on the grid layer can only reduce the influence in a local scene, and cannot fundamentally solve the contradiction between uncontrollable tile timing and texture switching flicker, thereby limiting the user experience of the grid layer in real-time monitoring, time sequence animation and other high-frequency carousel services; the present application aims to provide a map display method, system and medium based on the grid layer, which improves the method on the basis of the existing technology, and proposes a new technical concept: starting from the control display logic of the grid layer, the pre-classified loading cache of the grid layer is used to solve the layer loading sequence problem, the grid layer superposition and layer carousel are realized by cooperating with the control of the display attribute and the transparency attribute of the grid layer, and the display attribute of different grid layers only needs to be switched in the layer carousel process, without destroying and loading the entire grid layer, thereby avoiding the gap of transition time and effectively solving the layer flicker and switching lag problems.

[0008] The present application is realized by the following technical solutions: The present application provides a map display method based on the grid layer, which comprises: Pre-classified loading cache of the grid layer of each project; each project corresponds to a plurality of grid layers; Superimpose the grid layers corresponding to each project respectively, and initialize the display attributes of each grid layer, including the display attribute and the transparency attribute: configure the display attribute of each grid layer as hidden, and the transparency attribute as full transparent; Obtain the project display instruction of the user, and adjust the display attribute of the corresponding grid layer to realize project display according to the project display instruction.

[0009] The further optimization scheme is that the pre-classified loading cache of the grid layer of each project comprises the following method: Determine the first screen area and the non-first screen area of each project; The grid layer of the first screen area is loaded by the first mechanism; The grid layer of the non-first screen area is loaded by the second mechanism; The cache loading performance of the second mechanism is better than that of the first mechanism; the cache loading performance includes loading speed, storage mode and storage location.

[0010] The further optimization scheme is that, The first mechanism includes server caching; The second mechanism includes local database caching.

[0011] The further optimization scheme is that the determination of the first screen area and the non-first screen area of each project comprises the following method: Obtain the user historical operation data of each project; fitting a user historical operation path based on a Bezier curve and user historical operation data; A preset hit rate threshold is set, and a first screen area and a non-first screen area are divided according to the user historical operation path: the grid layer with a hit rate greater than or equal to the hit rate threshold is the first screen area, and the grid layer with a hit rate less than the hit rate threshold is the non-first screen area.

[0012] A further optimization scheme further includes a method: The superimposed grid layer is configured with a culling depth: the blending mode of each grid layer is adjusted to a non-penetrating mode.

[0013] A further optimization scheme includes a method of obtaining a project display instruction of a user, and adjusting the display attribute of the corresponding grid layer according to the project display instruction to realize project display. A. Layer carousel of all grid layers of the target project: determine whether the current grid layer is the first grid layer, and when the current grid layer is the first grid layer, sequentially set the visibility attribute of the first grid layer to display and the transparency attribute to opaque, and perform layer carousel; when the current grid layer is not the first grid layer, set the visibility attribute of the previous layer to hidden and the transparency attribute to transparent, and sequentially set the visibility attribute of the current grid layer to display and the transparency attribute to opaque, and perform layer carousel. B. Determine whether the layer carousel is ended, and if not, update the current grid layer to the next grid layer, and repeat step A until the carousel is ended.

[0014] A further optimization scheme is that in the layer carousel process, multiple grid layers update the transparency attribute through the same shader channel.

[0015] A further optimization scheme further includes: presetting a maximum number of layer tiles Z max When responding to the zoom instruction of the user, the grid layer is zoomed and displayed within the maximum number of layer tiles Z max The maximum number of layer tiles Z max is determined by the size of the display screen, the size of the layer tile, and the resolution of the display screen.

[0016] The present scheme also provides a map display system based on grid layers, which is used to implement the above-mentioned map display method based on grid layers, and the system includes: A preloading module for pre-classified loading and caching grid layers of each project; each project corresponds to multiple grid layers; An initialization module for superimposing the grid layers corresponding to each project respectively, and initializing the display attributes of each grid layer, including the visibility attribute and the transparency attribute: configuring the visibility attribute of each grid layer to hidden and the transparency attribute to full transparent; The display module is configured to acquire a project display instruction of a user, and adjust display attributes of a corresponding grid layer to realize project display according to the project display instruction.

[0017] The present application also provides a computer readable medium, which stores a computer program, and the computer program is executed by a processor to realize the map display method based on the grid layer.

[0018] Compared with the prior art, the present application has the following advantages and beneficial effects: 1. The map display method, system and medium based on the grid layer provided by the present application provide a new technical concept: starting from the control display logic of the grid layer, the pre-classified loading cache of the grid layer is used to solve the layer loading sequence problem, the grid layer superposition and layer carousel are realized by combining the control of the display and hidden attributes and the transparency attribute of the grid layer, and in the layer carousel process, only the display attributes of different grid layers need to be switched, and the entire grid layer does not need to be destroyed and loaded, so that the time gap in the transition is avoided, and the problems of layer flickering and switching lag are effectively solved.

[0019] 2. The map display method, system and medium based on the grid layer provided by the present application; the grid layer switching is performed in combination with the display and hidden attributes and the transparency attribute of the grid layer, only the current display grid layer is set to be displayed and opaque, and the remaining grid layers are set to be hidden and fully transparent, the map no longer requests the pictures of the hidden grid layers during the zoom operation, the data request amount during the zoom operation can be greatly reduced, and the performance during the zoom operation of the grid layer is optimized.

[0020] 3. The map display method, system and medium based on the grid layer provided by the present application; before the user enters the application, each project grid layer is preloaded and cached, the display and hidden attributes of all preloaded grid layers are initialized and set to be hidden, and the transparency attribute is set to be fully transparent; at any moment of the layer carousel, only the display and hidden attribute of one grid layer is set to be displayed and opaque, only the grid layer is visible, and the other grid layers are invisible, the layer carousel is completed in combination with the display and hidden attributes of the grid layer, and hardware-level resource recycling is realized at the same time.

[0021] 4. The map display method, system and medium based on the grid layer provided by the present application; by using the grid layer level restriction and the grid layer display control, the sending request of the grid layer during the execution of the zoom instruction is reduced, and the system resources are saved. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be considered as a limitation to the scope. Other related drawings can also be obtained by those skilled in the art without paying any creative effort on the basis of these drawings. In the drawings: Figure 1 The flowchart of the map display method based on the raster layer; Figure 2 The schematic diagram of the layer carousel process based on the raster layer; Figure 3 The schematic diagram of the preprocessing process of the raster layer; Figure 4 The schematic diagram of the layer carousel process; Figure 5 The schematic diagram of the traditional raster layer carousel process. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the present application more clear and obvious, the following will further describe the present application in combination with the embodiments and drawings. The exemplary embodiments of the present application and their descriptions are only used to explain the present application, and should not be considered as a limitation to the present application.

[0024] For the raster layer composed of layer tiles (slice pictures), the layer tiles are stacked in a pyramid system, and the display logic is that the first layer raster layer has 2 0 =1 row 2 1 column layer tiles; the second layer raster layer has 2 2 =4 row 2 3 =8 column layer tiles, and so on; the common one is the SxMap of the power grid industry; the SxMap is a multi-threaded tile scheduling engine based on an open source kernel, supports dynamic projection coordinate system conversion, can realize flexible conversion between different geographic coordinate systems (such as conversion from EPSG:4490 coordinate system to EPSG:3857 coordinate system), and supports domestic encryption protocol transmission. The raster layer loading process thereof is shown in Figure 5 , which usually loads the current raster layer first, and then destroys the previous raster layer; the specific process includes: initializing the map, the user enters the application, loading the nth (initial n=1) raster layer, performing layer carousel, judging whether the carousel is ended, if not, loading the next raster layer (n=n+1) and destroying the previous raster layer, and repeating the above process until the carousel is ended.

[0025] The above-mentioned raster layer switching method mainly has two defects: 1. There is an obvious order in the loading of layer tiles: the above-mentioned layer tile loading logic loads the second grid layer only after the first grid layer is loaded, resulting in a visible loading order; therefore, users will see the grid layers loaded one after another instead of appearing simultaneously; generally, browsers will limit the number of Web Worker threads to within 4, and when multiple tiles need to be loaded in parallel, the layer tile loading may be delayed due to download queue blocking, resulting in users being able to obviously observe the sequential loading of grid tiles, with obvious stuttering.

[0026] 2. There is obvious flickering in the switching of grid layers: the above-mentioned grid layer switching logic is prone to empty frames, resulting in visible flickering; the existing grid layer switching logic is implemented based on the Open Graphics Library (OpenGL), which implements the process of removing the old layer from the map and adding the new layer. During the layer switching process, the core function of context switching needs to spend 3-5 ms / time in synchronizing the global state machine, resulting in a sharp drop in frame rate (frames per second, FPS ≤ 30), which in turn causes no new frames to be rendered on the screen for a short period of time, resulting in a delay that is visually manifested as flickering during layer switching.

[0027] As can be seen, the existing grid layer switching method has two major defects: 1. There is an obvious order in the loading of tiles; 2. There is obvious flickering in the switching of layers; both of which affect the smoothness of the switching of grid layers. In view of this, the present scheme provides the following embodiments to solve the above-mentioned problems.

[0028] Embodiment 1 The present embodiment provides a map display method based on grid layers, as shown in Figure 1 , which comprises the following steps: Step 1: Pre-classified loading of each project's grid layer; each project corresponds to multiple grid layers; this step specifically includes the following methods: S11, determine the first-screen area and the non-first-screen area of each project; step S11 specifically includes the following methods: S111, obtain user historical operation data; S112, fit the user historical operation path based on the Bezier curve and the user historical operation data; S113, preset a hit rate threshold, and divide the first-screen area and the non-first-screen area according to the user historical operation path: the grid layer with a hit rate greater than or equal to the hit rate threshold is the first-screen area, and the grid layer with a hit rate less than the hit rate threshold is the non-first-screen area. The hit rate threshold is different in different projects, and the hit rate threshold is specifically set according to experience.

[0029] S12, cache loading is performed on the layer tiles of the first-screen area by a first mechanism, and cache loading is performed on the layer tiles of the non-first-screen area by a second mechanism; the cache loading performance of the second mechanism is superior to that of the first mechanism; the cache loading performance includes loading speed, storage mode, and storage location.

[0030] The first-screen area in the present solution can be understood as an initial display grid layer that can be seen without scrolling when the user opens the application, and the non-first-screen area is other grid layers displayed after the first-screen area.

[0031] The first mechanism in the present solution includes server caching, and the second mechanism includes local database caching, such as storage in an IndexedDB database (a local database of a front-end browser).

[0032] Specifically, the in-memory residence of all layer tiles can be completed before the DOMContentLoaded event (a web element loading completion event) of the web page is triggered through the pre-fetching mechanism of an asynchronous thread pool.

[0033] Since a large number of grid layers of multiple cache items need to be loaded at the same time, in order to optimize the cache loading process, the present solution determines the first-screen area and the non-first-screen area, the first-screen area is directly cached by the server, which is faster than disk storage, and the non-first-screen area is stored by the disk (database). After all tile data requests are made to the local database, they are stored by the local database, which is faster, and hierarchical loading of the grid layers is achieved, improving the display effect.

[0034] Specifically, since all layer tiles are on the server, the operation data when requesting the layer tile each time can be recorded; generally, the user starts from the first raster layer and plays in turn, so the layer tile requested most times naturally belongs to the raster layer played most times; in view of this, the scheme acquires user historical operation data, fits the user historical operation path by means of a Bezier curve, sets a hit rate threshold according to experience, screens out the most frequently requested layer tile, determines the most frequently requested raster layer to obtain the first-screen layer; finally, the first-screen area is the hotspot area with the highest user query heat, in the embodiment, the hit rate threshold is set to 92% according to experience, the first-screen area and the non-first-screen area are determined according to the user historical operation path fitted by the Bezier curve, for the first-screen area frequently queried by the user (the hit rate is greater than or equal to 92%), direct cache storage is performed, for the non-first-screen area less frequently queried by the user (the hit rate is less than 92%), disk storage is performed, and the background is slowly loaded; whether the first-screen or the non-first-screen, all raster layers are stored in the local database after reaching the local area; when some projects have special requirements and the data may change every day, the layer tile can be updated at a fixed time every day, the cache and the database on the server side are updated; the local database on the front end also replaces the previous content with the requested data at the agreed time (usually half an hour after the raster layer is updated by the layer server), or directly updates the local data when the user opens for the first time to realize synchronous updating; since the latest data is always on the server side, the raster layer stored in the local database is updated every day. For example, the weather data in a project is updated at a fixed time of 8 o'clock every day, after 8 o'clock, the server side needs to regenerate the layer tile according to the latest data, for example, at 8:10, the cache server starts to cache the layer tile of the first-screen area; after the raster layer on the server side (including the cache and the database) is updated, the browser opens the program and preloads the raster layer, and when the raster layer is requested for the first time (for example, at about 8:30), the local data is updated; when the user opens the program at other times (for example, at 3 o'clock in the afternoon), since the server has been updated, the front-end database updates the raster layer in full when opened for the first time.

[0035] Step two: superimpose the raster layers corresponding to each project respectively, and initialize the display attributes of each raster layer, including the display and hidden attributes and the transparency attribute; specifically, the display attribute of each raster layer is initialized to be hidden, and the transparency attribute is initialized to be fully transparent; As Figure 2As shown, the pre-processing process includes a pre-classified loading cache process and an initialization process. After the pre-classified loading cache is completed, the display properties of all preloaded raster layers are set to hidden and the transparency is set to full transparency. At this time, although the raster layers have been loaded into the memory, they will not be rendered to the screen, and therefore will not occupy any rendering resources. Only when the raster layer is truly required to be displayed, the display property is set to display and the transparency is set to opaque, thereby achieving the efficient preloading effect of zero rendering occupation.

[0036] Step three: obtaining the project display instruction of the user, and adjusting the display property of the corresponding raster layer according to the project display instruction to realize the project display. When the user enters the application and wants to display a certain project, the user needs to issue a project display instruction. The application adjusts the display property of the corresponding raster layer according to the project display instruction to realize the project display, such as Figure 3 As shown, the method specifically includes the following steps: A. Layer carousel of all raster layers of the target project: determine whether the current raster layer is the first raster layer. When the current raster layer is the first raster layer (n=0), sequentially set the display attribute of the first raster layer to display and the transparency attribute to opaque, and perform layer carousel. When the current raster layer is not the first raster layer (n≠0), set the display attribute of the previous layer (the (n-1)th raster layer) to hidden and the transparency attribute to transparent, and simultaneously sequentially set the display attribute of the current raster layer to display and the transparency attribute to opaque, and perform layer carousel. Specifically, when performing layer carousel, the current raster layer is generally the first raster layer at the beginning of the carousel. When the user starts the carousel, there may be other operation instructions (such as the user manually clicking to select any one as the first played layer), which may cause the current raster layer to be not the first raster layer. At this time, the current raster layer needs to be the first raster layer before starting the carousel. Specifically, the first raster layer of each project can be marked. Whether the raster layer is marked or not is used to determine whether it belongs to the first raster layer.

[0037] B. Determine whether the layer carousel is ended. If not, update the current raster layer to the next raster layer (the (n+1)th raster layer), and repeat step A until the carousel is ended.

[0038] In the layer carousel process, multiple raster layers update the transparency attribute through the same shader channel. Specifically, the display attribute of the previous raster layer can be set to hidden, and the display attribute of the current raster layer can be set to displayed. The transparency attribute of the previous raster layer is updated to full transparency through the atomic counter of the WEBGL API, and the transparency of the current displayed raster layer is updated to opaque. The updated transparency value is transmitted to the GLSL shader (a shader implemented based on the graphics processing programming language GLSL), and the transparency attribute of all superimposed raster layers is updated through a single WEBGL API drawing call to realize lock-free raster layer switching. The entire process takes less than 0.5 ms, and the flicker cannot be observed by the naked eye, realizing smooth raster layer switching.

[0039] In a possible implementation, the method further includes: performing culling depth configuration on the superimposed raster layers; and adjusting the blending mode of each raster layer to a non-penetrating mode. Specifically, when processing the superposition of transparent layers, in order to avoid depth conflicts between the transparent layers, the depth test in the WEBGL API is disabled, so that all raster layers are rendered onto the screen without being discarded according to the depth value.

[0040] In a possible implementation, the display attribute can be used to set the display attribute of the layer to displayed or hidden. The display attribute can be used to hide an element, so that the element is not displayed on the page and does not occupy any space, and hardware-level resource recycling is realized.

[0041] It should be noted that in principle, the carousel effect can be realized through raster layer preloading and raster layer superposition. However, in actual applications, if only these two points are achieved, the practicability of the layer carousel is not high. For example, in a certain project, raster layers of three projects of gale, rainfall and temperature of a province need to be cycled. The number of tiles displayed on the current screen is Q=(W p / W w ) * (H p / H w ); where W p represents the screen resolution width, in px; W w represents the layer tile width, in px; H p represents the screen resolution height, in px; and H wrepresents the size of the layer tile, unit: px; in this embodiment, the screen is 23.8 inches with a resolution of 1920*1080, and the size of the layer tile in the project is 256px*256px; then the number of tiles displayed on the current screen Q = (1920 / 256)*(1080 / 256) = 8*5 = 40; in this embodiment, the grid layer publishing method is not to request a complete grid layer, but to request a layer tile separately; therefore, the geographical boundary allowance of ±0.5px needs to be considered to avoid missing edge data; thus, the corrected request quantity Q is 9*6 = 54 times; the project predicts the data of the last 3 days, the first day is one data every hour, the second and third days are one data every 6 hours, and the gale, rainfall and temperature projects are independently performed layer rotation, and the layer is rotated 32 (24+4+4) times; when the user views the rainstorm influence range of the subordinate area on the map, the layer rotation is paused, and the map level is zoomed in; if no other processing is performed, when the user zooms in to the village level, the grid layer sends a request picture 1728 (32*54) times in total, causing the computer CPU to overload and the page to crash; therefore, the scheme also needs to consider optimizing the performance, specifically from two aspects: limiting the maximum number of layer tiles of the grid layer and controlling the visibility of the grid layer; through the above two optimization aspects, the sending request of the grid layer in the zooming instruction execution process is reduced, and the system resources are saved.

[0042] Specifically, the maximum number of layer tiles Z max is set in advance max , the grid layer is zoomed and displayed within the maximum number of layer tiles Z max in response to the zooming instruction of the user; and the maximum number of layer tiles Z max is determined by the size of the display screen, the size of the layer tile and the resolution of the display screen.

[0043] Regarding the limitation of the maximum number of layer tiles of the grid layer, in one possible implementation, the calculation formula of the maximum number of layer tiles Z max is as follows: Z max =⌊ ⌋; wherein, ⌊⌋ represents a down rounding function, DPI represents the resolution of the display screen; S 屏 represents the size of the display screen; and S 瓦 represents the size of the layer tile. Specifically, by limiting the maximum number of layer tiles of the raster layer, over-requesting of the raster layer can be avoided, and the layer carousel performance is further optimized. For example, when the display screen is 12 inches, the DPI is 96px, and the tile size is 256mm*256mm, the maximum number of layer tiles thereof is calculated to be 8 according to the formula, that is, when the raster map is displayed in a zoomed manner, the number of layer tiles of the raster layer increases with the magnification of the zoom level, but the maximum number of layer tiles of the raster layer is 8, because 8 tiles are sufficient to clearly display the content of the raster layer, and it is unnecessary to request more layer tiles, which effectively avoids over-requesting of the raster layer and further optimizes the layer carousel performance.

[0044] Regarding the display control of the raster layer, the raster layer that is hidden according to the aforementioned display and hide attribute setting is no longer requested by the map during zooming, thereby reducing the data request amount during zooming. In the above example, the display and hide attribute of only one raster layer is set to display, and the display and hide attributes of the remaining raster layers are set to hide; therefore, even if the user pauses the carousel for zooming, at most 8 (2 8 =256) requests are sent each time, 2 8 =256 represents the maximum number of layer tiles requested at a time.

[0045] To verify the effect of the present scheme, layer carousels of a meteorological platform of a certain provincial company were executed by using the traditional method and the method of the present application, respectively. The meteorological platform of the certain provincial company uses layer carousels of three projects of temperature, precipitation, and wind force. According to the traditional method, 2 12 =4096 layer tiles are generated on a 4K screen (DPI=192px); according to the method of the present application, the maximum number of layer tiles is calculated to be 512, and the maximum number of layer tiles is set to 512 in advance; when 2 12 =4096 layer tiles are requested on a 4K screen (DPI=192px), the number of tiles of a single raster layer is reduced from 4096 to 512 due to the pre-setting of the maximum number of layer tiles to 512 according to the present scheme, and the GPU memory occupation is reduced from 3.2GB to 860MB, which reduces by 87.5%; it can be seen that the method of the present application realizes smooth switching of layers, and greatly improves the layer switching performance without affecting the rendering effect.

[0046] In order to further verify the effect of the present application, the present application is compared with the gradual change animation switching method, which is a commonly used method for optimizing layer display. The logic of the gradual change animation switching method is to control the transparency of the layer, and to fade out the previous layer while fading in the next layer, so that the layer switching can be performed more gently. However, the human eye can capture changes of 0.1 seconds, and as long as there is a 0.1 second gap between the faded-in layer and the faded-out layer, a slight flicker will be observed. Therefore, the gradual change animation can only make the flicker softer, and cannot completely solve the flicker. The method of the present application can achieve millisecond-level layer switching, and the human eye cannot observe the flicker phenomenon. In addition, please refer to Table 1, which is a comparison table of the effects of the present application method and the traditional method.

[0047] Table 1 Comparison table of the effects of the present application method and the traditional method

[0048] It can be seen that the switching method provided by the present application has a large optimization in the first screen loading time, layer switching delay, memory occupation branch, and GPU texture switching times.

[0049] Due to the mechanism of the raster layer map, the raster layer cannot be completely loaded at one time, thereby existing a display order problem from right to left or from right bottom to left top, causing switching lag. The existence of this problem is caused by the map mechanism, and it is difficult to solve from the code level. Therefore, the present scheme provides a new technical concept: starting from the control display logic of the raster layer, the layer carousel is realized through the adjustment of the preloading, display and hide attributes and the transparency attribute of the raster layer, thereby avoiding the switching lag problem.

[0050] Specifically, before the layer carousel display of the Think Extreme map is performed (before the user enters the application), each project raster layer is preloaded and cached in advance, at this time, the display and hide attribute of all preloaded raster layers is set to hidden, and the transparency attribute is set to full transparency (such as setting the transparency to 0); when the layer carousel is performed, the display and hide attribute of the current display raster layer is set to displayed, and the transparency attribute is set to opaque (setting the transparency to 1), and the display and hide attribute of the previous raster layer is set to hidden, and the transparency attribute is set to 0, thereby performing the superposition display of the raster layers. At any moment of the layer carousel, there is only one raster layer whose display and hide attribute is displayed and whose transparency attribute is 1, and only this raster layer is visible, and the other raster layers are not visible. It should be noted that when the layer carousel is performed, the display and hide attribute of the raster layer must be set first, and then the transparency attribute is set, otherwise the preloading of the raster layer cannot take effect, and the layer carousel will still flicker.

[0051] It is worth mentioning that for the map, even if the transparency of the grid layer is set to 0, the map will still consider that the grid layer is in use, and the picture of the grid layer will still be requested during the zoom operation. Therefore, the present scheme combines the display and hiding attributes and the transparency attribute of the grid layer to switch the grid layer, only sets the currently displayed grid layer to be displayed and opaque, and sets the remaining grid layers to be hidden and fully transparent, so that the map no longer requests the picture of the hidden grid layer during the zoom operation, and the data request amount during the zoom operation can be greatly reduced, and the performance during the zoom operation of the grid layer is optimized.

[0052] Compared with the prior art, the improvement of the present application is that the preloading of the grid layer is completed in advance before the layer carousel, the loading sequence problem is avoided, the display and hiding attributes of the grid layer are switched during the layer carousel process to realize the switching, the destruction and loading of the entire grid layer are not involved, the transition time gap problem is solved, the grid layer flickering is avoided, and the performance during the zoom operation of the grid layer is optimized. The present application comprehensively considers the preloading of the grid layer, the display and hiding attribute setting, and the transparency attribute setting, solves the problems of obvious sequence of the grid layer loading and layer flickering, and realizes the smooth switching of the grid layer.

[0053] Embodiment 2 The present embodiment provides a map display system based on a grid layer, which is used to realize the map display method based on the grid layer in embodiment 1, as shown in Figure 5 The present embodiment provides a map display system based on a grid layer, which is used to realize the map display method based on the grid layer in embodiment 1, as shown in The preloading module is used to pre-classify and load the grid layers of each project in cache; each project corresponds to a plurality of grid layers; The initialization module is used to superimpose the grid layers corresponding to each project respectively, and initialize the display attributes of each grid layer, the display attributes including the display and hiding attributes and the transparency attribute: the display and hiding attributes of each grid layer are configured to be hidden, and the transparency attribute is configured to be fully transparent; The display module is used to obtain the project display instruction of the user, and adjust the display attributes of the corresponding grid layer to realize the project display according to the project display instruction.

[0054] Embodiment 3 The present embodiment provides a computer readable medium, which stores a computer program, and the computer program is executed by a processor to realize the map display method based on the grid layer in embodiment 1; the following steps are specifically executed: Step one: pre-classify and load the grid layers of each project in cache; each project corresponds to a plurality of grid layers; Step two: superimpose the grid layers corresponding to each project respectively, and initialize the display attributes of each grid layer, the display attributes including the display and hiding attributes and the transparency attribute: the display and hiding attributes of each grid layer are configured to be hidden, and the transparency attribute is configured to be fully transparent; Step three: obtaining the project display instruction of the user, and adjusting the display attribute of the corresponding grid layer according to the project display instruction to realize the project display.

[0055] The above specific embodiments further explain the purpose, technical scheme and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for map presentation based on raster layers, characterized in that, The method comprises the following steps: preloading and caching raster layers of each project; each project corresponds to a plurality of raster layers; superimposing the raster layers corresponding to each project respectively, and initializing display attributes of each raster layer, wherein the display attributes comprise a display attribute and a transparency attribute; the display attribute of each raster layer is configured as hidden, and the transparency attribute is configured as full transparency; obtaining a project display instruction of a user, and adjusting the display attribute of the corresponding raster layer according to the project display instruction to realize project display.

2. The map presentation method based on raster layers according to claim 1, characterized in that, The preloading and caching of the raster layers of each project comprises the following steps: determining a first-screen area and a non-first-screen area of each project; caching and loading the raster layers of the first-screen area by using a first mechanism; caching and loading the raster layers of the non-first-screen area by using a second mechanism; wherein the caching and loading performance of the second mechanism is better than that of the first mechanism; the caching and loading performance comprises loading speed, storage mode and storage location.

3. The map presentation method based on raster layers according to claim 2, characterized in that, The first mechanism comprises server caching. The second mechanism comprises local database caching.

4. The map presentation method based on the raster layer according to claim 2, characterized in that, The first-screen area and the non-first-screen area of each project are determined by the following method: obtaining user historical operation data of each project; fitting a user historical operation path based on a Bezier curve and the user historical operation data; presetting a hit rate threshold, and dividing the first-screen area and the non-first-screen area according to the user historical operation path; the raster layers with a hit rate greater than or equal to the hit rate threshold are the first-screen area, and the raster layers with a hit rate less than the hit rate threshold are the non-first-screen area. The method further comprises the following steps:

5. The map presentation method based on raster layers according to claim 1, characterized in that, performing culling depth configuration on the superimposed raster layers; adjusting the blending mode of each raster layer to a non-penetrating mode. The method for obtaining the project display instruction of the user and adjusting the display attribute of the corresponding raster layer according to the project display instruction to realize project display comprises the following steps:

6. The map presentation method based on raster layers according to claim 1, characterized in that, A. performing layer rotation on all raster layers of a target project; determining whether the current raster layer is the first raster layer; when the current raster layer is the first raster layer, sequentially setting the display attribute of the first raster layer to displayed and the transparency attribute of the first raster layer to opaque, and performing layer rotation; when the current raster layer is not the first raster layer, setting the display attribute of the previous layer to hidden and the transparency attribute of the previous layer to transparent, and sequentially setting the display attribute of the current raster layer to displayed and the transparency attribute of the current raster layer to opaque, and performing layer rotation; B. determining whether the layer rotation is completed; if not, updating the current raster layer to the next raster layer, and repeating step A until the layer rotation is completed. In the layer rotation process, the plurality of raster layers are uniformly updated in the transparency attribute through the same shader channel. The system further comprises:

7. The map presentation method based on raster layers according to claim 6, characterized in that, The system for realizing the map display method based on raster layers according to any one of claims 1-8 comprises:

8. The map presentation method based on a raster layer according to Claim 1, wherein, a preloading module configured to preloading and cache raster layers of each project; each project corresponds to a plurality of raster layers; Pre-set maximum layer tile quantity Z max , in response to the zoom instruction of the user, the grid layer is zoomed and displayed within the maximum layer tile quantity Z max . the maximum number of layer tiles Z max determined by the display screen size, the layer tile size and the display screen resolution.

9. A map presentation system based on raster layers, characterized in that an initialization module configured to superimpose the raster layers corresponding to each project respectively, and initialize display attributes of each raster layer, wherein the display attributes comprise a display attribute and a transparency attribute; the display attribute of each raster layer is configured as hidden, and the transparency attribute is configured as full transparency; ​ ​ A display module is configured to acquire a project display instruction of a user, and adjust display attributes of a corresponding raster layer to realize project display according to the project display instruction.

10. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the raster layer-based map display method of any one of claims 1-8.