A method for generating a texture image on a map, a terminal device and related storage medium
By setting an intermediate connection layer between the C++ layer and the JS language layer, the mapping relationship between texture map resource identification and resource path is cached, and the problem that traditional map texture generation methods require overall update software is solved, and dynamic update and loading of map textures is realized, which improves generation and loading efficiency.
Patent Information
- Application Number
- CN201910395529.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-13
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2039-05-13
AI Technical Summary
Traditional map texture generation methods require overall update software, which leads to inconvenience of users and cannot realize dynamic update of map textures.
By setting an intermediate connection layer between the C++ layer and the JS language layer, the interaction between C++ and JS language is realized, the mapping relationship between texture map resource identification and resource paths is cached, and texture map resources are dynamically loaded and updated.
Dynamic update and loading of texture maps is realized, improving the generation efficiency and loading speed of texture maps on the map, and reducing inconvenience to users.
Smart Images

Figure CN112015959B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of map technology, and in particular to a method for generating a texture image on a map, a terminal device and a related storage medium. Background Art
[0002] With the development of computer, network, multimedia and aerospace technology, electronic devices with computers as the main body are widely used in the field of electronic maps. Maps are no longer limited to symbols and graphics expressed on paper (or similar media). They can be stored in digital form on magnetic media or displayed on the screen after visualization.
[0003] The electronic map contains many elements, such as bubbles or icons floating on the map, etc. Figure 1 As shown, these floating bubbles or icons are usually called map textures. The traditional solution is to use native language (a language provided by the mobile system platform) on the client (such as Android and IOS) to perform Extensible Markup Language (XML) layout, and then use the map rendering engine to draw the map texture on the map surface.
[0004] Traditional methods of generating map textures are all based on native languages. Even if only part of the texture on the map needs to be updated, the corresponding version of the software application (Application, App) data package needs to be released. Users need to download new APP data packages to perform replacement updates through software updates, which causes great inconvenience to users. Moreover, this method cannot achieve dynamic updates of map textures, and cannot achieve targeted updates of part of the texture data that needs to be updated. Therefore, the data update of map textures is inconvenient. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide a method for generating a texture image on a map, a terminal device and related storage media that overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, an embodiment of the present invention provides a method for generating a texture map on a map, comprising:
[0007] The C++ layer requests the JS language layer to generate the style file data of the texture map through the intermediate connection layer;
[0008] The JS language layer determines the texture map resources required to generate the texture map in response to the request, and provides the style file data including the texture map resource identifier to the C++ layer; the texture map resources include the layout style file and the content elements in the texture map;
[0009] The intermediate connection layer determines the resource path corresponding to the texture map resource identifier according to the texture map resource identifier included in the style file data provided by the C++ layer and according to the pre-cached mapping relationship;
[0010] The map client obtains the layout style file and the content elements in the texture map according to the resource path, loads the corresponding content elements in the layout style file, obtains the binary data of the texture map, and returns it to the C++ layer.
[0011] In an optional embodiment, the JS language layer determines the texture map resources required to generate the texture map in response to the request, including: the JS language layer determines the corresponding layout style file based on the layout style file identifier of the texture map requested by the C++ layer, and obtains the content elements included in the layout file.
[0012] In an optional embodiment, corresponding content elements are loaded in the layout style file to obtain binary data of the texture map, including: determining the display position of each content element in the texture map according to the layout information included in the layout style file, loading the content element to the corresponding position in the layout style file according to the display position to obtain texture map bitmap data, and converting the texture map bitmap data into binary data to obtain binary data of the texture map.
[0013] In an optional embodiment, the method further includes: a C++ layer storing binary data of the texture map; and
[0014] When a texture map needs to be displayed to the user, the binary data of the corresponding texture map is obtained according to the texture map resource identifier to be displayed, and the obtained binary data of the texture map is rendered by the map engine to render the texture map onto the map surface.
[0015] In an optional embodiment, it also includes:
[0016] The JS language layer establishes a mapping relationship between the layout style file identifier and the storage path and a mapping relationship between the content element identifier and the storage path according to the storage location of the layout style file and the content elements in the texture map, obtains the mapping relationship between the texture map resource identifier and the resource path, and transmits it to the intermediate connection layer for caching through the JS engine.
[0017] In a second aspect, an embodiment of the present invention provides a terminal device, including:
[0018] The C++ module is used to request the JS language module to generate the style file data of the texture map through the intermediate connection module;
[0019] A JS language module is used to determine the texture map resources required to generate the texture map in response to the request, and provide style file data including the texture map resource identifier to the C++ module; the texture map resources include a layout style file and content elements in the texture map;
[0020] The intermediate connection module is used to determine the resource path corresponding to the texture map resource identifier according to the texture map resource identifier included in the style file data provided by the C++ module and according to the pre-cached mapping relationship;
[0021] The map client is used to obtain the layout style file and the content elements in the texture map according to the resource path, load the corresponding content elements in the layout style file, obtain the binary data of the texture map, and return it to the C++ module.
[0022] In an optional embodiment, the JS language module is specifically used to: determine the corresponding layout style file according to the layout style file identifier of the texture image requested by the C++ module, and obtain the content elements included in the layout file.
[0023] In an optional embodiment, the map client is specifically used to: determine the display position of each content element in the texture map according to the layout information included in the layout style file, load the content element to the corresponding position in the layout style file according to the display position, obtain texture map bitmap data, convert the texture map bitmap data into binary data, and obtain binary data of the texture map.
[0024] In an optional embodiment, it also includes: a map engine; the C++ module is also used to store binary data of the texture map; and when the texture map needs to be displayed to the user, the binary data of the corresponding texture map is obtained according to the texture map resource identifier to be displayed, and provided to the map engine; the map engine is used to render the acquired binary data of the texture map, and render the texture map onto the map surface.
[0025] In an optional embodiment, the JS language module is also used to: establish a mapping relationship between a layout style file identifier and a storage path and a mapping relationship between a content element identifier and a storage path according to the storage locations of the layout style file and the content elements in the texture map, obtain a mapping relationship between a texture map resource identifier and a resource path, and transmit it to the intermediate connection layer through the JS engine; accordingly, the intermediate connection layer is also used to cache the mapping relationship between the texture map resource identifier and the resource path.
[0026] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-mentioned method for generating a texture image on a map.
[0027] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:
[0028] By setting an intermediate connection layer between the C++ layer and the JS language layer, the interaction between the C++ language and the JS (JavaScript) language is realized. The mapping relationship between the texture map resource identifier and the resource path is pre-cached through the intermediate connection layer. When the texture map needs to be generated, the intermediate connection layer can determine the resource path corresponding to the texture map resource identifier according to the texture map resource identifier included in the style file data provided by the C++ layer, according to the pre-cached mapping relationship, call the texture map resource required to generate the texture map according to the path, and load the corresponding resource to generate the bitmap of the texture map. This method realizes the generation of the texture map through information interaction between the C++ layer and the JS language layer, and can operate on the texture map to be generated. When the texture map is updated, only the texture map resource generated by the JS language layer needs to be updated, and the map software does not need to be updated as a whole, so the dynamic update of the texture map can be realized; and the bitmap of the texture map is converted into binary data for caching for use in map engine rendering, which can realize the dynamic loading of the texture map. This method greatly improves the generation efficiency and loading speed of the texture map on the map.
[0029] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0030] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0032] Figure 1 It is a schematic diagram of a texture map on a map in the prior art;
[0033] Figure 2 A schematic diagram of threads between various modules of a terminal device in an embodiment of the present invention;
[0034] Figure 3 Schematic diagram of the process of generating a texture map on a map in the first embodiment of the present invention;
[0035] Figure 4 This is a schematic diagram of a layout style file in Embodiment 1 of the present invention;
[0036] Figure 5It is a schematic flow chart of an example of a method for generating a texture image on a map in the second embodiment of the present invention;
[0037] Figure 6 This is a schematic diagram of an example of a layout style file in the second embodiment of the present invention;
[0038] Figure 7 4 is a structural diagram of a terminal device in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0040] Embodiment 1
[0041] Embodiment 1 of the present invention provides a method for generating a texture map on a map. The method uses JS language to generate the layout style required by the business, connects the map client and the map engine through the intermediate connection layer, and connects the C++ layer and the JS language layer. The method is implemented by information interaction between the C++ layer, the JS language layer, the intermediate connection layer, the JS engine and the map client. When generating the texture map to be displayed on the map, the thread reference between each module Figure 2 As shown, Figure 2 AJX is the JS language layer in the embodiment of the present invention, JS BL is the middle connection layer, Eyire is the C++ layer, Client (Android / IOS) is the map client, and JSEngine is the JS engine. Action1 is the behavior of establishing the mapping relationship between the texture map resource identifier and the resource path, Action2 is the behavior of generating the texture map on the map, and ajx.business.set (INIT_TEXTURE, jsonStr) is the layout style file.
[0042] The implementation process of this method refers to Figure 3 As shown, the following steps are included:
[0043] S301. The C++ layer requests the JS language layer to generate style file data of the texture map through the intermediate connection layer.
[0044] The present invention is implemented using a dynamic type language (JS language) and C++ language. When a map client needs to display a texture map, the C++ layer will request the JS language layer to generate the style file data of the texture map according to the layout style of the texture map and the content in the texture map. The requested style file data is the texture map resource required to generate the texture map. The request sent by the C++ layer is passed to the JS language layer through the intermediate connection layer. The transmission method can be, for example, transparent transmission (a transmission method that does not make any changes to the transmission content), which is not limited in the embodiments of the present invention.
[0045] S302. The JS language layer determines the texture map resources required to generate the texture map in response to the request of the C++ layer, and provides the style file data including the texture map resource identifier to the C++ layer.
[0046] After receiving the request for the style file data for generating the texture map sent by the C++ layer, the JS language layer determines the texture map resources required to generate the texture map in response to the request of the C++ layer, based on the layout style and content of the texture map to be displayed. The texture map resources include the layout style file and the content elements in the texture map. It should be noted that the JS language layer determines what data is required to generate the texture map resources in response to the request of the C++ layer, and provides the determined information to the C++ layer. Specifically, the JS language layer provides the style file data including the texture map resource identifier to the C++ layer, that is, provides the layout style file identifier and the content element identifier in the texture map to the C++ layer.
[0047] The JS language layer transmits the style file data identified by the texture map resource to the C++ layer through the JS engine and the intermediate connection layer. The transmission method can be transparent transmission, for example, which is not limited in the embodiment of the present invention. The JS engine can convert the format of the texture map resource generated by the JS language layer into a format that can be recognized by the map client, and then transmit it to the intermediate connection layer cache so that the client can directly use it when the texture map bitmap data is subsequently generated.
[0048] Map Client Reference Figure 2The Client shown in the figure can be a Native APP. A Native App is a third-party application written and run in a native language based on a local operating system of a smartphone (such as IOS, Android, and Windows Phone, etc.). The native language is the programming language used when developing native applications. For example, for an IOS system, the native language can be OC (Objective C) language; for an Android system, the native language can be C language, C++ language, JAVA language, etc. Regardless of whether the native language is OC / C / C++ language or JAVA language, they are all statically typed languages. Native applications are developed using statically typed languages, and it is inevitable that new versions will be released along with updated content. For the texture display on the map, when the content of the texture map needs to be updated, it is obviously not desirable to update the entire native application. It is more in line with the requirements for texture map generation and update to only generate and update the display content of the texture map involved.
[0049] S303: The intermediate connection layer determines a resource path corresponding to the texture resource identifier according to the texture resource identifier included in the style file data provided by the C++ layer and according to a pre-cached mapping relationship.
[0050] The intermediate connection layer (i.e. Figure 2 The JS BL in the C++ layer is the intermediary layer for the interaction between the C++ layer and the JS language layer. In addition to providing a data call channel for the JS language layer and the C++ layer, it also caches the mapping relationship between the texture resource identifier and the resource path pre-established by the JS language layer. Figure 2 As shown, the Hashmap of JS BL caches the mapping relationship between resource path and resource ID, that is, the mapping relationship between the texture resource identifier and resource path. Figure 2 After AJX establishes the mapping relationship, it generates data in the jsonStr data format (ajx.business.set(INT_TEXTURE,jsonStr)) and sends it to the JS engine. A str object (set(int.cmd, string str)) can be defined by the JS engine to implement the caching of the mapping relationship. For the process of establishing the above mapping relationship, please refer to the following embodiment 2, which will not be described in detail here.
[0051] The C++ layer receives the texture resource identifier (i.e. Figure 2After loadTextureData in the map, the texture resource identifier is provided to the intermediate connection layer, which determines the storage path of the texture resource based on the texture resource identifier and the pre-cached mapping relationship, and provides the storage path of the texture resource to the map client.
[0052] Since the map client cannot directly recognize file data in JS format, before obtaining the content elements in the layout style file and the texture map, the map client needs to use the JS engine to convert the format of the content element data in the layout style file and the texture map into a format that the local map client can recognize, such as bitmap data, etc. The embodiment of the present invention is not limited to this.
[0053] The JS engine provides a statement interpreter and runtime environment for the JS language, and converts the JS language into a language that the terminal device can recognize. For example, for a JS language "vart=0", the JS engine provides a runtime environment when the JS language is running, and converts the JS language into code that the machine can recognize. For the Android system, a common JS engine may be, for example, the V8 engine; for the IOS system, a common JS engine may be, for example, the JScord engine.
[0054] S304: The map client obtains the layout style file and the content elements in the texture map according to the resource path, loads the corresponding content elements in the layout style file, obtains the binary data of the texture map, and returns it to the C++ layer.
[0055] Reference Figure 2 , the C++ layer sends the style file data (loadTextureData) to the middle connection layer, the middle connection layer looks up the resource path corresponding to the resource ID in the mapping relationship (HashMap), and passes it to the map client for resource data loading (loadimageData), the map client loads the style file data processed by the JS engine, and obtains the recognizable layout style file and content elements in the texture map. Figure 4 As shown, the layout style file includes layout information about content elements, and the display position of each content element in the texture map is determined according to the layout information. The content elements can be, for example, text, pictures, traffic signs, etc. For example, the layout information can include the position and size of each graphic such as an ellipse, a square, a five-pointed star, and whether there is text in each graphic, which text it is and how big it is, etc. The layout style file loads the content elements at the corresponding position to obtain the texture map bitmap data. Since the bitmap data cannot be directly used by the map engine, the map client is also required to convert the texture map bitmap data into binary data (such as byte stream) and return it to the C++ layer.
[0056] The method for generating map textures provided by the embodiment of the present invention realizes the interaction between C++ language and JS (JavaScript) language by setting an intermediate connection layer between the C++ layer and the JS language layer. The mapping relationship between the texture map resource identifier and the resource path is cached by the intermediate connection layer. When it is necessary to generate a texture map, the intermediate connection layer can determine the resource path corresponding to the texture map resource identifier according to the texture map resource identifier included in the style file data provided by the C++ layer and the pre-cached mapping relationship, call the texture map resources required to generate the texture map according to the path, and load the corresponding resources to generate a bitmap of the texture map. This method realizes the generation of the texture map through information interaction between the C++ layer and the JS language layer, and can operate on the texture map to be generated. When the texture map is updated, only the texture map resources generated by the JS language layer need to be updated, and there is no need to update the map software as a whole, so the dynamic update of the texture map can be realized.
[0057] Embodiment 2
[0058] Embodiment 2 of the present invention takes the generation of a paragraph of text on a texture map as an example to illustrate the method for generating a texture map on the map. Figure 5 As shown, the process includes the following steps:
[0059] S501. The JS language layer establishes a mapping relationship between a texture map resource identifier and a resource path, and provides the mapping relationship to the intermediate connection layer for caching.
[0060] The JS language layer establishes a mapping relationship between the layout style file identifier and the storage path and a mapping relationship between the content element identifier and the storage path according to the storage location of the layout style file and the content element in the texture map, obtains a mapping relationship between the texture map resource identifier and the resource path, and transmits it to the intermediate connection layer for caching through the JS engine. The mapping relationship can be shown in the following Table 1, for example:
[0061] Table 1
[0062] Resource Identifier Resource Name Resource Path a Style file 1 Path 1 b Content Element 1 Path 2 c Content Element 2 Path 3
[0063] The above mapping relationship is agreed upon in advance by the JS language layer and the C++ layer. They share a set of protocols. For example, the ID of the agreed picture can be 1000, or an incoming parameter value can be agreed upon, or "text = generate texture map" can be agreed upon. The embodiment of the present invention does not limit this. This way of pre-establishing the mapping relationship enables the C++ layer to call the mapping relationship cached in the intermediate connection layer at any time, saving data processing time and greatly improving the efficiency of generating texture maps on the map.
[0064] S502 , the C++ layer requests the JS language layer to generate style file data of the texture map through the intermediate connection layer.
[0065] Since the texture data on the map will eventually be transmitted to the map engine through the C++ layer to complete the drawing of the texture map, therefore, at the beginning of generating the texture map, it is necessary for the C++ layer to initiate a request to generate the texture map style file data. In the second embodiment, the request to generate the texture map style file is a request to generate a paragraph of text on the texture map.
[0066] Specifically, the request refers to generating a layout style file identifier for a paragraph of text on a texture image. In layman's terms, the layout style file can be, for example, the arrangement of a paragraph of text on a texture image, the line spacing, the character spacing, the paragraph spacing, etc.
[0067] For example, the content element identifier can be the specific content, font color, font size, etc. of a piece of text on the texture image.
[0068] S503. The JS language layer determines the corresponding layout style file according to the layout style file identifier of the texture image requested by the C++ layer, and obtains the content elements included in the layout file.
[0069] After the above step S502, the JS language layer will obtain the request sent by the C++ layer to generate a texture style file. According to the mapping relationship pre-established between the JS language layer and the C++ layer, the JS language layer can determine the layout style file corresponding to the above request.
[0070] Taking Table 1 above as an example, assuming that the request obtained by the JS language layer contains the identifier a of style file 1, and style file 1 contains content element 1 and content element 2, then at this time, the JS language layer needs to further determine the identifiers of content element 1 and content element 2. According to the mapping relationship established in Table 1, the identifiers of content element 1 and content element 2 can be determined to be b and c. At this point, the JS language layer has completed the process of determining the texture map resources required to generate the texture map.
[0071] S504: Provide the style file data including the texture resource identifier to the C++ layer through the JS engine and the intermediate connection layer.
[0072] The above step S503 completes the process of determining the texture resources required for generating the texture map. The style file data of the determined texture resource identifiers, ie, the style file data of identifiers a, b, and c, needs to be transmitted to the C++ layer.
[0073] When the style file data with the above identifiers a, b, and c is transmitted, it needs to pass through the JS engine and the intermediate connection layer, but at this time the JS engine and the intermediate connection layer do not process the style file data with the above identifiers a, b, and c, and pass it through to the C++ layer. The C++ layer provides the acquired style file data with the above identifiers a, b, and c to the intermediate connection layer again to find the cached mapping relationship, that is, the following step S505.
[0074] S505: The intermediate connection layer determines a resource path corresponding to the texture resource identifier according to the texture resource identifier included in the style file data provided by the C++ layer and according to a pre-cached mapping relationship.
[0075] The mapping relationship cached in the intermediate connection layer is the mapping relationship pre-established in the above step S501. Taking the above Table 1 as an example, the resource path corresponding to the mapping relationship in the cache is searched according to the identifiers a, b, and c of the style file data to obtain path 1, path 2, and path 3.
[0076] S506: Convert the format of the layout style file and the content element data in the texture map into a format that can be recognized by the map client through the JS engine.
[0077] Before the map client loads the layout style file and the content element data in the texture map according to the resource path determined in step S505, the intermediate connection layer needs to call the JS engine to convert the format of the layout style file and the content element data in the texture map into a format that can be recognized by the local map client. The JS engine can be, for example, a V8 engine or a JScord engine, which is not limited in the embodiment of the present invention.
[0078] Since there are many types of map clients, such as mobile client (Android system), mobile client (IOS system), or mobile client (WP system), the embodiment of the present invention does not limit this. Each client uses a different system, so the data formats that can be recognized by map clients based on different systems are also different.
[0079] S507. The map client obtains the layout style file and the content elements in the texture map according to the resource path, loads the content elements into the corresponding positions in the layout style file, obtains the texture map bitmap data, converts the texture map bitmap data into binary data, obtains the binary data of the texture map, and returns it to the C++ layer.
[0080] Reference Figure 6The layout style file shown contains content element 1, content element 2 and content element 3. Content element 1 is "Parking lot (Douban Hutong)", content element 2 is "824 meters away | There are few parking spaces on the roadside Douban Hutong", and content element 3 is the parking lot sign. After the map client obtains the layout style file 1 and the paths of content element 1, content element 2 and content element 3, it loads them and obtains the following Figure 6 The texture bitmap data shown.
[0081] At the same time, the obtained texture map bitmap data needs to be converted into binary data, and finally the binary data of the texture map is obtained. The binary data generates the content data contained in the texture map and returns it to the C++ layer.
[0082] Preferably, the method for generating a texture image on a map may further include the following steps:
[0083] S508. The C++ layer stores binary data of the texture image.
[0084] The C++ layer stores the binary data of the texture map to facilitate the map engine to render the binary data of the texture map.
[0085] S509: When a texture map needs to be displayed to the user, the binary data of the corresponding texture map is obtained according to the resource identifier of the texture map to be displayed, and the obtained binary data of the texture map is rendered by the map engine to render the texture map onto the map surface.
[0086] The method for generating a texture map on a map provided by an embodiment of the present invention realizes the interaction between the C++ language and the JS (JavaScript) language by setting an intermediate connection layer between the C++ layer and the JS language layer. The mapping relationship between the texture map resource identifier and the resource path is cached by the intermediate connection layer. When the texture map needs to be generated, the intermediate connection layer can determine the resource path corresponding to the texture map resource identifier according to the texture map resource identifier included in the style file data provided by the C++ layer and the pre-cached mapping relationship, call the texture map resource required to generate the texture map according to the path, and load the corresponding resource to generate the bitmap of the texture map. This method realizes the generation of the texture map through information interaction between the C++ layer and the JS language layer, and can operate on the texture map to be generated. When the texture map is updated, only the texture map resource generated by the JS language layer needs to be updated, and the map software does not need to be updated as a whole, so the dynamic update of the texture map can be realized; and the bitmap of the texture map is converted into binary data for caching for use in map engine rendering, so that the dynamic loading of the texture map can be realized. This method greatly improves the generation efficiency and loading speed of the texture map on the map.
[0087] Based on the same inventive concept, an embodiment of the present invention further provides a terminal device. Since the principle of the problem solved by the terminal device is similar to the method for generating the texture map on the aforementioned map, the implementation of the terminal device can refer to the implementation of the aforementioned method, and the repeated parts will not be repeated.
[0088] Reference Figure 7 As shown, an embodiment of the present invention further provides a terminal device, including:
[0089] The C++ module 71 is used to request the JS language module 72 to generate the style file data of the texture map through the intermediate connection module;
[0090] The JS language module 72 is used to determine the texture map resources required to generate the texture map in response to the request, and provide the style file data including the texture map resource identifier to the C++ module 71 through the JS engine 73 and the intermediate connection module 74; the texture map resources include the layout style file and the content elements in the texture map;
[0091] The intermediate connection module 74 is used to determine the resource path corresponding to the texture resource identifier according to the texture resource identifier included in the style file data provided by the C++ module 71 and according to the pre-cached mapping relationship;
[0092] The map client 75 is used to obtain the layout style file and the content elements in the texture map according to the resource path, load the corresponding content elements in the layout style file, obtain the binary data of the texture map, and return it to the C++ module 71.
[0093] In an optional embodiment, the JS language module 72 is specifically used to: determine the corresponding layout style file according to the layout style file identifier of the texture image requested by the C++ module 71, and obtain the content elements included in the layout file.
[0094] In an optional embodiment, the map client 75 is specifically used to: determine the display position of each content element in the texture map according to the layout information included in the layout style file, load the content element to the corresponding position in the layout style file according to the display position, obtain texture map bitmap data, convert the texture map bitmap data into binary data, and obtain binary data of the texture map.
[0095] In an optional embodiment, it also includes: a map engine 76; the C++ module 71 is also used to store binary data of the texture map; and when the texture map needs to be displayed to the user, the binary data of the corresponding texture map is obtained according to the texture map resource identifier to be displayed, and provided to the map engine 76; the map engine 76 is used to render the acquired binary data of the texture map, and render the texture map onto the map surface.
[0096] In an optional embodiment, the JS language module 72 is also used to establish a mapping relationship between a layout style file identifier and a storage path and a mapping relationship between a content element identifier and a storage path according to the storage locations of the layout style file and the content elements in the texture map, obtain a mapping relationship between a texture map resource identifier and a resource path, and transmit it to the intermediate connection module 74 through the JS engine; correspondingly, the intermediate connection module 74 is also used to cache the mapping relationship between the texture map resource identifier and the resource path.
[0097] The embodiment of the present invention further provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the above-mentioned method for generating a texture image on a map is implemented.
[0098] Regarding the terminal device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0099] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0100] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0103] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for generating a texture map on a map, characterized in that: include: The C++ layer requests the JS language layer to generate the style file data of the texture map through the intermediate connection layer; The JS language layer determines the texture map resources required to generate the texture map in response to the request, and provides the style file data including the texture map resource identifier to the C++ layer; the texture map resources include the layout style file and the content elements in the texture map; The intermediate connection layer determines the resource path corresponding to the texture map resource identifier according to the texture map resource identifier included in the style file data provided by the C++ layer and the mapping relationship between the pre-cached texture map resource identifier and the resource path; The map client obtains the layout style file and content elements in the texture map processed by the JS engine according to the resource path, loads the corresponding content elements in the layout style file, obtains the binary data of the texture map, and returns it to the C++ layer; wherein the JS engine is used to convert the format of the content element data in the layout style file and the texture map into a format that can be recognized by the map client.
2. The method according to claim 1, characterized in that The JS language layer determines, in response to the request, a texture map resource required to generate the texture map, including: The JS language layer determines the corresponding layout style file according to the layout style file identifier of the texture image requested by the C++ layer, and obtains the content elements included in the layout style file.
3. The method according to claim 1, characterized in that Load the corresponding content element in the layout style file to obtain binary data of the texture map, including: According to the layout information included in the layout style file, the display position of each content element in the texture map is determined, and according to the display position, the content element is loaded into the corresponding position in the layout style file to obtain texture map bitmap data, and the texture map bitmap data is converted into binary data to obtain binary data of the texture map.
4. The method according to claim 1, characterized in that Also includes: The C++ layer stores the binary data of the texture map; as well as When a texture map needs to be displayed to the user, the binary data of the corresponding texture map is obtained according to the texture map resource identifier to be displayed, and the obtained binary data of the texture map is rendered by the map engine to render the texture map onto the map surface.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: The JS language layer establishes a mapping relationship between the layout style file identifier and the storage path and a mapping relationship between the content element identifier and the storage path according to the storage location of the layout style file and the content elements in the texture map, obtains the mapping relationship between the texture map resource identifier and the resource path, and transmits it to the intermediate connection layer for caching through the JS engine.
6. A terminal device, characterized in that: include: The C++ module is used to request the JS language module to generate the style file data of the texture map through the intermediate connection module; A JS language module is used to determine the texture map resources required to generate the texture map in response to the request, and provide style file data including the texture map resource identifier to the C++ module; the texture map resources include a layout style file and content elements in the texture map; The intermediate connection module is used to determine the resource path corresponding to the texture resource identifier according to the texture resource identifier included in the style file data provided by the C++ module and the mapping relationship between the pre-cached texture resource identifier and the resource path; The map client is used to obtain the content elements in the layout style file and texture map processed by the JS engine according to the resource path, load the corresponding content elements in the layout style file, obtain the binary data of the texture map, and return it to the C++ module; wherein the JS engine is used to convert the format of the content element data in the layout style file and the texture map into a format that can be recognized by the map client.
7. The terminal device according to claim 6, characterized in that: The JS language module is specifically used for: According to the layout style file identifier of the texture image requested by the C++ module, the corresponding layout style file is determined, and the content elements included in the layout style file are obtained.
8. The terminal device according to claim 6, characterized in that: The map client is specifically used for: According to the layout information included in the layout style file, the display position of each content element in the texture map is determined, and according to the display position, the content element is loaded into the corresponding position in the layout style file to obtain texture map bitmap data, and the texture map bitmap data is converted into binary data to obtain binary data of the texture map.
9. The terminal device according to claim 6, characterized in that: Also includes: Map Engine; The C++ module is also used to store binary data of the texture map; and when the texture map needs to be displayed to the user, the binary data of the corresponding texture map is obtained according to the resource identifier of the texture map to be displayed, and provided to the map engine; The map engine is used to render the acquired binary data of the texture map and render the texture map onto the map surface.
10. The terminal device according to any one of claims 6 to 9, characterized in that: JS language module, also used for: According to the storage locations of the layout style file and the content elements in the texture map, a mapping relationship between the layout style file identifier and the storage path and a mapping relationship between the content element identifier and the storage path are established, a mapping relationship between the texture map resource identifier and the resource path is obtained, and the mapping relationship is transmitted to the intermediate connection layer through the JS engine; accordingly, The intermediate connection layer is also used to cache the mapping relationship between the texture map resource identifier and the resource path.
11. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by the processor, the method for generating a texture image on a map as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Page construction method, apparatus and device, and storage medium
CN108804120A