Map generation method, device, storage medium and computer equipment

By separating the map function logic code and business code in the project, loading the layer with preset map function components and generating project maps, the problem of coupling map functions and business logic is solved, and the development efficiency and reusability of the project are improved.

CN112486476BActive Publication Date: 2024-12-13PINGAN INT SMART CITY TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202011469135.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-15
Publication Date
2024-12-13
Estimated Expiration
2040-12-15

AI Technical Summary

Technical Problem

In the prior art, map functions and business logic are severely coupled, resulting in lengthy code, increased development difficulty, difficult maintenance, poor reusability, affecting project development efficiency.

Method used

By obtaining operation instructions in the running state of the target project, calling the preset map function component to load the layer, reading business data, and generating project maps, thus realizing the separation of map function logic code and business code and improving reusability.

Benefits of technology

It realizes independent maintenance and reusability of map functions, shortens the project development cycle and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112486476B_ABST
    Figure CN112486476B_ABST
Patent Text Reader

Abstract

The present invention discloses a map generation method, device, storage medium and computer equipment, which relate to the field of information technology, and mainly enable the logic code of the map function in the project to be separated from the business code, so as to facilitate the maintenance of the logic code or business code of the map function in the later stage, improve the reusability of the map function component, and shorten the project development cycle. The method comprises: obtaining the operation instructions to be executed in the running state of the target project; calling the preset map function component to load each layer of the project map to be generated according to the operation instruction, wherein the project map is a component of the target project; reading the business data required for the operation of the target project; generating and outputting the project map based on the each layer and the business data. The present invention also relates to the field of blockchain technology, and each layer in the present invention can be stored in the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The map function undoubtedly provides a lot of convenience for human life, facilitates people's transportation, positioning function, query function, etc., especially for environmental protection projects, maps have become an indispensable functional module, widely used in multiple projects of PC and APP. A reasonable and standardized map creation process can reduce the project development cost and subsequent maintenance cost.

[0003] The inventor of this application found in the research that the map functions are mostly intertwined with the business logic in the project. However, this approach will lead to serious coupling between the logic code of the map function and the business code, resulting in the development code being too lengthy and the logic being unclear, increasing the difficulty of development and inconvenient for the maintenance of the logic code or business code in the later stage. At the same time, the developed map function has poor reusability, which is not conducive to transplantation to other projects, affecting the efficiency of project development. Summary of the invention

[0004] The present invention provides a map generation method, device, storage medium and computer equipment, which can separate the logic code of the map function in the project from the business code, facilitate the maintenance of the logic code or business code of the map function in the later stage, improve the reusability of the map function components, and shorten the project development cycle.

[0005] According to a first aspect of the present invention, there is provided a map generation method, comprising:

[0006] Get the operation instructions to be executed when the target project is running;

[0007] Calling a preset map function component according to the operation instruction to load various layers of a project map to be generated, wherein the project map is a component of the target project;

[0008] Read the business data required for the operation of the target project;

[0009] Based on the various layers and the business data, the project map is generated and output.

[0010] According to a second aspect of the present invention, there is provided a map generating device, comprising:

[0011] An acquisition unit, used for acquiring operation instructions to be executed when the target project is in operation;

[0012] A loading unit, configured to call a preset map function component according to the operation instruction to load various layers of a project map to be generated, wherein the project map is a component of the target project;

[0013] A reading unit, used to read the business data required for the operation of the target project;

[0014] A generating unit is used to generate and output the project map based on the various layers and the business data.

[0015] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0016] Get the operation instructions to be executed when the target project is running;

[0017] Calling a preset map function component according to the operation instruction to load various layers of a project map to be generated, wherein the project map is a component of the target project;

[0018] Read the business data required for the operation of the target project;

[0019] Based on the various layers and the business data, the project map is generated and output.

[0020] According to a fourth aspect of the present invention, there is provided a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following steps are implemented:

[0021] Get the operation instructions to be executed when the target project is running;

[0022] Calling a preset map function component according to the operation instruction to load various layers of a project map to be generated, wherein the project map is a component of the target project;

[0023] Read the business data required for the operation of the target project;

[0024] Based on the various layers and the business data, the project map is generated and output.

[0025] The present invention provides a map generation method, device, storage medium and computer equipment. Compared with the current method of interweaving map functions with business logic in projects, the present invention can obtain operation instructions to be executed when the target project is running; and call a preset map function component according to the operation instruction to load various layers of the project map to be generated, wherein the project map is a component of the target project; at the same time, read the business data required for the operation of the target project; finally, based on the various layers and the business data, generate and output the project map, thereby completely realizing the separation of map function logic code and business code by creating a preset map function component, facilitating the maintenance of the map function logic code or business code in the later stage, and at the same time improving the reusability of the preset map function component, facilitating its transplantation into other projects, thereby shortening the project development cycle and improving the project development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0027] Figure 1 A flow chart of a map generation method provided by an embodiment of the present invention is shown;

[0028] Figure 2 Another flow chart of a map generation method provided by an embodiment of the present invention is shown;

[0029] Figure 3 A schematic diagram of the structure of a map generating device provided by an embodiment of the present invention is shown;

[0030] Figure 4 A schematic diagram showing the structure of another map generating device provided by an embodiment of the present invention is shown;

[0031] Figure 5 A schematic diagram of the physical structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0032] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0033] At present, in most projects, map functions are intertwined with business logic. However, this approach will lead to serious coupling between the logic code of the map function and the business code, resulting in the development code being too lengthy and the logic being unclear, increasing the difficulty of development and making it inconvenient to maintain the logic code or business code later. At the same time, the developed map function has poor reusability, which is not conducive to transplantation to other projects, affecting the efficiency of project development.

[0034] In order to solve the above problems, an embodiment of the present invention provides a map generation method, such as Figure 1 As shown, the method includes:

[0035] 101. Obtain the operation instructions to be executed when the target project is in operation state.

[0036] Among them, the target project is a project that needs to be displayed on a map, such as an environmental protection project, and the operation instruction to be executed is an operation instruction for calling a preset map function component, for example, the preset map function component is introduced by calling the import function. For the embodiment of the present invention, in order to overcome the defect that the logic code of the map function and the business code are coupled in the prior art, the embodiment of the present invention independently encapsulates the function functions in the map creation process and creates a preset map function component, thereby realizing the separation of the logic code of the map function and the business code, facilitating the later maintenance of the logic code and business code of the map function, and facilitating the transplantation of the preset map function component to various projects, thereby improving the reusability of the preset map function component and shortening the project development cycle. The embodiment of the present invention is mainly applicable to the generation of project maps, and the execution subject of this embodiment is a device or equipment that can generate project maps. Specifically, in the process of executing the target project business code hotMap.jsx, the preset map function component map.support.js is called, and the preset map function component map.support.js is introduced by calling the import function.

[0037] 102. Call a preset map function component according to the operation instruction to load various layers of the project map to be generated.

[0038] Among them, the project map is a component of the target project, the preset map function component is a component independent of the project method, which can be transplanted to other projects for use, and the project map to be generated is the map that needs to be displayed in the project. For example, the map in the environmental protection project can show the river colors in different areas.

[0039] For the embodiment of the present invention, before using the preset map function component to create a project map, it is necessary to build a preset map function component. Specifically, a MapUtil folder is pre-defined. The ArcGIS API methods are written in the MapUtil folder. According to different functions such as moving layer operations, drawing patterns, and creating layers, the ArcGIS API methods are organized into different js files. Some integrated applications of the API in MapUtil are defined in map.support.js. For example, the methods encapsulated in map.support.js specifically define init initialization, renderDrop point rendering, renderLine line rendering, exit and other functions. The above functions need to pass specific parameters during the calling process.

[0040] Furthermore, before using the preset map function component to draw a map, it is necessary to pre-specify the various layers involved in the map drawing process, including: base layers and auxiliary layers. The auxiliary layers specifically include the functional layers that have been drawn, and other layers that can be operated by the user. The URL addresses corresponding to the various layers involved in the map drawing process are written in the const.js configuration file, that is, the various layers involved can be specified in the const.js file, for example, {URL:GIS_LAYER_URL.DEPT_COLOR_MAP, title:“v_dept_baseLayer”};

[0041] {URL:GIS_LAYER_URL.FLOW_COLOR_MAP,title:“v_flow_baseLayer”}.

[0042] In addition, in order to obtain the basic layer and the auxiliary layer, the method further includes: drawing the basic layer and the functional layer, storing them in a server, and configuring the resource locator corresponding to the basic layer and the resource locator corresponding to the functional layer in a preset configuration file, that is, the basic layer and the functional layer can be generated in advance by the GIS team according to business needs and placed in the remote server.

[0043] Based on this, step 102 specifically includes: according to the resource locator corresponding to the base layer and the resource locator corresponding to the function layer, using the map function component to load the base layer and the function layer. It should be noted that the embodiment of the present invention also relates to the field of blockchain technology, and the base layer and the auxiliary layer in the embodiment of the present invention can be stored in the blockchain.

[0044] Furthermore, in order to set the relevant information of each layer involved in the configuration file, the method further includes: respectively configuring the basic information, drawing information and longitude and latitude information of different areas in each layer, wherein the relevant information is the information of different areas in the layer, specifically including the basic information, drawing information and longitude and latitude information of different areas, the basic information includes the name, area and other information of different areas, the drawing information includes the color to be filled in the area of ​​the area, the stroke line and other contents, and the longitude and latitude information includes the longitude information and dimension information corresponding to different areas, that is, the specific location of different areas can be determined by the longitude information and dimension information. On this basis, step 102 specifically includes: the map function component loads each layer according to the basic information, drawing information and longitude and latitude information of different areas in each layer.

[0045] Furthermore, after configuring the relevant information corresponding to the basic layer and the auxiliary layer, in the process of executing the business code hotMap.jsx, the preset map function component map.support.js is called, and the preset map function component map.support.js is introduced by calling the import function. First, the initialization function init is called to load each layer. The initialization function init includes three parameters. The first is the layer identifier. According to the layer identifier, the map space can be created, that is, according to the layer identifier, the specific location in the page to load each layer is determined to create the map; the second parameter is a callback function related to the business, which is specifically written in the business code. According to the callback function, the business data can be obtained so that the corresponding drawing can be performed in the layer according to the business data; the third parameter is the method that the custom business logic needs to use, which can be deleted according to the corresponding business. Therefore, the initialization function init in the preset map function component can load each pre-specified layer and obtain the corresponding business data.

[0046] 103. Read the business data required for the operation of the target project.

[0047] Among them, the business data is the business data related to map creation in the project, for example, the river names and water quality categories in different areas of the environmental protection project. For the embodiment of the present invention, in order to draw in the corresponding layer according to the business data, it is necessary to obtain the business data in advance. Specifically, the callback function related to the business can be determined according to the second parameter in the initialization function of the preset map function component. The callback function is written in the business code. The business data can be obtained according to the callback function so that corresponding drawing can be performed in the layer according to the business data.

[0048] 104. Generate and output the project map based on the various layers and the business data.

[0049] Among them, the project map is a map to be displayed in the project, for example, a map showing the colors of rivers in different regions in an environmental protection project. For an embodiment of the present invention, after each layer is loaded and the business data is obtained, it can be drawn on the auxiliary layer according to business needs. When drawing, the point rendering function, line rendering function and surface rendering function in the preset map function component are called, but the specific area of ​​the auxiliary layer to be drawn, the style of drawing and the color of display can be matched in the business code according to business needs, wherein the point rendering function, line rendering function and surface rendering function each include two functions, namely, layer parameters and business data parameters, according to which layer parameters can determine the layer to be drawn, and according to the business data parameters can determine the business data used in the drawing process. At the same time, the size and format of the drawing graphics can be specified in the business code, and if not specified, it can also be generated according to the default value. In this way, according to the loaded layers and business data, the point, line and surface rendering functions can be called to draw in the corresponding auxiliary layer, and the drawn layer and the undrawn layer are superimposed to generate and output the project map.

[0050] A map generation method provided by an embodiment of the present invention, compared with the current method of interweaving map functions with business logic in projects, can obtain operation instructions to be executed when a target project is running; and call a preset map function component according to the operation instruction to load various layers of the project map to be generated, wherein the project map is a component of the target project; at the same time, read the business data required for the operation of the target project; finally, based on the various layers and the business data, generate and output the project map, thereby completely realizing the separation of map function logic code and business code by creating a preset map function component, facilitating the later maintenance of the map function logic code or business code, and at the same time improving the reusability of the preset map function component, facilitating its transplantation into other projects, thereby shortening the project development cycle and improving the project development efficiency.

[0051] Furthermore, in order to better illustrate the process of generating the above-mentioned project map, as a refinement and extension of the above-mentioned embodiment, the embodiment of the present invention provides another map generating method, such as Figure 2 As shown, the method includes:

[0052] 201. Obtain operation instructions to be executed when the target project is in operation state.

[0053] Among them, the target project is a project that needs to be displayed on a map, for example, an environmental protection project, and the operation instruction to be executed is an operation instruction for calling the preset map function component. Specifically, in the process of executing the target project business code hotMap.jsx, the preset map function component map.support.js is called, and the preset map function component map.support.js is introduced by calling the import function.

[0054] 202. According to the operation instruction, call the initialization function in the map function component to load the various layers in the page.

[0055] For the embodiment of the present invention, before using the initialization function of the preset map function component to load each layer, it is necessary to specify in advance in the const.js configuration file each layer involved in creating the project map, and specifically specify the URL address corresponding to the layer involved in the configuration file, so that each layer can be loaded from the remote server according to the URL address corresponding to each layer. After specifying each layer involved in creating the map, it is also necessary to configure the relevant information of each layer. The relevant information specifically includes the basic information, drawing information and longitude and latitude information of different areas in the layer. The basic information includes the name, area and other information of different areas. The drawing information includes the color to be filled in the area of ​​the area, the stroke line and other content. The longitude and latitude information includes the longitude information and dimension information corresponding to different areas, that is, the specific location of different areas can be determined by the longitude information and dimension information.

[0056] Further, after the configuration of the image-related information is completed, the identification information of each layer is obtained, and the initialization function in the preset map function component is called to load each layer in the page, wherein the identification information of the layer can be a layer ID. In order to load each specified layer, step 202 specifically includes: obtaining the identification information corresponding to each layer, and determining the position information of each layer in the page according to the identification information; based on the position information, calling the initialization function in the map function component to load each layer in the page. The initialization function init includes three parameters, the first of which is the identification information of the layer, and the map space can be created according to the identification information of the layer, that is, the specific position in the page to load each layer is determined according to the identification information to create a map; the second parameter is a callback function related to the business, which is specifically written in the business code, and the business data can be obtained according to the callback function, so that the corresponding drawing can be performed in the layer according to the business data; the third parameter is the method required to be used by the custom business logic, which can be deleted according to the corresponding business.

[0057] In the process of loading each layer, the business code defines the mapping relationship between the identification information of different layers and different areas of the page. According to the obtained identification information of the layer, the display area of ​​the layer in the page, that is, the position information, can be determined. For example, layer 11 and layer 32 both correspond to display area 1 in the page. Furthermore, based on the determined position information of the layer in the page, the layer is loaded, so that each layer can be loaded into the corresponding area in the page to create a map space.

[0058] 203. Determine a preset business data callback function corresponding to the target project, and use the preset business data callback function to obtain business data required for the operation of the target project.

[0059] Among them, the preset business data callback function is the second parameter of the initialization function. The preset business data callback function is defined in the project method and is written by the business writer. The business data of the project can be obtained through the preset business data callback function. For the embodiment of the present invention, when the basic layer and the auxiliary layer are loaded by the initialization function, the preset business data callback function defined in the business code will also be determined. The corresponding business data can be obtained through the preset business data callback function, so that the layer can be drawn in the auxiliary layer according to the business data to meet the business needs. For example, MapSupport.init("pattrolMap", async()=>{getCurrentRequest());},{pointClick,mapClickother,isFitExtent:true}), wherein pattrolMap is the identification information of the layer, async()=>{getCurrentRequest() is the preset business data callback function, and {pointClick,mapClickother,isFitExtent:true} is the custom business logic, which can be deleted in the business code according to the business. In this way, the business data of the project can be obtained through the preset business data callback function, so that corresponding drawing can be performed in each loaded layer according to the business data to generate a project map.

[0060] 204. Obtain layer parameters and business data parameters.

[0061] Among them, the layer parameters are used to specify the target layer to be drawn in each layer, and the business data parameters are the business data source, which are used to specify the target business data in the acquired business data, so that after obtaining the layer parameters and business data parameters, the target layer to be drawn and the target business data to be used are determined, and the preset drawing function is called to draw on the target layer.

[0062] 205. Based on the layer parameters, the business data parameters, the various layers and the business data, call a preset drawing function to draw the project map and output it.

[0063] For the embodiment of the present invention, in order to draw a project map, step 205 specifically includes: determining the target layer to be drawn in each layer according to the layer parameters; determining the target business data to be used in the business data according to the business data parameters; calling a preset drawing function to draw on the target layer according to the target business data to obtain the drawn target layer; superimposing the drawn target layer and other layers that have not been drawn to generate the project map and output it.

[0064] Among them, the preset drawing function specifically includes a preset point rendering function, a preset line rendering function and a preset surface rendering function. The preset point rendering function, the preset line rendering function and the preset surface rendering function all include two parameters, namely a layer parameter and a business data parameter. The layer parameter is used to specify the target layer to be drawn in each layer, and the business data parameter is a business data source, which is used to specify the target business data in the acquired business data. After determining the target layer to be drawn and the target business data to be used, the preset drawing function is called to draw on the target layer. For example, the preset point rendering function MapSupport.renderDrop(getList, "pattrol_pointLayer"), wherein getList is the business data parameter, i.e., the data source, and pattrol_pointLayer is the layer parameter, which is used to specify the target layer to be drawn.

[0065] At the same time, in the process of drawing using the preset point rendering function, preset line rendering function and preset surface rendering function respectively, if the size and format of the picture are specified, the specified size shall prevail. If not specified, the graphics can be generated according to the default values. For example, the length and width of the graphics are set to 50 respectively. The size and format of the graphics can be set in the configuration file, const imageOptions={width:dataList[i].iconWidth / 50,height:dataList[i].iconHeight / 50}. The generated graphics will be added to the corresponding layer according to the second parameter (layer parameter) in the preset point rendering function, preset line rendering function and preset surface rendering function.

[0066] The drawing process of the graphics in the embodiment of the present invention is illustrated by taking a specific application scenario as an example, but it is not limited to this. For example, in the display map of the environmental protection project, the river color is drawn according to the actual water quality category, and the actual water quality category changes over time. The basic river layer on the server cannot change color according to the business, otherwise the layer cannot be promoted and applied, and the background data cannot return all the flow directions of each river for the business party to draw by themselves. Therefore, a combination of the two is adopted to obtain the basic layer of the river from the server. The basic layer has only one color, and the business data including the river name and water quality category is obtained from the background business database. Furthermore, according to different river names and water quality categories, the business party will match the rendering, that is, how to draw in different river areas, what style to draw or what color to display, these contents can be set by the business party itself in the business code.

[0067] Furthermore, after the auxiliary layer is drawn, different layers are superimposed to generate a display map and output it, so that the display map can be seen on the page. It can be seen that in the embodiment of the present invention, all business-related content is integrated into the business code, including the customized layer name in the business code. The preset map function component only selects which layer to operate based on the passed parameters, such as the layer identification information, business data parameters, layer parameters, etc. The preset map function component does not specifically define the business-related code. If the layer name needs to be modified, it only needs to be modified in the business code without considering whether it will affect the drawing of the map. For example, the layer name is defined as ALayer at the beginning, and MapSupport.renderRiver(data, "ALayer") is used when calling the method. Later, it is found that this name cannot be seen literally, and it is prepared to be changed to riverLayer. Then it is only necessary to modify the second parameter in the method call MapSupport.renderRiver(data, "riverLayer"). At the same time, if the information on the server layer is modified, you only need to focus on mapSupport.js, because all the methods used in the business code are called in mapSupport.js, and the map functions are not touched. This completely realizes the separation of map function components and business codes, which is convenient for the later maintenance of map function components or business codes and improves the reusability of map function components.

[0068] Another map generation method provided by an embodiment of the present invention, compared with the current way of interweaving map functions with business logic in projects, the present invention can obtain operation instructions to be executed when the target project is running; and call the preset map function component according to the operation instruction to load each layer of the project map to be generated, wherein the project map is a component of the target project; at the same time, read the business data required for the operation of the target project; finally, based on the various layers and the business data, generate and output the project map, thereby completely realizing the separation of map function logic code and business code by creating a preset map function component, facilitating the later maintenance of the map function logic code or business code, and at the same time improving the reusability of the preset map function component, facilitating its transplantation to other projects, thereby shortening the project development cycle and improving the project development efficiency.

[0069] Further, as Figure 1 The specific implementation of the present invention provides a map generation device, such as Figure 3 As shown, the device includes: an acquisition unit 31, a loading unit 32, a reading unit 33 and a generating unit 34.

[0070] The acquisition unit 31 can be used to acquire the operation instruction to be executed when the target project is in operation. The acquisition unit 31 is the main functional module of the device for acquiring the operation instruction to be executed when the target project is in operation.

[0071] The loading unit 32 can be used to call the preset map function component according to the operation instruction to load each layer of the project map to be generated, wherein the project map is a component of the target project. The loading unit 32 is the main functional module of the device that calls the preset map function component according to the operation instruction to load each layer of the project map to be generated, and is also the core module.

[0072] The reading unit 33 can be used to read the business data required for the operation of the target project. The reading unit 33 is a main functional module in the device for reading the business data required for the operation of the target project.

[0073] The generating unit 34 may be used to generate and output the project map based on the various layers and the business data. The generating unit 34 is a main functional module in the device that generates and outputs the project map based on the various layers and the business data, and is also a core module.

[0074] For the embodiments of the present invention, Figure 4 As shown, in order to configure the basic information, drawing information and dimension information of different areas in each layer, the device also includes: a configuration unit 35.

[0075] The configuration unit 35 may be used to respectively configure the basic information, drawing information and longitude and latitude information of different areas in each layer.

[0076] The loading unit 32 may be specifically used by the map function component to load each layer according to basic information, drawing information and longitude and latitude information of different areas in each layer.

[0077] Furthermore, in order to load each layer of the project map to be generated, the loading unit 32 can be specifically used to call the initialization function in the map function component to load the each layer in the page according to the operation instruction.

[0078] The reading unit 33 may be specifically configured to determine a preset business data callback function corresponding to the target project, and use the preset business data callback function to obtain business data required for the operation of the target project.

[0079] Furthermore, in order to load each layer in the page, the loading unit 32 includes: a determination module 321 and a loading module 322 .

[0080] The determination module 321 may be used to obtain identification information corresponding to each layer, and determine position information of each layer in the page according to the identification information.

[0081] The loading module 322 may be used to call the initialization function in the map function component to load the various layers in the page based on the location information.

[0082] Furthermore, in order to generate the project map, the generating unit 34 includes: an acquiring module 341 and a drawing module 342 .

[0083] The acquisition module 341 can be used to acquire layer parameters and business data parameters.

[0084] The drawing module 342 can be used to call a preset drawing function to draw and output the project map based on the layer parameters, the business data parameters, the various layers and the business data.

[0085] Furthermore, in order to draw the project map, the drawing module 342 includes: a determination submodule, a drawing submodule and a generation submodule.

[0086] The determination submodule may be used to determine a target layer to be drawn among the various layers according to the layer parameters.

[0087] The determination submodule may also be used to determine target business data to be utilized in the business data according to the business data parameters.

[0088] The drawing submodule can be used to call a preset drawing function to draw on the target layer according to the target business data to obtain the drawn target layer.

[0089] The generation submodule can be used to superimpose the drawn target layer and other layers that have not been drawn, generate the project map and output it.

[0090] Furthermore, in order to draw the basic layer and the functional layer, the device also includes: a drawing unit 36, which can be used to draw the basic layer and the functional layer, store them to a server, and configure the resource locator corresponding to the basic layer and the resource locator corresponding to the functional layer in a preset configuration file.

[0091] The loading unit 32 may be specifically configured to load the base layer and the functional layer using the map functional component according to the resource locator corresponding to the base layer and the resource locator corresponding to the functional layer.

[0092] It should be noted that for other corresponding descriptions of the functional modules involved in the map generation device provided in the embodiment of the present invention, reference can be made to Figure 1 The corresponding description of the method shown will not be repeated here.

[0093] Based on the above Figure 1 The method shown, accordingly, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented: obtaining an operation instruction to be executed when the target project is running; calling a preset map function component according to the operation instruction to load each layer of the project map to be generated, wherein the project map is a component of the target project; reading the business data required for the operation of the target project; generating and outputting the project map based on the each layer and the business data.

[0094] Based on the above Figure 1 The method shown and Figure 3 The embodiment of the device shown in the figure, the embodiment of the present invention also provides a physical structure diagram of a computer device, such as Figure 5As shown, the computer device includes: a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both arranged on a bus 43, and the processor 41 implements the following steps when executing the program: obtaining operation instructions to be executed in the running state of the target project; calling a preset map function component according to the operation instruction to load various layers of the project map to be generated, wherein the project map is a component of the target project; reading the business data required for the operation of the target project; and generating and outputting the project map based on the various layers and the business data.

[0095] Through the technical solution of the present invention, the present invention can obtain the operation instructions to be executed when the target project is in operation; and call the preset map function component according to the operation instruction to load the various layers of the project map to be generated, wherein the project map is a component of the target project; at the same time, read the business data required for the operation of the target project; finally, based on the various layers and the business data, generate and output the project map, thereby completely realizing the separation of the map function logic code and the business code by creating a preset map function component, facilitating the later maintenance of the map function logic code or business code, and at the same time improving the reusability of the preset map function component, facilitating its transplantation to other projects, thereby shortening the project development cycle and improving the project development efficiency.

[0096] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A map generation method, It is characterized in that include: Get the operation instructions to be executed when the target project is running; Calling a preset map function component according to the operation instruction to load various layers of a project map to be generated, wherein the project map is a component of the target project; Read the business data required for the operation of the target project; Based on the various layers and the business data, generate and output the project map; Wherein, generating and outputting the project map based on the various layers and the business data includes: Get layer parameters and business data parameters; Determine a target layer to be drawn in each layer according to the layer parameters; Determining target business data to be utilized in the business data according to the business data parameters; According to the target business data, calling a preset drawing function to draw on the target layer to obtain a drawn target layer; Overlaying the drawn target layer with other layers that have not been drawn, generating the project map and outputting it; The calling of a preset map function component according to the operation instruction to load various layers of the project map to be generated includes: According to the operation instruction, calling the initialization function in the map function component to load the various layers in the page; The reading of the business data required for the operation of the target project includes: Determine a preset business data callback function corresponding to the target project, and use the preset business data callback function to obtain business data required for the operation of the target project; The layers include a base layer and an auxiliary layer, the auxiliary layer includes a functional layer that has been drawn, and before obtaining the operation instruction to be executed in the running state of the target project, the method further includes: Draw the basic layer and the functional layer, store them in a server, and configure a resource locator corresponding to the basic layer and a resource locator corresponding to the functional layer in a preset configuration file; The calling of a preset map function component according to the operation instruction to load various layers of the project map to be generated includes: The base layer and the function layer are loaded by using the map function component according to the resource locator corresponding to the base layer and the resource locator corresponding to the function layer.

2. The method according to claim 1, It is characterized in that Before acquiring the operation instruction to be executed in the target project running state, the method further includes: respectively configuring the basic information, drawing information and longitude and latitude information of different areas in each layer; The calling of a preset map function component according to the operation instruction to load various layers of the project map to be generated includes: The map function component loads each layer according to the basic information, drawing information and longitude and latitude information of different areas in each layer.

3. The method according to claim 1, It is characterized in that The step of calling the initialization function in the map function component to load each layer in the page according to the operation instruction includes: Acquire identification information corresponding to each layer, and determine position information of each layer in the page according to the identification information; Based on the location information, the initialization function in the map function component is called to load the various layers in the page.

4. A map generating device, It is characterized in that include: An acquisition unit, used for acquiring operation instructions to be executed when the target project is in operation; A loading unit, configured to call a preset map function component according to the operation instruction to load various layers of a project map to be generated, wherein the project map is a component of the target project; A reading unit, used to read the business data required for the operation of the target project; A generating unit, used for generating and outputting the project map based on the various layers and the business data; The generating unit is specifically used to obtain layer parameters and business data parameters; determine the target layer to be drawn in each layer according to the layer parameters; determine the target business data to be used in the business data according to the business data parameters; call a preset drawing function to draw on the target layer according to the target business data to obtain the drawn target layer; superimpose the drawn target layer with other layers that have not been drawn to generate the project map and output it; The loading unit is specifically used to call the initialization function in the map function component to load the various layers in the page according to the operation instruction, wherein the various layers include a basic layer and an auxiliary layer, and the auxiliary layer includes a functional layer that has been drawn; The reading unit is specifically used to determine the preset business data callback function corresponding to the target project, and use the preset business data callback function to obtain the business data required for the operation of the target project; A drawing unit, used for drawing the basic layer and the functional layer, storing them in a server, and configuring a resource locator corresponding to the basic layer and a resource locator corresponding to the functional layer in a preset configuration file; The loading unit is further specifically used to load the basic layer and the functional layer using the map function component according to the resource locator corresponding to the basic layer and the resource locator corresponding to the functional layer.

5. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method and device for generating and managing Web geographic information system (GIS) client control

    CN102419705A

  • Geographic information terminal and geographic information presentation method

    CN103559009A

  • Map data loading method and map data loading device based on GIS (geographic information system) platform

    CN104599324A

  • Map access operation plug-in generation method and system based on flex technology

    CN106126294A

  • Integrated platform for web application authoring and authoring method thereof

    KR1020140019623A