Map rendering method, device, equipment and storage medium

By determining the data source to be rendered and creating a layer when receiving a map construction request, and rendering it in the map view window when receiving a rendering instruction, using a parallel rendering and rendering cache mechanism, each data update in the existing technology is solved. The problem of high consumption of rendering resources improves rendering efficiency.

CN112862940BActive Publication Date: 2024-11-19SOUTH SURVEYING & MAPPING INSTR
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202110261212.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-10
Publication Date
2024-11-19
Estimated Expiration
2041-03-10

AI Technical Summary

Technical Problem

In the prior art, each layer of the map data needs to be re-rendered every time the map data is updated, resulting in a large consumption of rendering resources and low rendering efficiency.

Method used

Determine the data source to be rendered by receiving map construction requests, create the layer to be rendered and the map view window, and render the layer in the view window when the rendering instruction is received, and adopts parallel rendering and rendering cache mechanisms to improve efficiency.

Benefits of technology

It effectively reduces the use of rendering resources, improves rendering efficiency, and solves the problem of waste of rendering resources every time data is updated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112862940B_ABST
    Figure CN112862940B_ABST
Patent Text Reader

Abstract

The present invention discloses a map rendering method, device, equipment and storage medium. The method comprises: responding to a received map construction request, determining a data source to be rendered; creating a layer to be rendered for each data source to be rendered, and creating a map view window; loading all the layers to be rendered into the map view window; when a map rendering instruction is received, rendering the layers to be rendered in the map view window, generating a map view, thereby more effectively reducing the rendering resources used and improving the rendering efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image rendering technology, and in particular to a map rendering method, device, equipment and storage medium. Background Art

[0002] In GIS, surveying and mapping and other related fields, in addition to loading various online maps, it is also necessary to load various raster data and vector data, such as shp data, tif data, etc. In addition, there are many data that can be abstracted into layers for management, such as ship types during water surveys, aircraft during aerial surveys, compasses, scales, etc. How to quickly manage these online maps and data and render them efficiently will become a problem that must be solved when developing such application software.

[0003] In the prior art, each time the map data changes, the image rendering is directly performed layer by layer to obtain the target map data. However, the above method requires re-rendering each layer each time the data is updated, which consumes more rendering resources and has low rendering efficiency. Summary of the invention

[0004] The present invention provides a map rendering method, device, equipment and storage medium, which solves the technical problem in the prior art that each layer needs to be re-rendered each time the data is updated, resulting in a large number of rendering resources and low rendering efficiency.

[0005] A first aspect of the present invention provides a map rendering method, comprising:

[0006] In response to the received map building request, determine the data source to be rendered;

[0007] Creating a layer to be rendered for each data source to be rendered, and creating a map view window;

[0008] Loading all the layers to be rendered into the map view window;

[0009] When a map rendering instruction is received, the layer to be rendered is rendered in the map view window to generate a map view.

[0010] Optionally, the step of determining the data source to be rendered in response to the received map building request includes:

[0011] When a map building request is received, determining whether there is a data source to be rendered corresponding to the map building request in a preset database;

[0012] If it exists, then loading the data source to be rendered from the preset database;

[0013] If it does not exist, a new data source to be rendered is created in response to the received data source construction instruction.

[0014] Optionally, each of the layers to be rendered has a corresponding layer state, and the map view window includes a layer manager, a layer rendering manager, and a layer state manager; the step of loading all the layers to be rendered into the map view window includes:

[0015] Add all the layers to be rendered to the layer manager;

[0016] Receive a user selection instruction, determine the rendering engine corresponding to each of the layers to be rendered, and register the rendering engine with the layer rendering manager;

[0017] The layer state corresponding to each of the layers to be rendered is registered in a layer state manager.

[0018] Optionally, the map rendering instruction includes a global rendering instruction, and when the map rendering instruction is received, the step of rendering the layer to be rendered in the map view window to generate a map view includes:

[0019] When the global rendering instruction is received, traverse the layer state corresponding to each layer to be rendered;

[0020] If the layer state is displayed as being in the map view window and the rendering cache mechanism is not enabled, determining the first to-be-drawn data corresponding to each to-be-rendered layer through spatial query;

[0021] Calling the rendering engine corresponding to the layer to be rendered to render each of the first data to be drawn in parallel, obtaining at least one first rendered image and loading it into the view buffer of the map view window;

[0022] All the first rendered images in the view buffer are acquired and combined through the view listener in the map view window to generate a map view.

[0023] Optionally, the map rendering instruction includes a global rendering instruction, and when the map rendering instruction is received, the step of rendering the layer to be rendered in the map view window to generate a map view includes:

[0024] When the global rendering instruction is received, traverse the layer state corresponding to each layer to be rendered;

[0025] If the layer state is displayed as being in the map view window and the rendering cache mechanism is turned on, then determining the second data to be drawn corresponding to each layer to be rendered through spatial query; wherein the second data to be drawn is within a preset scale range;

[0026] Creating a layer buffer corresponding to the layer to be rendered;

[0027] Calling the rendering engine corresponding to the layer to be rendered to render each of the second data to be drawn in parallel, obtaining at least one second rendered image and saving it to the layer buffer;

[0028] When all the layer states are displayed as rendering completed, all the second rendered images in the layer buffer are loaded into the view buffer of the map view window;

[0029] All the second rendered images in the view buffer are acquired and combined through the view listener in the map view window to generate a map view.

[0030] Optionally, the map rendering instruction further includes a local rendering instruction, and when the map rendering instruction is received, the step of rendering the layer to be rendered in the map view window to generate a map view includes:

[0031] When a local rendering instruction is received, determining a local layer corresponding to the local rendering instruction from all the layers to be rendered;

[0032] If the layer state corresponding to the local layer is displayed as being in the map view window and the rendering cache mechanism is turned on, local data corresponding to the local layer is determined through spatial query, and a local buffer corresponding to the local layer is created;

[0033] Calling a rendering engine corresponding to the local layer to render the local data, obtaining at least one third rendered image and saving it to the local buffer;

[0034] When the layer status corresponding to the local layer is displayed as rendering completed, loading all the third rendered images in the local buffer into the view buffer of the map view window;

[0035] Acquire all the third rendered images and the historical buffer images in the view buffer through the view listener in the map view window;

[0036] The third rendered image and the historical buffer image are combined in layer order to generate a map view.

[0037] A second aspect of the present invention provides a map rendering device, comprising:

[0038] A module for determining a data source to be rendered, used to respond to a received map building request and determine a data source to be rendered;

[0039] A creation module, used to create a layer to be rendered for each data source to be rendered, and to create a map view window;

[0040] A layer loading module, used for loading all the layers to be rendered into the map view window;

[0041] The rendering module is used to render the layer to be rendered in the map view window to generate a map view when a map rendering instruction is received.

[0042] Optionally, the module for determining the data source to be rendered includes:

[0043] A to-be-rendered data source determination submodule is used to determine whether there is a to-be-rendered data source corresponding to the map construction request in a preset database when a map construction request is received;

[0044] A to-be-rendered data source determination submodule, configured to load the to-be-rendered data source from the preset database if the to-be-rendered data source exists;

[0045] The new submodule for creating a data source to be rendered is used to respond to the received data source construction instruction and create the data source to be rendered if it does not exist.

[0046] A third aspect of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the map rendering method as described in any one of the first aspect of the present invention.

[0047] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by the processor, implements the map rendering method as described in any one of the first aspects of the present invention.

[0048] It can be seen from the above technical solutions that the present invention has the following advantages:

[0049] When receiving a map building request, the present invention determines the data source to be rendered according to the map building request, creates a corresponding layer to be rendered for each data source to be rendered, creates a map view window and loads each data source to be rendered into the map view window, and when receiving a map rendering instruction, renders the layer to be rendered in the map view window to generate a map view. This solves the technical problem of the prior art that each layer needs to be re-rendered each time the data is updated, resulting in a large number of rendering resources and low rendering efficiency, and more effectively reduces the used rendering resources and improves the rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0051] Figure 1 A flowchart of a map rendering method provided in Embodiment 1 of the present invention;

[0052] Figure 2 A flowchart of a map rendering method provided in Embodiment 2 of the present invention;

[0053] Figure 3 This is a structural block diagram of a map rendering device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0054] The embodiments of the present invention provide a map rendering method, apparatus, device and storage medium, which are used to solve the technical problem in the prior art that each layer needs to be re-rendered each time the data is updated, resulting in a large number of rendering resources and low rendering efficiency.

[0055] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] See also Figure 1 , Figure 1 A flowchart of the steps of a map rendering method provided in Embodiment 1 of the present invention.

[0057] The present invention provides a map rendering method, comprising:

[0058] Step 101, responding to the received map building request, determining the data source to be rendered;

[0059] The data source to be rendered is a data collection that abstracts data, including various data such as vector data, tile data, and custom data.

[0060] In the embodiment of the present invention, after receiving a map building request input by a user, the data source to be rendered from which the target data is stored can be determined according to the data source type required by the map building request.

[0061] Step 102, creating a layer to be rendered for each data source to be rendered, and creating a map view window;

[0062] The layer to be rendered refers to a layer that provides the function of packaging the data source to be rendered, such as a vector data layer, a tile data layer, and a custom data layer.

[0063] After the data source to be rendered is determined, a layer to be rendered may be created for each data source to be rendered, and a map view window may be created to prepare for rendering the layer to be rendered in the map view window.

[0064] Step 103, loading all layers to be rendered into the map view window;

[0065] After creating a map view window, all layers to be rendered may be loaded into the map view window to register the status of each layer to be rendered and the type of rendering engine.

[0066] Step 104, when a map rendering instruction is received, the layer to be rendered is rendered in the map view window to generate a map view.

[0067] In the specific implementation, after all the layers to be rendered are loaded into the map view window, if a map rendering instruction is received, the layers to be rendered can be rendered through the corresponding type of renderer in the map view window to obtain the images corresponding to each layer to be rendered, and each image is loaded in layer order to generate a map view.

[0068] In an embodiment of the present invention, when a map building request is received, a data source to be rendered is determined according to the map building request, a corresponding layer to be rendered is created for each data source to be rendered, a map view window is created at the same time, and each data source to be rendered is loaded into the map view window. When a map rendering instruction is received, the layer to be rendered is rendered in the map view window to generate a map view. This solves the technical problem of the large number of rendering resources and low rendering efficiency caused by the need to re-render each layer every time the data is updated in the prior art, and more effectively reduces the used rendering resources and improves the rendering efficiency.

[0069] See also Figure 2 , Figure 2 A flowchart of the steps of a map rendering method provided in Embodiment 2 of the present invention.

[0070] The present invention provides a map rendering method, comprising:

[0071] Step 201, responding to the received map building request, determining the data source to be rendered;

[0072] Optionally, step 201 may include the following sub-steps:

[0073] When a map building request is received, it is determined whether there is a data source to be rendered corresponding to the map building request in the preset database;

[0074] If it exists, load the data source to be rendered from the preset database;

[0075] If it does not exist, a new data source to be rendered is created in response to the received data source construction instruction.

[0076] It is worth mentioning that the preset database includes but is not limited to data sources such as vector data, tile data or custom data.

[0077] In an embodiment of the present invention, when a map construction request is received, it can be determined from a preset database whether there is a data source to be rendered corresponding to the map construction request. If so, the data source to be rendered can be obtained from the preset database and loaded; if not, the data source construction instruction input by the user can be responded to and the required data source can be newly created.

[0078] Step 202, creating a layer to be rendered for each data source to be rendered, and creating a map view window;

[0079] In the embodiment of the present invention, after all data sources to be rendered are obtained, a layer to be rendered may be created for each data source to be rendered, a map view window may be created, and a corresponding layer state may be set for each layer to be rendered.

[0080] Among them, the map view window is responsible for displaying the content generated by the rendering engine, including layers and other data, and supports functions such as panning, zooming, full map, displaying multiple online maps, and refreshing displayed content.

[0081] Furthermore, each layer to be rendered has a corresponding layer state, and the map view window includes a layer manager, a layer rendering manager, and a layer state manager. Step 103 in the above embodiment 1 can be replaced by the following steps 203-205:

[0082] Step 203, adding all layers to be rendered to the layer manager;

[0083] Among them, the layer manager is responsible for managing layers and supports functions such as adding, deleting, getting the range of all layers, setting draft layers, and getting draft layers.

[0084] In an example of the present invention, in order to facilitate the management of the layers to be rendered, all the layers to be rendered can be added to the layer manager.

[0085] Step 204, receiving a user selection instruction, determining a rendering engine corresponding to each layer to be rendered, and registering the rendering engine to a layer rendering manager;

[0086] The layer rendering manager is used to manage rendering engines. You can register and uninstall a layer renderer, or customize the rendering order of each layer renderer. The rendering engine can use the layer rendering manager to make each rendering engine perform rendering actions on each layer, which is determined by the layer status, such as visibility, minimum visible scale, maximum visible scale, whether to enable the rendering cache mechanism switch, and whether to use the parallel rendering switch.

[0087] After all layers to be rendered are added to the layer manager, a user's selection instruction may be received to select a corresponding rendering engine for each layer to be rendered, and each rendering engine is registered with the layer rendering manager.

[0088] Step 205: register the layer state corresponding to each layer to be rendered into the layer state manager.

[0089] It is worth mentioning that the layer state includes built-in visibility, minimum visible scale, maximum visible scale, whether to enable the rendering cache mechanism switch, whether to use parallel rendering switch and other custom states; the layer state manager can provide the function of managing the state of each layer and saving and reloading these states locally.

[0090] In the embodiment of the present invention, the layer state corresponding to each layer to be rendered can be uploaded to the layer state manager to display the layer state corresponding to each layer to be rendered.

[0091] Step 206: When a map rendering instruction is received, the layer to be rendered is rendered in the map view window to generate a map view.

[0092] In one example of the present invention, the map rendering instruction includes a global rendering instruction, and step 206 may include the following sub-steps S11-S14:

[0093] S11. When a global rendering instruction is received, traverse the layer state corresponding to each layer to be rendered;

[0094] S12: If the layer status is displayed as being in the map view window and the rendering cache mechanism is not enabled, determining the first to-be-drawn data corresponding to each to-be-rendered layer through spatial query;

[0095] S13, calling the rendering engine corresponding to the layer to be rendered to render each first data to be drawn in parallel, obtaining at least one first rendered image and loading it into the view buffer of the map view window;

[0096] S14. Obtain all first rendered images in the view buffer through the view listener in the map view window and combine them to generate a map view.

[0097] Spatial query is a special query supported by geographic databases and spatial databases. The query statements of spatial query differ from non-spatial SQL query in many important aspects, the two most important of which are: allowing the use of geometric data such as points, lines, polygons, and querying the spatial relationship between geometric types. The query is based on two-dimensional or three-dimensional spatial data, and the query results are represented as graphics.

[0098] In an embodiment of the present invention, after receiving a global rendering instruction, the layer status corresponding to each layer to be rendered can be traversed in turn. If the layer status is displayed as being in the map view window and the rendering cache mechanism is not turned on, the required data to be drawn in each layer to be rendered can be queried spatially. The rendering engine corresponding to the layer to be rendered is called to perform parallel rendering on each data to be drawn to obtain at least one first rendered image, and the first rendered image is loaded into the view buffer of the map view window. Finally, all the first rendered images in the view buffer are obtained through the view listener in the map view window and loaded in layer order to generate a map view.

[0099] Each rendering engine has a rendering context, which includes rendering status: normal, rendering started, rendering in progress, rendering ended, rendering canceled, rendering failed. Each rendering engine will automatically update the status of its context, and these statuses can be used to determine whether the drawing is completed.

[0100] In another example of the present invention, the map rendering instruction includes a global rendering instruction, and step 206 may include the following sub-steps S21-S26:

[0101] S21. When a global rendering instruction is received, traverse the layer state corresponding to each layer to be rendered;

[0102] S22, if the layer state is displayed as being in the map view window and the rendering cache mechanism is turned on, determining the second data to be drawn corresponding to each layer to be rendered through spatial query; wherein the second data to be drawn is within a preset scale range;

[0103] S23, creating a layer buffer corresponding to the layer to be rendered;

[0104] S24, calling the rendering engine corresponding to the layer to be rendered to render each second data to be drawn in parallel, obtaining at least one second rendered image and saving it to the layer buffer;

[0105] S25, when all layer states are displayed as rendering completed, all second rendered images in the layer buffer are loaded into the view buffer of the map view window;

[0106] S26. Obtain all second rendered images in the view buffer through the view listener in the map view window and combine them to generate a map view.

[0107] In an embodiment of the present invention, after receiving a global rendering instruction, the layer status corresponding to each layer to be rendered is traversed. If the layer status is displayed as being in a map view window and the rendering cache mechanism is turned on, the data to be drawn corresponding to each layer to be rendered can be determined through spatial query; wherein the second data to be drawn is within a preset scale range and the layer status is displayed as visible; a layer buffer corresponding to the layer to be rendered is created, the rendering engine corresponding to the layer to be rendered is called, and each second data to be drawn is rendered in parallel to obtain at least one second rendered image and save it to the layer buffer.

[0108] If the status of all layers is displayed as rendering completed, all second rendered images in the layer buffer can be loaded into the view buffer in the map view window; all second rendered images in the view buffer are obtained through the view listener in the map view window and combined in layer order to generate a map view.

[0109] In an optional embodiment of the present invention, the map rendering instruction also includes a local rendering instruction, and step 206 may include the following sub-steps S31-S36:

[0110] S31, when a local rendering instruction is received, determining a local layer corresponding to the local rendering instruction from all layers to be rendered;

[0111] S32, if the layer status corresponding to the local layer is displayed as being in the map view window and the rendering cache mechanism is turned on, local data corresponding to the local layer is determined through spatial query, and a local buffer corresponding to the local layer is created;

[0112] S33, calling the rendering engine corresponding to the local layer to render the local data, obtaining at least one third rendered image and saving it to the local buffer;

[0113] S34, when the layer status corresponding to the local layer is displayed as rendering completed, all third rendered images in the local buffer are loaded into the view buffer of the map view window;

[0114] S35, obtaining all third rendered images and historical buffer images in the view buffer through the view listener in the map view window;

[0115] S36: Combine the third rendered image and the historical buffer image according to the layer order to generate a map view.

[0116] In an embodiment of the present invention, if a local rendering instruction is received, the local layer specified by the local rendering instruction can be determined from all the layers to be rendered, and at this time, the layer status of the local layer is displayed as in the map view window and the rendering cache mechanism is turned on. At this time, the local data corresponding to the local layer can be determined through spatial query, and the rendering engine is called to render the local data, and at least one third rendered image has been obtained and saved in the local buffer; when the layer status corresponding to the local layer is displayed as rendering completed, all the third rendered images are loaded into the view buffer of the map view window, and all the third rendered images and historical buffer images in the view buffer are obtained through the view listener in the map view window, and the third rendered images and historical buffer images are combined in layer order to generate a map view.

[0117] The historical buffer image refers to the first rendered image or the second rendered image stored in the view buffer.

[0118] In an embodiment of the present invention, when a map building request is received, a data source to be rendered is determined according to the map building request, a corresponding layer to be rendered is created for each data source to be rendered, a map view window is created at the same time, and each data source to be rendered is loaded into the map view window. When a map rendering instruction is received, the layer to be rendered is rendered in the map view window to generate a map view. This solves the technical problem of the large number of rendering resources and low rendering efficiency caused by the need to re-render each layer every time the data is updated in the prior art, and more effectively reduces the used rendering resources and improves the rendering efficiency.

[0119] See also Figure 3 , Figure 3 This is a structural block diagram of a map rendering device provided in Embodiment 3 of the present invention.

[0120] The present invention provides a map rendering device, comprising:

[0121] The module 301 for determining the data source to be rendered is used to respond to the received map building request and determine the data source to be rendered;

[0122] A creation module 302 is used to create a layer to be rendered for each data source to be rendered, and to create a map view window;

[0123] The layer loading module 303 is used to load all layers to be rendered into the map view window;

[0124] The rendering module 304 is used to render the layer to be rendered in the map view window to generate a map view when a map rendering instruction is received.

[0125] Optionally, the module 301 for determining the data source to be rendered includes:

[0126] A submodule for determining a data source to be rendered, used to determine whether there is a data source to be rendered corresponding to the map building request in a preset database when a map building request is received;

[0127] A submodule for determining a data source to be rendered, used to load the data source to be rendered from a preset database if it exists;

[0128] The new submodule of the data source to be rendered is used to respond to the received data source construction instruction and create a new data source to be rendered if it does not exist.

[0129] Optionally, each layer to be rendered has a corresponding layer state, and the map view window includes a layer manager, a layer rendering manager, and a layer state manager; the layer loading module 303 includes:

[0130] The layer loading submodule is used to add all layers to be rendered to the layer manager;

[0131] The rendering engine selection submodule is used to receive the user selection instruction, determine the rendering engine corresponding to each layer to be rendered, and register the rendering engine with the layer rendering manager;

[0132] The layer state registration submodule is used to register the layer state corresponding to each layer to be rendered into the layer state manager.

[0133] Optionally, the map rendering instruction includes a global rendering instruction, and the rendering module 304 includes:

[0134] A first layer state traversal submodule is used to traverse the layer state corresponding to each layer to be rendered when receiving a global rendering instruction;

[0135] A first to-be-rendered data determination submodule is used to determine the first to-be-rendered data corresponding to each to-be-rendered layer through spatial query if the layer state is displayed as being in the map view window and the rendering cache mechanism is not enabled;

[0136] A first rendering submodule is used to call a rendering engine corresponding to a layer to be rendered to perform parallel rendering on each first data to be drawn, obtain at least one first rendered image and load it into a view buffer of a map view window;

[0137] The first combining submodule is used to obtain all first rendered images in the view buffer through the view listener in the map view window and combine them to generate a map view.

[0138] Optionally, the map rendering instruction includes a global rendering instruction, and the rendering module 304 includes:

[0139] A first layer state traversal submodule is used to traverse the layer state corresponding to each layer to be rendered when receiving a global rendering instruction;

[0140] The first data to be drawn determination submodule is used to determine the second data to be drawn corresponding to each layer to be rendered through spatial query if the layer state is displayed as being in the map view window and the rendering cache mechanism is turned on; wherein the second data to be drawn is within a preset scale range;

[0141] The layer buffer creation submodule is used to create a layer buffer corresponding to the layer to be rendered;

[0142] A second rendering submodule is used to call the rendering engine corresponding to the layer to be rendered to perform parallel rendering on each second data to be drawn, obtain at least one second rendered image and save it to the layer buffer;

[0143] A second loading submodule is used for loading all second rendered images in the layer buffer into the view buffer of the map view window when all layer states are displayed as rendering completed;

[0144] The second combining submodule is used to obtain all the second rendered images in the view buffer through the view listener in the map view window and combine them to generate a map view.

[0145] Optionally, the map rendering instruction also includes a local rendering instruction, and the rendering module 304 includes:

[0146] A local layer determination submodule is used to determine the local layer corresponding to the local rendering instruction from all layers to be rendered when a local rendering instruction is received;

[0147] The local data determination submodule is used to determine the local data corresponding to the local layer through spatial query and create a local buffer corresponding to the local layer if the layer status corresponding to the local layer is displayed as being in the map view window and the rendering cache mechanism is turned on;

[0148] A third rendering submodule is used to call a rendering engine corresponding to the local layer to render the local data, obtain at least one third rendered image and save it to the local buffer;

[0149] A third loading submodule is used to load all third rendered images in the local buffer into the view buffer of the map view window when the layer status corresponding to the local layer is displayed as rendering completed;

[0150] The image acquisition submodule is used to acquire all third rendered images and historical buffer images in the view buffer through the view listener in the map view window;

[0151] The view combination submodule is used to combine the third rendered image and the historical buffer image in layer order to generate a map view.

[0152] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the map rendering method of any embodiment of the present invention.

[0153] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, a map rendering method as described in any embodiment of the present invention is implemented.

[0154] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0155] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0157] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0158] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0159] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A map rendering method, characterized in that: include: In response to the received map building request, determine the data source to be rendered; The data source to be rendered is a data set for abstracting data; Creating a layer to be rendered for each data source to be rendered, and creating a map view window; Loading all the layers to be rendered into the map view window; When a map rendering instruction is received, the layer to be rendered is rendered in the map view window to generate a map view; Each of the layers to be rendered has a corresponding layer state, and the map view window includes a layer manager, a layer rendering manager and a layer state manager; The step of loading all the layers to be rendered into the map view window comprises: Add all the layers to be rendered to the layer manager; Receive a user selection instruction, determine the rendering engine corresponding to each of the layers to be rendered, and register the rendering engine with the layer rendering manager; Registering the layer state corresponding to each of the layers to be rendered into a layer state manager; The map rendering instruction also includes a local rendering instruction. When the map rendering instruction is received, the step of rendering the layer to be rendered in the map view window to generate a map view includes: When a local rendering instruction is received, determining a local layer corresponding to the local rendering instruction from all the layers to be rendered; If the layer state corresponding to the local layer is displayed as being in the map view window and the rendering cache mechanism is turned on, local data corresponding to the local layer is determined through spatial query, and a local buffer corresponding to the local layer is created; Calling a rendering engine corresponding to the local layer to render the local data, obtaining at least one third rendered image and saving it to the local buffer; When the layer status corresponding to the local layer is displayed as rendering completed, loading all the third rendered images in the local buffer into the view buffer of the map view window; Acquire all the third rendered images and the historical buffer images in the view buffer through the view listener in the map view window; The third rendered image and the historical buffer image are combined in layer order to generate a map view.

2. The map rendering method according to claim 1, characterized in that: The step of determining the data source to be rendered in response to the received map building request includes: When a map building request is received, determining whether there is a data source to be rendered corresponding to the map building request in a preset database; If it exists, then loading the data source to be rendered from the preset database; If it does not exist, a new data source to be rendered is created in response to the received data source construction instruction.

3. The map rendering method according to claim 1, characterized in that: The map rendering instruction includes a global rendering instruction. When the map rendering instruction is received, the step of rendering the layer to be rendered in the map view window to generate a map view includes: When the global rendering instruction is received, traverse the layer state corresponding to each layer to be rendered; If the layer state is displayed as being in the map view window and the rendering cache mechanism is not enabled, determining the first to-be-drawn data corresponding to each to-be-rendered layer through spatial query; Calling the rendering engine corresponding to the layer to be rendered to render each of the first data to be drawn in parallel, obtaining at least one first rendered image and loading it into the view buffer of the map view window; All the first rendered images in the view buffer are acquired and combined through the view listener in the map view window to generate a map view.

4. The map rendering method according to claim 1, characterized in that: The map rendering instruction includes a global rendering instruction. When the map rendering instruction is received, the step of rendering the layer to be rendered in the map view window to generate a map view includes: When the global rendering instruction is received, traverse the layer state corresponding to each layer to be rendered; If the layer state is displayed as being in the map view window and the rendering cache mechanism is turned on, then determining the second data to be drawn corresponding to each layer to be rendered through spatial query; wherein the second data to be drawn is within a preset scale range; Creating a layer buffer corresponding to the layer to be rendered; Calling the rendering engine corresponding to the layer to be rendered to render each of the second data to be drawn in parallel, obtaining at least one second rendered image and saving it to the layer buffer; When all the layer states are displayed as rendering completed, all the second rendered images in the layer buffer are loaded into the view buffer of the map view window; All the second rendered images in the view buffer are acquired and combined through the view listener in the map view window to generate a map view.

5. A map rendering device, characterized in that: include: A module for determining a data source to be rendered, used to respond to a received map building request and determine a data source to be rendered; A creation module, used to create a layer to be rendered for each data source to be rendered, and to create a map view window; A layer loading module, used for loading all the layers to be rendered into the map view window; A rendering module, for rendering the layer to be rendered in the map view window to generate a map view when a map rendering instruction is received; Each of the layers to be rendered has a corresponding layer state, and the map view window includes a layer manager, a layer rendering manager and a layer state manager; The layer loading module includes: A layer loading submodule is used to add all the layers to be rendered to the layer manager; A rendering engine selection submodule, for receiving a user selection instruction, determining a rendering engine corresponding to each of the layers to be rendered, and registering the rendering engine with a layer rendering manager; A layer state registration submodule, used for registering the layer state corresponding to each of the layers to be rendered into a layer state manager; The map rendering instruction also includes a local rendering instruction, and the rendering module includes: A local layer determination submodule, for determining, when receiving a local rendering instruction, a local layer corresponding to the local rendering instruction from all the layers to be rendered; A local data determination submodule, for determining the local data corresponding to the local layer through spatial query and creating a local buffer corresponding to the local layer if the layer state corresponding to the local layer is displayed as being in the map view window and the rendering cache mechanism is turned on; A third rendering submodule, used for calling the rendering engine corresponding to the local layer to render the local data, to obtain at least one third rendered image and save it to the local buffer; A third loading submodule, configured to load all of the third rendered images in the local buffer into a view buffer of the map view window when the layer status corresponding to the local layer is displayed as rendering completed; A picture acquisition submodule, configured to acquire all of the third rendered pictures and historical buffer pictures in the view buffer through a view listener in the map view window; The view combination submodule is used to combine the third rendered image and the historical buffer image in layer order to generate a map view.

6. The map rendering device according to claim 5, characterized in that: The module for determining the data source to be rendered includes: A to-be-rendered data source determination submodule is used to determine whether there is a to-be-rendered data source corresponding to the map construction request in a preset database when a map construction request is received; A to-be-rendered data source determination submodule, configured to load the to-be-rendered data source from the preset database if the to-be-rendered data source exists; The new submodule for creating a data source to be rendered is used to respond to the received data source construction instruction and create the data source to be rendered if it does not exist.

7. An electronic device, characterized in that: It comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the map rendering method as described in any one of claims 1 to 4.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the map rendering method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Rendering method and system of geographic information system

    CN103035164A

  • Method and device for partial rendering on map

    CN103295466A

  • Contextual ink annotation in a mapping interface

    CN109074376A

  • Wasm-based map vector rendering method and device

    CN110032614A

  • User interface rendering method and device of application program, medium and electronic equipment

    CN110347464A