Map style file editing method, device, and electronic device

By analyzing and displaying the hierarchical structure of map style files and using tree controls for editing, the problem of complex and inefficient editing of map style files in the existing technology is solved, and efficient and accurate editing of map style files is achieved.

CN114546373BActive Publication Date: 2025-02-18HANHAI INFORMATION TECH SHANGHAI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011249036.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-10
Publication Date
2025-02-18
Estimated Expiration
2040-11-10

AI Technical Summary

Technical Problem

In the prior art, the editing process of map style files is complicated, easy to cause configuration errors, and low editing efficiency and time-consuming operation.

Method used

By obtaining and parsing the client's local map style files, using tree controls to display the hierarchical index relationships of data sources, land objects categories, and rendering layers, allowing users to trigger editing operations through branch nodes to update and preview map style files in real time.

Benefits of technology

Improves the editing efficiency of map style files, reduces error rate, simplifies the editing process, and reduces operation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114546373B_ABST
    Figure CN114546373B_ABST
Patent Text Reader

Abstract

The present application discloses a method for editing a map style file, which belongs to the field of computer technology and helps to improve the editing efficiency of a map style file. The method includes: obtaining a map style file stored locally on a client; parsing to obtain a data source, a feature category, and a rendering layer associated with each feature category configured in the map style file; displaying the hierarchical index relationship of the data source, the feature category, and the rendering layer in a first interface area of ​​the client through a tree control; in response to a first editing operation on the rendering layer triggered by a branch node in the tree control, displaying the corresponding file content of the rendering layer in the map style file in a second interface area of ​​the client; in response to a modification confirmation operation on the corresponding file content displayed in the second interface area, updating the corresponding file content of the rendering layer in the map style file; and displaying a map image rendered based on the updated map style file in a third interface area of ​​the client.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a map style file editing method, device, electronic device and computer-readable storage medium. Background Art

[0002] At present, in the process of electronic map rendering, map data is rendered in a hierarchical manner, and correspondingly, feature data is also rendered in a hierarchical manner. For example, at different zoom levels, features are displayed according to factors such as the category, geometric relationship, name, area size, importance and popularity of the features. The display rules for map data will be pre-configured into a style file. When the rendering engine is started, the style file is loaded and parsed to obtain map tile data, and then the obtained tile data is rendered and displayed according to the display rules configured in the style file. Since the style file needs to contain the configuration information of all features, these feature information will be divided according to layers, and different layers contain different filtering rules and geometric drawing rules (offset, color, width, etc.). A complete style file may contain hundreds of layer configuration information, which makes the style file abnormally large and complex. In the prior art, when map data needs to be maintained, for example, the display style needs to be modified, the name of a feature needs to be modified, etc., the operator can only edit this huge style file directly, and then load the edited style file into the engine to preview the display effect rendered according to the modified style file, and repeatedly adjust the file until the map display effect meets the requirements.

[0003] It can be seen that the map display style editing method in the prior art has at least the following defects: since the style file is directly configured, the style file has too many lines and the decomposition is huge, it is extremely easy to have configuration errors, misoperations or structural errors, and it is difficult to troubleshoot the error points; from the style file being published to the server, then downloaded locally by the client and rendered through the map rendering engine, and then the display effect is checked, the map display style editing process has a long link, and for a single debugging style effect, the process is lengthy and the operation is time-consuming. Summary of the invention

[0004] The embodiment of the present application provides a method for editing a map style file, which helps to improve the efficiency of editing map style files and reduce the error rate.

[0005] In a first aspect, an embodiment of the present application provides a method for editing a map style file, comprising:

[0006] Get the map style file stored locally on the client;

[0007] Parse the map style file to obtain the data source, feature category, and rendering layer associated with each feature category configured in the map style file; wherein the data source is used to indicate the source of vector map data of the map; and the rendering layer is a subdivided feature category of the feature category;

[0008] Displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control;

[0009] In response to triggering a first editing operation on the rendering layer corresponding to the branch node through the branch node in the tree control, displaying corresponding file content of the rendering layer corresponding to the branch node in the map style file in the second interface area of ​​the client;

[0010] In response to a modification confirmation operation on the corresponding file content displayed in the second interface area, updating the corresponding file content of the rendering layer corresponding to the branch node in the map style file through the modified corresponding file content in the second interface area;

[0011] In the third interface area of ​​the client, a map image rendered based on the updated map style file is displayed.

[0012] In a second aspect, an embodiment of the present application provides a map style file editing device, comprising:

[0013] A map style file acquisition module is used to acquire the map style file stored locally on the client;

[0014] A map style file parsing module, used to parse the map style file, obtain the data source, feature category, and rendering layer associated with each feature category configured in the map style file; wherein the data source is used to indicate the source of vector map data of the map; and the rendering layer is a subdivided feature category of the feature category;

[0015] A rendering layer tree display module, used to display the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control;

[0016] A first layer style editing module, configured to display corresponding file contents of the rendering layer corresponding to the branch node in the map style file in a second interface area of ​​the client in response to triggering a first editing operation on the rendering layer corresponding to the branch node through the branch node in the tree control;

[0017] A first map style file updating module, configured to respond to a modification confirmation operation on the corresponding file content displayed in the second interface area, and update the corresponding file content of the rendering layer corresponding to the branch node in the map style file through the corresponding file content modified in the second interface area;

[0018] A map rendering and display module is used to display a map image rendered based on the updated map style file in the third interface area of ​​the client.

[0019] In a third aspect, an embodiment of the present application further discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the map style file editing method described in the embodiment of the present application is implemented when the processor executes the computer program.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the map style file editing method disclosed in the embodiment of the present application are performed.

[0021] The map style file editing method disclosed in the embodiment of the present application obtains a map style file stored locally on a client; parses the map style file to obtain a data source, a feature category, and a rendering layer associated with each feature category configured in the map style file; wherein the data source is used to indicate a source of vector map data of a map; the rendering layer is a subdivided feature category of the feature category; through a tree control, the hierarchical index relationship of the data source, the feature category, and the rendering layer is displayed in a first interface area of ​​the client; in response to a first editing operation on the rendering layer corresponding to the branch node triggered by a branch node in the tree control, the corresponding file content of the rendering layer corresponding to the branch node in the map style file is displayed in a second interface area of ​​the client; in response to a modification confirmation operation on the corresponding file content displayed in the second interface area, the corresponding file content of the rendering layer corresponding to the branch node in the map style file is updated through the modified corresponding file content in the second interface area; in a third interface area of ​​the client, a map image rendered based on the updated map style file is displayed, thereby effectively improving the editing efficiency of the map style file.

[0022] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] Figure 1 This is a flow chart of a method for editing a map style file according to Embodiment 1 of the present application;

[0025] Figure 2 It is a data structure diagram of a tree control in Embodiment 1 of the present application;

[0026] Figure 3 This is a schematic diagram of the display effect of the tree control in Example 1 of the present application;

[0027] Figure 4 This is a schematic diagram of the client interface in Example 1 of the present application;

[0028] Figure 5 This is one of the structural schematic diagrams of the map style file editing device of the third embodiment of the present application;

[0029] Figure 6 This is the second structural diagram of the map style file editing device of the third embodiment of the present application;

[0030] Figure 7 A block diagram schematically shows an electronic device for executing the method according to the present application; and

[0031] Figure 8 A storage unit for holding or carrying a program code for implementing the method according to the present application is schematically shown. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] Embodiment 1

[0034] The present application discloses a method for editing a map style file, such as Figure 1 As shown, the method includes: step 110 to step 160. The specific implementation of each step is introduced below.

[0035] Step 110, obtaining a map style file stored locally on the client.

[0036] In some embodiments of the present application, it is first necessary to store the map style file to be edited locally on the client to facilitate editing on the client side and loading of the map style file by the rendering engine.

[0037] Step 120, parsing the map style file, obtaining the data source, feature category, and rendering layers associated with each feature category configured in the map style file.

[0038] The data source is used to indicate the source of vector map data of the map; the rendering layer is a subdivided feature category of the feature category.

[0039] The map style file described in the embodiment of the present application is a JSON (JavaScript Object Notation) file that stores rendering configuration information such as data sources, feature categories, and rendering layers in the map. Notation, which is a lightweight data exchange format) format file. The map style file describes the map style configuration information in the form of JSON key-value pairs, that is, the map style file describes the correspondence between the configuration object and the specific configuration data in the form of JSON key-value pairs. For example, the configuration information of the data source can be expressed as "source-list":{"XXXX":{"url":"XXXX:???????"},"type":"vector"}, where "source-list" is a first preset string, which is used as a key for configuring the data source, "XXXX" represents the identifier of the data source, such as the data source name, the data source is represented in the form of a link, and the string "url" is the key for indexing the data source. For another example, the configuration information of the rendering layer can be expressed as: "source":"zzzz.XXXX.YYYY", where "source" is a second preset string, zzzz represents the layer type, that is, the feature category, XXXX represents the data source, and YYYY represents the rendering layer identifier. In some embodiments of the present application, the rendering layer identifier is the name of the rendering layer.

[0040] In some embodiments of the present application, a specific object property to be configured is represented by a specified string in a map style file. For example, a key-value pair with a string "style-list" as a key may be used to represent that the configured object is a rendering layer list, a key-value pair with a string "visibility" as a key may be used to represent the visualization property of the configured rendering layer, a key-value pair with a string "name" as a key may be used to represent the name of the configured rendering layer, and so on.

[0041] Therefore, in some embodiments of the present application, the map style file describes the map style configuration information in the form of JSON key-value pairs, and the parsing of the map style file to obtain the data source, feature category, and rendering layer associated with each feature category configured in the map style file includes: determining the key-value pair of the data source configured in the map style file by matching a first preset string with the string in the map style file; and determining at least one data source configured in the map style file according to the key-value pair of the data source configured. For example, by matching the string "source-list" with the string in the map style file, a key-value pair with the string "source-list" as the key is determined, that is, a key-value pair used to describe the configuration information of the data source; thereafter, the index value is parsed according to the preset format to obtain the identifiers of all data sources configured in the map style file (such as the data source name) and the link address of the data source file.

[0042] In some embodiments of the present application, the parsing of the map style file, obtaining the data source, feature category, and rendering layer associated with each feature category configured in the map style file, further includes: determining the key-value pair of the rendering layer configured in the map style file by matching the second preset string with the string in the map style file; determining at least one rendering layer configured in the map style file and the feature category associated with each rendering layer, and the data source corresponding to each rendering layer according to the key-value pair of the rendering layer configuration. For example, by matching the string "source" with the string in the map style file, a key-value pair with the string "source" as the key is determined, i.e., a key-value pair used to describe the configuration information of the rendering layer; then, parsing the index value according to the preset format, all rendering layer identifiers (such as the name of the rendering layer) configured in the map style file and the feature category to which each rendering layer belongs, as well as the data source of the rendering layer can be obtained. Taking the key-value pair "source": "zzzz.XXXX.YYYY" of the configuration information of the aforementioned configuration rendering layer as an example, YYYY is the rendering layer identifier, and XXXX is the data source identifier corresponding to the rendering layer.

[0043] By parsing the map style file, it is possible to obtain all data sources configured by the map style file, the feature categories included in each data source, and the rendering layers of each feature category included in each data source.

[0044] In the embodiment of the present application, the rendering layer is a subdivided feature category. For example, for the feature category road, its subdivided feature category further includes: expressway, ring road, main urban traffic road, auxiliary road, community internal road, etc. When rendering a map, different subdivided feature categories are rendered in batches. Therefore, each subdivided feature category is used as a rendering layer for rendering style editing.

[0045] In some embodiments of the present application, the configuration objects such as data source, feature category, rendering layer, and the hierarchical index relationship between the configuration objects included in the map style file can also be obtained by calling the interface of the preset rendering engine.

[0046] First, the client software reads the stored map style file (for example: / Users / xxx / Desktop / light5.json) and saves it in the string localstyle; then, the rendering engine's interface function for adding layer data is called to save the map style file in the data structure mapping table of the rendering engine in the form of key:value (i.e. key-value pair), where key is the file name (" / Users / xxx / Desktop / light5.json") and value is the string localstyle; then, the rendering engine's interface function for constructing layer mapping relationships is called to dynamically load the string localstyle (i.e. the content of the map style file). In the process of loading the content of the map style file, the rendering engine parses the content of the map style file and generates a vector array containing objects such as rendering layer objects and data source objects.

[0047] When parsing the map style file content (i.e., string localstyle), the rendering engine parses the array objects corresponding to the third preset string (such as "style-list") in the map style file in sequence, builds the corresponding rendering layer objects, and then saves them in the vector array. Each rendering layer object contains the following main attributes: feature category, layer level name, layer data source, layer identifier, layer display level, layer interactivity, layer visibility, layer filtering conditions, minimum and maximum display levels of the layer, and other attributes.

[0048] On the other hand, the rendering engine parses the array objects corresponding to the first preset string (such as "source-list") in the map style file in sequence, and constructs the corresponding data source object, and then saves the constructed data source object into the vector array. Each data source object may include: data source type and data source identification attributes.

[0049] After the rendering engine parses the map style file, all data source objects and rendering layer objects are saved in the rendering engine's vector array. In subsequent rendering or query processes, the rendering engine can obtain all data source objects and rendering layer objects included in the specified map style file by accessing the vector array.

[0050] Step 130 , displaying the hierarchical index relationship among the data source, the feature category, and the rendering layer in the first interface area of ​​the client through a tree control.

[0051] The data source, the feature category, and the rendering layer correspond to branch nodes of the tree control respectively.

[0052] After obtaining the data source, feature category and rendering layer configured in the map style file, the rendering layer included in the map style file is further visualized through a tree control to facilitate operator selection and operation.

[0053] In some embodiments of the present application, the hierarchical index relationship of the data source, the feature category, and the rendering layer is displayed in the first interface area of ​​the client through a tree control, including: constructing a first-level branch node of the root node of the tree control according to each of the data sources, each of the first-level branch nodes corresponds to a data source; for each of the first-level branch nodes, constructing a second-level branch node of the first-level branch node according to each feature category included in the data source corresponding to the first-level branch node, each of the second-level branch nodes corresponds to a feature category; for each of the second-level branch nodes, constructing a third-level branch node of the second-level branch node according to each rendering layer associated with the feature category corresponding to the second-level branch node, each of the third-level branch nodes corresponds to a rendering layer; and displaying the tree control in the first interface area of ​​the client. It can be seen from the above tree control construction method that the data source is a first-level index, and under the condition of specifying the data source, the rendering layer is further indexed by the feature category.

[0054] For example, first initialize the root node of the data structure corresponding to the tree control, such as Figure 2 200 in the figure, and then, a child node of the root node is constructed according to the information of each data source obtained, as the first-level branch node of the tree control. Taking the map style file including two data sources as an example, two child nodes of the root node will be constructed here, such as Figure 2 Nodes 210 and 220 in the tree control. The two child nodes correspond to two first-level branch nodes of the tree control. Accordingly, the display information of each first-level branch node is configured as the relevant information of the corresponding data source (such as the name of the data source, the link address of the data source file, the data source type, etc.).

[0055] Next, according to the feature categories included in each data source, construct the child nodes of the child nodes corresponding to each data source. Take node 210 as an example. Assume that the data source corresponding to node 210 is identified as "sankuai", and the data source identified as "sankuai" includes three feature categories, namely: road, park and river. Then, a child node of node 210 is constructed based on the three feature categories included in the data source "sankuai" in the map style file. Figure 2 The three nodes 2101, 2102 and 2103 are shown. Nodes 2101, 2102 and 2103 correspond to a secondary branch node of the tree control respectively. Accordingly, the display information of each secondary branch node is configured as the relevant information of the corresponding feature category. Taking the above-mentioned feature category identifiers as "roadlayer", "parklayer" and "riverlayer" as an example, the branch node "sankuai" of the tree control includes 3 branch nodes, which are displayed as "roadlayer", "parklayer" and "riverlayer".

[0056] After that, continue to construct the child nodes of each secondary branch node. That is, for each secondary branch node, the child nodes of the corresponding branch node are constructed according to the rendering layer of the specified feature category of the specified data source corresponding to the branch node. For example, for the secondary branch node 2101, which contains the feature category (i.e., road) in the data source identified by "sankuai" and corresponding to the feature category identified by "roadlayer", then the child nodes of the secondary branch node 2101 can be constructed according to all rendering layers of the data source corresponding to the "sankuai" identifier and belonging to the road type, and one or more tertiary branch nodes are obtained. Taking the feature category identified by "roadlayer" as an example, which includes 2 subdivided feature categories, respectively marked as "internalroad" and "urbanroad", two child nodes 21011 and 21012 of the secondary branch node 2101 will be constructed.

[0057] Afterwards, the constructed tree control is displayed in the first interface area of ​​the client.

[0058] In some embodiments of the present application, the information displayed in the tree control includes: data source, feature category, and rendering layer. Figure 2 As an example, in the tree control shown, Figure 3As shown, the data source is displayed in the first-level branch node of the tree control, and each data source corresponds to a first-level branch node 310; the feature category is displayed in the second-level branch node of the tree control, and each feature category corresponds to a second-level branch node 320; the rendering layer is displayed in the third-level branch node of the tree control, and each rendering layer corresponds to a third-level branch node 330. The data source, feature category and rendering image are indexed layer by layer.

[0059] In some embodiments of the present application, the tree control further includes a check box, each option of the check box corresponds to a branch node, and the check box is used to select a rendering layer or a feature category corresponding to a branch node individually or in batches. Figure 3 A selection box is set in front of each secondary branch node and tertiary branch node, and the selection boxes in front of all secondary branch nodes and tertiary branch nodes in the tree control are combined into a check box. For example, the operator can click the selection box in front of a secondary branch node, and at this time, all the tertiary branch nodes indexed by the secondary branch node will be selected, that is, all the rendering layers of the feature category corresponding to the branch node will be selected. The operator can select all the rendering layers of the feature category at the same time by clicking the selection box in front of a secondary branch node; the operator can also select the selection box in front of one or more tertiary branch nodes to select the corresponding rendering layer of the specified feature category.

[0060] After constructing a tree control according to the hierarchical index relationship of the configuration objects in the map style file, in some embodiments of the present application, the following will be displayed in the display area of ​​the client: Figure 4 The interactive interface shown in the figure includes at least a first interface area 410, a second interface area 420 and a third interface area 430. The first interface area 410 is used to display a tree control and obtain a user's triggering operation on each branch node in the tree control; the second interface area 420 is configured to display an edit box for displaying a data block in a map style file and responding to a user's editing operation on a data block in the map style file displayed in the edit box; the third interface area 430 is used to display a rendered map image.

[0061] For the content in the first interface area 410, the second interface area 420, and the third interface area 430 displayed in the client, the user can interact with the client by triggering the content displayed in the above interface areas. For example, the user can select any third-level branch node in the first interface area 410 to trigger the editing operation, deletion operation, adding a front layer operation, and adding a back layer operation on the rendering layer corresponding to the third-level branch node. For another example, the user can select any first- and second-level branch nodes in the first interface area 410 to trigger the editing operation, deletion operation, and addition operation of the feature category corresponding to the second-level branch node. For another example, the user can select any second-level branch node and third-level branch node in the first interface area 410 to trigger the rendering engine to render the map data for the selected rendering layer and update the map image displayed in the third interface area 430.

[0062] For example, in the embodiment of the present application, when the user selects a third-level branch node of the tree control displayed in the first interface area 410, the client triggers the editing operation of the rendering layer corresponding to the third-level branch node after detecting the operation. Specifically, a function menu may be popped up for the user to select which editing operation to perform, wherein the function menu may include menu options such as editing layer, adding a front layer, adding a rear image, deleting a layer, etc. The user may trigger the corresponding layer editing process by selecting a menu option.

[0063] Step 140, in response to triggering a first editing operation on the rendering layer corresponding to the branch node through the branch node in the tree control, displaying the corresponding file content of the rendering layer corresponding to the branch node in the map style file in the second interface area of ​​the client.

[0064] Taking the user selecting the editing layer as an example, when the client detects that the user has selected to perform an editing operation on the currently selected rendering layer, first, the client obtains the corresponding file content in the aforementioned map style file for configuring the currently selected rendering layer, and then displays the obtained corresponding file content in the second interface area 420 of the client for the user to browse and edit.

[0065] In some embodiments of the present application, in response to a first editing operation on the rendering layer corresponding to the branch node being triggered through the branch node in the tree control, the corresponding file content of the rendering layer corresponding to the branch node in the map style file is displayed in the second interface area of the client, including: in response to the user triggering a first editing operation on the rendering layer corresponding to the branch node through a branch node in the displayed tree control, determining a rendering layer identifier in the map style file that matches the rendering layer targeted by the first editing operation; determining the corresponding file content of the rendering layer corresponding to the branch node in the map style file according to the position of the rendering layer identifier in the map style file; and displaying the determined corresponding file content in the second interface area of the client.

[0066] In some embodiments of the present application, when determining the rendering layer identifier in the map style file that matches the rendering layer targeted by the first editing operation, the identifier of the data source corresponding to the first-level branch node to which the selected branch node belongs can be determined; and the key-value pair of the rendering layer that matches both the identifier of the data source and the identifier of the rendering layer targeted by the first editing operation is determined in the map style file by means of regular expression matching. For example, after determining the branch node currently selected by the user, according to the data stored in the data structure of the tree control, the identifier of the rendering layer corresponding to the currently selected branch node is determined (such as the name of the rendering layer "poi_label_basketball_gymnasium"); then, the following regular expression pattern = "\"name\"\\s*:\\s*\"poi_label_basketball_gymnasium\"" is combined according to the identifier of the rendering layer; then, a regular match is made in the content of the foregoing map style file to determine the key-value pair that matches successfully, and the position of the key-value pair that matches successfully in the map style file is recorded. Then, according to the successfully matched rendering layer identifier, the key-value pair corresponding to a configuration statement or multiple key-value pairs corresponding to a section of configuration statements is determined as the corresponding file content that the user may edit.

[0067] In some embodiments of the present application, determining the corresponding file content of the rendering layer corresponding to the branch node in the map style file according to the position of the rendering layer identifier in the map style file includes: determining the file content between the left parenthesis that is not paired and closest to the position before the position in the map style file and the right parenthesis that is not paired and closest to the position after the position as the corresponding file content of the rendering layer targeted by the first editing operation in the map style file. Still taking the rendering layer name corresponding to the branch node in the tree control selected by the user as "poi_label_basketball_gymnasium" as an example, after regular expression matching, the position of the string that matches the current regular expression pattern = "\"name\": \"poi_label_basketball_gymnasium\"" in the map style file is denoted as n. Then, the first unpaired left parenthesis "{" is found in the map style file content before the position n, and the position of this left parenthesis "{" in the map style file is denoted as pre. Next, the first unpaired right parenthesis "}" is found in the map style file content after the position n, and the position of this right parenthesis "}" in the map style file is denoted as next. Then, the file content between the positions pre and next in the map style file is the data of the rendering layer with the configuration name "poi_label_basketball_gymnasium", that is, the corresponding file content of the rendering layer with the name "poi_label_basketball_gymnasium" in the map style file.

[0068] Step 150, in response to the modification confirmation operation on the corresponding file content displayed in the second interface area, update the corresponding file content of the rendering layer corresponding to the branch node in the map style file with the modified corresponding file content in the second interface area.

[0069] The user edits the style configuration content displayed in the second interface area and then saves the edited configuration content. After the client detects that the user saves the edited style configuration content, it first checks the format, numerical legality, etc. of the content currently displayed in the second interface area, and then replaces the corresponding style configuration content in the map style file with the modified style configuration content.

[0070] In some embodiments of the present application, after the step of determining the corresponding file content of the rendering layer corresponding to the branch node in the map style file according to the position of the rendering layer identifier in the map style file, the step further includes: recording the position of the corresponding file content; thereafter, in response to the modification confirmation operation of the corresponding file content displayed in the second interface area, updating the corresponding file content of the rendering layer corresponding to the branch node in the map style file through the modified corresponding file content in the second interface area. For example, after the corresponding file content of the rendering layer corresponding to the selected branch node in the map style file (such as the file content between the aforementioned positions pre to next) is read into the memory for display in the second interface area, the values ​​of the positions pre and next of the read corresponding file content in the map style file are saved at the same time. After the user finishes editing the style configuration content and chooses to save, the client reads the edited style configuration content displayed in the second interface area, and replaces the file content between the positions pre to next in the map style file with the edited style configuration content.

[0071] Step 160: Displaying a map image rendered based on the updated map style file in the third interface area of ​​the client.

[0072] After the map style file is updated, the client notifies the preset rendering engine to re-render the map based on the updated style configuration data, and updates the map image displayed in the third interface area.

[0073] In some embodiments of the present application, a map image rendered based on the updated map style file is displayed in the third interface area of ​​the client, including: using a preset rendering engine to render an image based on the updated map style file to obtain a map image; and displaying the map image in the third interface area of ​​the client. In some embodiments of the present application, the rendering engine can reload the local map style file of the client by calling a callback function preset by the client. The rendering engine performs map rendering based on the updated map style file to obtain a re-rendered map image. The client is in the following manner: Figure 4 The third interface area shown displays the re-rendered map image to achieve the purpose of displaying the display effect of the modified style in real time.

[0074] In some embodiments of the present application, the newly added rendering layer can also be edited. After displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through the tree control, it also includes: in response to the user triggering a second editing operation of adding a front layer or a back layer to the rendering layer corresponding to the branch node through the branch node in the tree control, adding a branch node corresponding to the front layer or the back layer in the tree control; determining the rendering layer identifier in the map style file that matches the rendering layer targeted by the second editing operation; determining the corresponding file content of the rendering layer corresponding to the branch node in the map style file according to the position of the rendering layer identifier in the map style file; copying the corresponding file content of the rendering layer corresponding to the branch node in the map style file to obtain a copy data block; modifying the rendering layer identifier in the copy data block to the identifier of the added front layer or the back layer, and inserting the modified copy data block into the map style file.

[0075] For example, if a user clicks on a third-level branch node of a tree control and then selects a new front layer through the pop-up function menu, when the client detects that the user has selected to perform an edit operation of adding a new front layer on the currently selected rendering layer, a branch node corresponding to the added front layer will be added to the tree control, and the user will be prompted to edit the node identifier (such as the node name). After the user confirms to save the newly added rendering layer, the client will add the configuration content corresponding to the newly added rendering layer in the aforementioned map style file.

[0076] Take the branch node corresponding to the rendering layer layer1 and the editing operation of adding the front layer layer10 as an example. When adding the configuration content corresponding to the newly added rendering layer in the map style file, first use the method described above to determine the file content in the map style file corresponding to the rendering layer layer1 (that is, the style configuration data of the rendering layer layer1). Usually, the file content in the map style file corresponding to each rendering layer will be marked by a pair of curly brackets. After that, copy the file content, and modify the identifier of the rendering layer layer1 in the copied file content to the identifier of the added front layer layer10. Then, insert the copied file content obtained after the modification into the map style file, for example, it can be inserted into the file position adjacent to the file content corresponding to the rendering layer layer1.

[0077] In some embodiments of the present application, in response to the user triggering a second editing operation of adding a front layer or a back layer to the rendering layer corresponding to the branch node through a branch node in the tree control, the method further includes: obtaining the identifier of the front layer or the identifier of the back layer input by the second editing operation; performing a duplicate check on the identifier of the front layer or the identifier of the back layer based on the rendering layer identifier in the map style file; in response to finding a rendering layer identifier that is the same as the identifier of the front layer or the identifier of the back layer in the map style file, outputting a prompt message indicating that the identifier of the front layer or the identifier of the back layer is repeated. For example, when the identifier of the newly added rendering layer input by the user is the same as the name of the rendering layer already in the tree control, the client outputs a prompt message to prompt the user that the layer name is repeated and needs to be re-entered.

[0078] After adding a rendering layer, you can further select the newly added rendering layer to modify the configuration content of the rendering layer in the map style file.

[0079] The map style file editing method disclosed in the embodiment of the present application obtains a map style file stored locally on a client; parses the map style file to obtain a data source, a feature category, and a rendering layer associated with each feature category configured in the map style file; wherein the data source is used to indicate a source of vector map data of a map; the rendering layer is a subdivided feature category of the feature category; through a tree control, the hierarchical index relationship of the data source, the feature category, and the rendering layer is displayed in a first interface area of ​​the client; in response to a first editing operation on the rendering layer corresponding to the branch node triggered by a branch node in the tree control, the corresponding file content of the rendering layer corresponding to the branch node in the map style file is displayed in a second interface area of ​​the client; in response to a modification confirmation operation on the corresponding file content displayed in the second interface area, the corresponding file content of the rendering layer corresponding to the branch node in the map style file is updated through the modified corresponding file content in the second interface area; in a third interface area of ​​the client, a map image rendered based on the updated map style file is displayed, thereby effectively improving the editing efficiency of the map style file.

[0080] In some embodiments of the present application, after the user clicks on a third-level branch node of the tree control, he can also choose to delete the layer through the pop-up function menu. The client will detect that the user has chosen to delete the layer operation on the currently selected rendering layer. Accordingly, the client will delete the corresponding branch node in the tree control and the corresponding file content in the map style file.

[0081] For example, after displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through the tree control, the method further includes: in response to the user triggering a deletion operation on the rendering layer corresponding to the branch node through the tree control, deleting the corresponding branch node in the tree control and the corresponding file content of the rendering layer corresponding to the branch node targeted by the deletion operation in the map style file; wherein the corresponding file content of the rendering layer corresponding to the branch node targeted by the deletion operation in the map style file is determined by the following method: in the map style file, determining the location of the rendering layer identifier that matches the rendering layer corresponding to the branch node targeted by the deletion operation; and determining the file content between the nearest unpaired left bracket before the position and the nearest unpaired right bracket after the position in the map style file as the corresponding file content of the rendering layer corresponding to the branch node targeted by the deletion operation in the map style file.

[0082] Specifically, in the map style file, the specific implementation method for determining the location of the rendering layer identifier that matches the rendering layer corresponding to the branch node targeted by the deletion operation is described in the previous example, which will not be repeated here. The specific implementation method for determining the corresponding file content of the rendering layer corresponding to the branch node in the map style file is described in the previous example, which will not be repeated here.

[0083] In an embodiment of the present application, after the map style file is updated, the rendering engine will reload the updated map style file and perform map rendering based on the updated map style file.

[0084] In some embodiments of the present application, the client is a computing and processing device, and the client implements efficient editing of the map style file by executing each step of the map style file editing method disclosed in the embodiments of the present application.

[0085] Through the map style file editing method disclosed in the embodiment of the present application, the configuration objects in the map style file are displayed based on the tree control index, and the user can conveniently select the configuration objects such as the rendering layer that needs to be configured, and quickly locate the style file content corresponding to each configuration object; then, by displaying the quickly located style file content, it is convenient for the user to directly modify the map style file; finally, after the map style file is modified, the rendering engine renders the map image based on the updated map style file, and the rendered map image is displayed in the client interface, thereby realizing real-time preview of the map display effect changes caused by the modification of the map style file, without the need to upload the map style data to the server and then download it to the client, shortening the development path of map style modification, and fully improving the efficiency of map style editing. On the other hand, by executing the map style editing tool, the regular matching method is used to directly locate the relevant file content from the map style file according to the rendering layer selected by the user, and the located file content is displayed in the editing interface, and the user does not need to manually search for the configuration code of the rendering layer in the lengthy map style file, which is not only efficient but also not prone to errors.

[0086] Embodiment 2

[0087] The embodiment of the present application discloses a method for editing a map style file, wherein the tree control also includes a check box, the map image is rendered by a preset rendering engine, and the preset rendering engine parses the map style file before rendering the map image to construct a layer object, and the layer object includes a visibility attribute for indicating whether to render the corresponding rendering layer. Correspondingly, after displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through the tree control, it also includes: in response to the user through the check box in the tree control, triggering the selection operation of the rendering layer corresponding to the corresponding branch node, determining the branch node and the node selection state operated by the selection operation; according to the branch node and the node selection state operated by the selection operation, setting the visibility attribute of the layer object associated with the rendering layer corresponding to the operated branch node, and triggering the preset rendering engine to perform map rendering based on the modified visibility attribute to obtain a map image showing part or all of the rendering layer.

[0088] In the prior art, before executing map rendering, the rendering engine will first load the map style file, then parse the map style file, and construct a data source object according to the file content of the data source configured in the map style file, and construct a layer object according to the file content of the rendering layer configured in the map style file. The layer object includes various attribute information of the rendering layer, such as name, feature category, data source, interactivity, visibility and hiding attributes, display level, etc. The rendering engine performs map rendering according to the constructed layer object. In an embodiment of the present application, by setting a check box in a tree control, the user can select visible and invisible rendering layers through the check box. The client maps the visible rendering layer and the invisible rendering layer selected by the user according to the user's selection of the check box in the tree control. After that, by calling the interface provided by the rendering engine, the visibility and hiding attributes of the layer object associated with the rendering layer are set, thereby controlling the display and hiding of the rendering layer.

[0089] When determining the visible and invisible rendering layers selected by the user based on the selection result of the check box in the tree control, the method in the prior art can be first used to determine the branch nodes selected by the user and the unselected branch nodes in the tree control, and then, based on the correspondence between the branch nodes and the rendering layers, the rendering layers selected by the user and the unselected rendering layers can be further determined. Among them, the layer object associated with the rendering layer is a layer object constructed according to the file content of the rendering layer in the map style file. In the embodiment of the present application, the layer object is named according to the identifier (such as the name) of the rendering layer to which it is associated, so the layer object associated with the rendering layer can be determined by identifier matching.

[0090] The specific implementation methods of the rendering engine loading the map style file and parsing the map style file, and constructing the layer object can be found in the prior art and will not be described in detail in the embodiments of the present application.

[0091] The map style file editing method disclosed in the embodiment of the present application displays the configuration objects in the map style file based on the tree control index, and combines check boxes in the tree control to obtain the user's selection and deselection status of the rendering layer through the check boxes, and sets the visibility attributes of the layer object constructed in the rendering engine according to the selection result of the check box, thereby realizing visual control of the display and hiding of the rendering layer, and real-time preview of the effects of hiding and displaying one or more rendering layers, which helps to improve the editing efficiency of the map style file.

[0092] Embodiment 3

[0093] The present application discloses a map style file editing device, such as Figure 5 As shown, the device comprises:

[0094] A map style file acquisition module 510 is used to acquire a map style file stored locally on the client;

[0095] The map style file parsing module 520 is used to parse the map style file, obtain the data source, feature category, and rendering layer associated with each feature category configured in the map style file; wherein the data source is used to indicate the source of vector map data of the map; and the rendering layer is a subdivided feature category of the feature category;

[0096] A rendering layer tree display module 530 is used to display the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control;

[0097] A first layer style editing module 540 is configured to display the corresponding file content of the rendering layer corresponding to the branch node in the map style file in the second interface area of ​​the client in response to triggering a first editing operation on the rendering layer corresponding to the branch node through the branch node in the tree control;

[0098] A first map style file updating module 550 is configured to update the corresponding file content of the rendering layer corresponding to the branch node in the map style file through the modified corresponding file content in the second interface area in response to a modification confirmation operation on the corresponding file content displayed in the second interface area;

[0099] The map rendering and display module 560 is used to display a map image rendered based on the updated map style file in the third interface area of ​​the client.

[0100] In some embodiments of the present application, the rendering layer tree display module 530 is further used to:

[0101] According to each of the data sources, construct first-level branch nodes of the root node of the tree control respectively, each of the first-level branch nodes corresponds to one of the data sources;

[0102] For each of the first-level branch nodes, construct a second-level branch node of the first-level branch node according to each feature category included in the data source corresponding to the first-level branch node, each of the second-level branch nodes corresponds to one feature category;

[0103] For each of the second-level branch nodes, according to each rendering layer associated with the feature category corresponding to the second-level branch node, a third-level branch node of the second-level branch node is constructed respectively, and each of the third-level branch nodes corresponds to one of the rendering layers;

[0104] The tree control is displayed in the first interface area of ​​the client.

[0105] In some embodiments of the present application, the first layer style editing module 540 is further used to:

[0106] In response to a user triggering a first editing operation on the rendering layer corresponding to the branch node through a branch node in the tree control displayed, determining a rendering layer identifier in the map style file that matches the rendering layer targeted by the first editing operation;

[0107] Determine, according to the position of the rendering layer identifier in the map style file, the corresponding file content of the rendering layer corresponding to the branch node in the map style file;

[0108] The determined corresponding file content is displayed in the second interface area of ​​the client.

[0109] In some embodiments of the present application, determining the corresponding file content of the rendering layer corresponding to the branch node in the map style file according to the position of the rendering layer identifier in the map style file includes:

[0110] The file content between the nearest unpaired left bracket before the position and the nearest unpaired right bracket after the position in the map style file is determined as the corresponding file content of the rendering layer targeted by the first editing operation in the map style file.

[0111] In some embodiments of the present application, Figure 6 As shown, the device also includes:

[0112] The second layer style editing module 570 is configured to trigger a second editing operation of adding a front layer or a back layer to the rendering layer corresponding to the branch node in response to the user passing through the branch node in the tree control, add a branch node corresponding to the front layer or the back layer in the tree control; and determine a rendering layer identifier in the map style file that matches the rendering layer targeted by the second editing operation;

[0113] The second map style file updating module 571 is used to determine the corresponding file content of the rendering layer corresponding to the branch node in the map style file according to the position of the rendering layer identifier in the map style file; copy the corresponding file content of the rendering layer corresponding to the branch node in the map style file to obtain a copy data block; and

[0114] The rendering layer identifier in the copy data block is modified to the identifier of the added front layer or the back layer, and the modified copy data block is inserted into the map style file.

[0115] In some embodiments of the present application, Figure 6 As shown, the device also includes:

[0116] The third layer style editing module 580 is configured to trigger a deletion operation on the rendering layer corresponding to the branch node in the tree control in response to the user clicking on the branch node in the tree control, and delete the corresponding branch node in the tree control;

[0117] The third map style file updating module 581 is used to delete the corresponding file content of the rendering layer corresponding to the branch node targeted by the deletion operation in the map style file; wherein the corresponding file content of the rendering layer corresponding to the branch node targeted by the deletion operation in the map style file is determined by the following method:

[0118] In the map style file, determining the location of the rendering layer identifier that matches the rendering layer corresponding to the branch node targeted by the deletion operation;

[0119] The file content between the nearest unpaired left bracket before the position and the nearest unpaired right bracket after the position in the map style file is determined as the corresponding file content in the map style file of the rendering layer corresponding to the branch node targeted by the deletion operation.

[0120] In some embodiments of the present application, the tree control includes a check box, the map image is rendered by a preset rendering engine, and the preset rendering engine parses the map style file before rendering the map image to construct a layer object, and the layer object includes a visible or invisible attribute for indicating whether to render the corresponding rendering layer; Figure 6 As shown, the device also includes:

[0121] The layer display and hiding control module 590 is used to trigger the selection operation of the rendering layer corresponding to the corresponding branch node in response to the user using the check box in the tree control, and determine the branch node operated by the selection operation and the node selection state; and

[0122] According to the branch node operated by the selection operation and the node selection status, the visibility and hiding properties of the layer object associated with the rendering layer corresponding to the branch node operated are set, and the preset rendering engine rendering is triggered to perform map rendering based on the modified visibility and hiding properties to obtain a map image showing part or all of the rendering layer.

[0123] The map style file editing device disclosed in the embodiment of the present application is used to implement the map style file editing method described in Embodiment 1 and Embodiment 2 of the present application. The specific implementation methods of each module of the device will not be repeated here, and reference may be made to the specific implementation methods of the corresponding steps in the method embodiment.

[0124] The map style file editing device disclosed in the embodiment of the present application obtains a map style file stored locally on a client; parses the map style file to obtain a data source, a feature category, and a rendering layer associated with each feature category configured in the map style file; wherein the data source is used to indicate a source of vector map data of a map; the rendering layer is a subdivided feature category of the feature category; through a tree control, the hierarchical index relationship of the data source, the feature category, and the rendering layer is displayed in a first interface area of ​​the client; in response to a first editing operation on the rendering layer corresponding to the branch node triggered by a branch node in the tree control, the corresponding file content of the rendering layer corresponding to the branch node in the map style file is displayed in a second interface area of ​​the client; in response to a modification confirmation operation on the corresponding file content displayed in the second interface area, the corresponding file content of the rendering layer corresponding to the branch node in the map style file is updated through the modified corresponding file content in the second interface area; in a third interface area of ​​the client, a map image rendered based on the updated map style file is displayed, thereby effectively improving the editing efficiency of the map style file.

[0125] In some embodiments of the present application, after the user clicks on a third-level branch node of the tree control, he can also choose to delete the layer through the pop-up function menu. The client will detect that the user has chosen to delete the layer operation on the currently selected rendering layer. Accordingly, the client will delete the corresponding branch node in the tree control and the corresponding file content in the map style file.

[0126] Through the map style file editing device disclosed in the embodiment of the present application, the configuration objects in the map style file are displayed based on the tree control index, and the user can conveniently select the configuration objects such as the rendering layer that needs to be configured, and quickly locate the style file content corresponding to each configuration object; then, by displaying the quickly located style file content, it is convenient for the user to directly modify the map style file; finally, after the map style file is modified, the rendering engine renders the map image based on the updated map style file, and the rendered map image is displayed in the client interface, thereby realizing real-time preview of the map display effect changes caused by the modification of the map style file, without the need to upload the map style data to the server and then download it to the client, shortening the development path of map style modification, and fully improving the efficiency of map style editing. On the other hand, by executing the map style editing tool, the regular matching method is used to directly locate the relevant file content from the map style file according to the rendering layer selected by the user, and the located file content is displayed in the editing interface, and the user does not need to manually search for the configuration code of the rendering layer in the lengthy map style file, which is not only efficient but also not prone to errors.

[0127] On the other hand, the map style file editing device disclosed in the embodiment of the present application displays the configuration objects in the map style file based on the tree control index, and combines check boxes in the tree control to obtain the user's selection and deselection status of the rendering layer through the check boxes, and sets the visibility and hiding properties of the layer object constructed in the rendering engine according to the selection result of the check box, thereby realizing visual control of the display and hiding of the rendering layer, and real-time preview of the effects of hiding and displaying one or more rendering layers, which helps to improve the editing efficiency of the map style file.

[0128] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0129] The above is a detailed introduction to a map style file editing method and device provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0130] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0131] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the electronic device according to the embodiment of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0132] For example, Figure 7 An electronic device that can implement the method according to the present application is shown. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer, etc. The electronic device traditionally includes a processor 710 and a memory 720 and a program code 730 stored on the memory 720 and can be run on the processor 710, and the processor 710 implements the method described in the above embodiment when executing the program code 730. The memory 720 can be a computer program product or a computer-readable medium. The memory 720 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 720 has a storage space 7201 for the program code 730 of the computer program for executing any method step in the above method. For example, the storage space 7201 for the program code 730 can include various computer programs for implementing the various steps in the above method respectively. The program code 730 is a computer-readable code. These computer programs can be read from one or more computer program products or written into the one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. The computer program includes a computer readable code, and when the computer readable code is executed on an electronic device, the electronic device is caused to execute the method according to the above embodiment.

[0133] The embodiment of the present application also discloses a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the map style file editing method described in the first embodiment of the present application are implemented.

[0134] Such a computer program product may be a computer-readable storage medium, which may have a computer-readable storage medium having a Figure 7 The memory 720 in the electronic device shown in the figure is similar to the storage segment, storage space, etc. The program code can be compressed and stored in the computer-readable storage medium in an appropriate form. The computer-readable storage medium is generally as shown in the reference Figure 8 The portable or fixed storage unit. Generally, the storage unit includes computer readable code 730', which is a code read by a processor. When the code is executed by the processor, each step in the method described above is implemented.

[0135] The term "one embodiment", "embodiment" or "one or more embodiments" herein means that a particular feature, structure or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present application. In addition, please note that the examples of the term "in one embodiment" here do not necessarily all refer to the same embodiment.

[0136] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0137] In the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 application.

Claims

1. A method for editing a map style file, characterized in that: include: Get the map style file stored locally on the client; Parsing the map style file to obtain the data source, feature category, and rendering layer associated with each feature category configured in the map style file; Displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control; In response to triggering a first editing operation on the rendering layer corresponding to the branch node through the branch node in the tree control, displaying corresponding file content of the rendering layer corresponding to the branch node in the map style file in the second interface area of ​​the client; In response to a modification confirmation operation on the corresponding file content displayed in the second interface area, updating the corresponding file content of the rendering layer corresponding to the branch node in the map style file through the modified corresponding file content in the second interface area; In the third interface area of ​​the client, a map image rendered based on the updated map style file is displayed.

2. The method according to claim 1, characterized in that: The step of displaying the hierarchical index relationship of the data source, the feature category, and the rendering layer in the first interface area of ​​the client through a tree control includes: According to each of the data sources, construct first-level branch nodes of the root node of the tree control respectively, each of the first-level branch nodes corresponds to one of the data sources; For each of the first-level branch nodes, construct a second-level branch node of the first-level branch node according to each feature category included in the data source corresponding to the first-level branch node, each of the second-level branch nodes corresponds to one feature category; For each of the second-level branch nodes, according to each rendering layer associated with the feature category corresponding to the second-level branch node, a third-level branch node of the second-level branch node is constructed respectively, and each of the third-level branch nodes corresponds to one of the rendering layers; The tree control is displayed in the first interface area of ​​the client.

3. The method according to claim 2, characterized in that In response to triggering a first editing operation on the rendering layer corresponding to the branch node through the branch node in the tree control, the step of displaying the corresponding file content of the rendering layer corresponding to the branch node in the map style file in the second interface area of ​​the client comprises: In response to a user triggering a first editing operation on the rendering layer corresponding to the branch node through a branch node in the tree control displayed, determining a rendering layer identifier in the map style file that matches the rendering layer targeted by the first editing operation; Determine, according to the position of the rendering layer identifier in the map style file, the corresponding file content of the rendering layer corresponding to the branch node in the map style file; The determined corresponding file content is displayed in the second interface area of ​​the client.

4. The method according to claim 3, characterized in that The step of determining the corresponding file content of the rendering layer corresponding to the branch node in the map style file according to the position of the rendering layer identifier in the map style file comprises: The file content between the nearest unpaired left bracket before the position and the nearest unpaired right bracket after the position in the map style file is determined as the corresponding file content of the rendering layer targeted by the first editing operation in the map style file.

5. The method according to claim 2, characterized in that: After the step of displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control, the method further includes: In response to the user triggering a second editing operation of adding a front layer or a back layer to the rendering layer corresponding to the branch node through a branch node in the tree control, a branch node corresponding to the front layer or the back layer is added to the tree control; Determine a rendering layer identifier in the map style file that matches the rendering layer targeted by the second editing operation; Determine, according to the position of the rendering layer identifier in the map style file, the corresponding file content of the rendering layer corresponding to the branch node in the map style file; Copy the corresponding file content of the rendering layer corresponding to the branch node in the map style file to obtain a copy data block; The rendering layer identifier in the copy data block is modified to the identifier of the added front layer or the back layer, and the modified copy data block is inserted into the map style file.

6. The method according to claim 2, characterized in that After the step of displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control, the method further includes: In response to a user triggering a deletion operation on the rendering layer corresponding to the branch node through a branch node in the tree control, the corresponding branch node in the tree control and the corresponding file content of the rendering layer corresponding to the branch node targeted by the deletion operation in the map style file are deleted; wherein the corresponding file content of the rendering layer corresponding to the branch node targeted by the deletion operation in the map style file is determined by the following method: In the map style file, determining the location of the rendering layer identifier that matches the rendering layer corresponding to the branch node targeted by the deletion operation; The file content between the nearest unpaired left bracket before the position and the nearest unpaired right bracket after the position in the map style file is determined as the corresponding file content in the map style file of the rendering layer corresponding to the branch node targeted by the deletion operation.

7. The method according to claim 2, characterized in that The tree control includes a check box, the map image is rendered by a preset rendering engine, and the preset rendering engine parses the map style file before rendering the map image to construct a layer object, and the layer object includes a visible or invisible attribute for indicating whether to render the corresponding rendering layer; After the step of displaying the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control, the method further includes: In response to a user triggering a selection operation on the rendering layer corresponding to the corresponding branch node by checking a check box in the tree control, determining the branch node operated by the selection operation and the node selection state; According to the branch node operated by the selection operation and the node selection status, the visibility and hiding properties of the layer object associated with the rendering layer corresponding to the branch node operated are set, and the preset rendering engine rendering is triggered to perform map rendering based on the modified visibility and hiding properties to obtain a map image showing part or all of the rendering layer.

8. A map style file editing device, characterized in that: include: A map style file acquisition module is used to acquire the map style file stored locally on the client; A map style file parsing module, used to parse the map style file, obtain the data source, feature category, and rendering layer associated with each feature category configured in the map style file; A rendering layer tree display module, used to display the data source, the feature category, and the hierarchical index relationship of the rendering layer in the first interface area of ​​the client through a tree control; A first layer style editing module, configured to display corresponding file contents of the rendering layer corresponding to the branch node in the map style file in a second interface area of ​​the client in response to triggering a first editing operation on the rendering layer corresponding to the branch node through the branch node in the tree control; A first map style file updating module, configured to respond to a modification confirmation operation on the corresponding file content displayed in the second interface area, and update the corresponding file content of the rendering layer corresponding to the branch node in the map style file through the corresponding file content modified in the second interface area; A map rendering and display module is used to display a map image rendered based on the updated map style file in the third interface area of ​​the client.

9. An electronic device comprising a memory, a processor, and a program code stored in the memory and executable on the processor, characterized in that: When the processor executes the program code, the map style file editing method described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having program code stored thereon, characterized in that: When the program code is executed by a processor, the steps of the map style file editing method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Quickly configurable and real time rendering safety protection three-dimensional electronic map

    CN101286240A

  • Map service publishing method and device

    CN109947882A