General emergency rescue icon drawing method and device, equipment and medium
By constructing an interface adaptation layer and graphics primitive processing, the problems of map engine compatibility and coordinate positioning in emergency rescue were solved, enabling unified drawing and editing of icons under different map engines, thereby improving rescue efficiency and information response speed.
Patent Information
- Application Number
- CN202511477602.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-01-09
AI Technical Summary
Existing map engines suffer from poor compatibility with multiple engines, inaccurate coordinate positioning, and slow editing response in emergency rescue, resulting in low rescue efficiency and information lag.
An interface adaptation layer is constructed, pre-stores adaptation rule libraries and adapters for various map engines, and realizes unified drawing and editing of icons under different map engines through engine recognition, coordinate transformation and graphic primitive processing.
It achieves multi-engine compatibility, ensures accurate icon positioning, improves editing efficiency and response speed, reduces information lag, and enhances the overall efficiency of emergency rescue.
Smart Images

Figure CN121304831A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of icon drawing technology, and in particular to a method, apparatus, equipment and medium for drawing general emergency rescue icons. Background Technology
[0002] In digital emergency rescue operations, maps serve as the core carrier of on-site information and need to accurately and in real time present key elements such as the location of rescue teams, the boundaries of disaster-stricken areas, and material delivery points. Emergency rescue icon creation is a core aspect of map application in this field, directly affecting the efficiency and accuracy of rescue command and decision-making. Its technical implementation is closely related to map engine technology.
[0003] Current mainstream map engines, such as ArcGIS Engine, Cesium.js, and Google Maps API, each have unique functions and application scenarios, but lack a universal solution for drawing emergency rescue icons. This means that when developers need to implement emergency rescue icon drawing functionality on different map engines, they must perform separate development and adaptation work based on the characteristics and interface specifications of each engine. This repetitive development not only increases the cost and cycle of software development but also makes software maintenance and upgrades extremely complex, making it difficult to meet the rapid response needs of diverse map applications in the emergency rescue field.
[0004] Meanwhile, existing map engines have significant deficiencies in the real-time performance of emergency rescue icon operations. When rescue commanders drag, redraw, or pan icons that have been marked on the map, such as rescue team location markers, disaster area boundaries, or material delivery points, noticeable delays and lags often occur. This causes the icons on the map to fail to update in a timely manner, leading to deviations in the commanders' judgment of the situation on the ground, and ultimately causing the exercise to fail to achieve its intended objectives.
[0005] Furthermore, because different map engines use different coordinate systems by default, loading an emergency rescue icon labeled based on one coordinate system onto a map engine that uses another coordinate system can easily result in positional discrepancies. In actual rescue operations, such discrepancies can lead to the incorrect deployment of relief supplies or rescue teams heading to the wrong assembly points, severely impacting rescue efficiency and personnel safety. Summary of the Invention
[0006] Therefore, it is necessary to provide a universal emergency rescue icon drawing method, device, equipment, and medium that can solve the problems of poor multi-engine compatibility, inaccurate coordinate positioning, and slow editing response, in response to the above-mentioned technical issues.
[0007] A method for drawing general emergency rescue icons, the method comprising: Step 1: Construct an interface adaptation layer. The interface adaptation layer pre-stores the adaptation rule base corresponding to each map engine and the adapters bound to the corresponding adaptation rule base. Step 2: Identify the current map engine type to be used and output the map engine type identification result; Step 3: Convert the emergency rescue icons into graphic primitives with unified attribute descriptions; Step 4: Based on the map engine type identification results output in Step 2, select the adapter and adaptation rule base that match the current map engine from the interface adaptation layer constructed in Step 1. Step 5: Based on the map engine type identification result output in Step 2, match the default coordinate system of the current map engine, perform transformation calculations on the initial coordinates of the graphic primitives in Step 3, and output the transformed coordinates; Step 6: Perform structured processing on the graphical primitives obtained in Step 3 to form structured data; Step 7: Call the adapter selected in Step 4, combine the transformation coordinates output in Step 5 and the adaptation rule library in Step 1, convert the graphic primitives obtained in Step 3 into exclusive rendering instructions under the current map engine, and draw emergency rescue icons based on the exclusive rendering instructions. Step 8: When receiving an icon editing request, retrieve the structured data from Step 6 according to the editing operation type, update the attributes of the corresponding graphic primitive, then call the adapter selected in Step 4 and the transformation coordinates output in Step 5 to generate a new exclusive rendering instruction, and edit the emergency rescue icon based on the new exclusive rendering instruction.
[0008] A universal emergency rescue icon drawing device, the device comprising: An interface adaptation layer construction module is used to construct an interface adaptation layer, wherein the interface adaptation layer pre-stores the adaptation rule library corresponding to each map engine and the adapter bound to the adaptation rule library. The map engine type identification module is used to identify the current map engine type to be used and output the map engine type identification result; The graphic primitive conversion module is used to convert emergency rescue icons into graphic primitives with unified attribute descriptions. The selection module is used to select the adapter and adaptation rule base that match the current map engine from the interface adaptation layer based on the map engine type identification result. The coordinate transformation module is used to match the default coordinate system of the current map engine based on the map engine type identification result, perform transformation calculations on the initial coordinates of the graphic primitives, and output the transformed coordinates; The structured processing module is used to perform structured processing on graphical primitives to form structured data; The icon drawing module is used to call the selected adapter, combine the transformation coordinates and the adaptation rule library to convert the graphic primitives into exclusive rendering instructions under the current map engine, and draw emergency rescue icons based on the exclusive rendering instructions; The icon editing module is used to retrieve structured data according to the editing operation type when receiving an icon editing request, update the attributes of the corresponding graphic primitive, call the selected adapter and transformation coordinates, generate new exclusive rendering instructions, and edit the emergency rescue icon based on the new exclusive rendering instructions.
[0009] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the general emergency rescue icon drawing method.
[0010] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the general emergency rescue icon drawing method.
[0011] Compared with existing technologies, the universal emergency rescue icon drawing method, apparatus, equipment, and medium provided by this invention have the following beneficial effects: 1. By constructing an interface adaptation layer with a pre-stored adaptation rule base and bound adapters, and selecting the matching adapter based on the engine recognition results, it is possible to achieve one-time construction and multi-terminal adaptation for different map engines. There is no need to develop icon drawing logic separately for each engine. It is only necessary to call the corresponding built-in adapter through the interface adaptation layer to convert the unified graphic primitives into engine-specific rendering instructions. This reduces the difficulty of later maintenance and meets the needs of rapid switching and calling of maps across multiple platforms in the field of emergency rescue.
[0012] 2. By identifying the engine type and matching the default coordinate system, and performing coordinate transformation calculations, the system can automatically adapt to common coordinate systems in emergency rescue scenarios. Without the need for manual configuration of transformation parameters, the system can automatically match the default coordinate system and perform coordinate transformation based on the engine type, ensuring that the initial coordinates of the graphic primitives are completely aligned with the map engine coordinate system after transformation, thus guaranteeing the accuracy of rescue positioning.
[0013] 3. By converting emergency rescue icons into graphic primitives with unified attributes, icons across different engines are standardized and abstracted, effectively avoiding misjudgments by command personnel due to style differences of the same icon on different engines. At the same time, the graphic primitives are processed in a structured manner to form structured data, providing a basis for rapid retrieval and attribute updates for subsequent editing operations. When an editing request is received, it is not necessary to redraw the entire icon. Only the structured data needs to be retrieved to update the target attributes, and then the adapter is called to generate new rendering instructions. This achieves unified icon abstraction and structured management, improving cross-scene style consistency and editing efficiency.
[0014] 4. By logically connecting drawing and editing, the entire process of emergency rescue icons from generation to dynamic adjustment is adapted. The drawing stage ensures that the icons are clearly presented on the target engine, and the editing stage ensures that the icon attributes are updated synchronously with the on-site situation. The entire process does not require manual intervention for format conversion or parameter adjustment, allowing rescue commanders to focus on assessing the on-site situation rather than the icon operation itself. This shortens the time lag between situational changes and map icon updates, indirectly improving the overall efficiency of emergency rescue operations and reducing rescue risks caused by information lag. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention, and those skilled in the art can obtain other related drawings based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating the general emergency rescue icon drawing method provided in Example 1; Figure 2 This is a structural block diagram of the universal emergency rescue icon drawing device provided in Example 2; Figure 3 This is an internal structural diagram of the computer device provided in Example 3.
[0017] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0019] It is understood that the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0020] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0021] Example 1 like Figure 1 As shown, a general method for drawing emergency rescue icons is provided, including the following steps: Step 1: Construct an interface adaptation layer. The interface adaptation layer pre-stores the adaptation rule base corresponding to each map engine and the adapters bound to the corresponding adaptation rule base.
[0022] Step 2: Identify the current map engine type to be used and output the map engine type identification result.
[0023] Step 3: Convert the emergency rescue icon into a graphic primitive with a unified attribute description.
[0024] Step 4: Based on the map engine type identification results output in Step 2, select the adapter and adaptation rule library that match the current map engine from the interface adaptation layer constructed in Step 1.
[0025] Step 5: Based on the map engine type identification result output in Step 2, match the default coordinate system of the current map engine, perform transformation calculations on the initial coordinates of the graphic primitives in Step 3, and output the transformed coordinates.
[0026] Step 6: Perform structuring processing on the graphic primitives obtained in Step 3 to form structured data.
[0027] Step 7: Call the adapter selected in Step 4, combine the transformation coordinates output in Step 5 and the adaptation rule library in Step 1, convert the graphic primitives obtained in Step 3 into exclusive rendering instructions under the current map engine, and draw emergency rescue icons based on the exclusive rendering instructions.
[0028] Step 8: When receiving an icon editing request, retrieve the structured data from Step 6 according to the editing operation type, update the attributes of the corresponding graphic primitive, then call the adapter selected in Step 4 and the transformation coordinates output in Step 5 to generate a new exclusive rendering instruction, and edit the emergency rescue icon based on the new exclusive rendering instruction.
[0029] In the specific implementation of step 1, when building the interface adaptation layer, it is necessary to develop an adaptation rule library in advance for map engines commonly used in emergency rescue scenarios (such as ArcGIS Engine, Cesium.js, Google Maps API, Mapbox, etc.). The adaptation rule library contains the graphic object definition rules, API call format, rendering parameter requirements, etc. of the corresponding map engine. At the same time, a dedicated adapter is bound to each adaptation rule library. The adapter has built-in mapping logic between graphic primitives and corresponding map engine graphic objects (such as mapping polygon primitives to Cesium.js's PolygonGeometry object or ArcGIS Engine's IPolygon interface object) and instruction conversion algorithm.
[0030] It is understandable that the interface adaptation layer can serve as an intermediate layer connecting the unified graphics primitives and multiple map engines. By uniformly encapsulating and abstracting the interfaces of different map engines, the upper-layer drawing logic and editing functions can call the interfaces of different map engines in a unified manner, avoiding the need to repeatedly develop drawing logic for different engines, reducing cross-engine development costs, improving system adaptation flexibility, and achieving broad compatibility and efficient operation of the drawing solution on various map engines.
[0031] In the specific implementation of step 2, when identifying the type of map engine to be used, the identification operation is performed through the engine detection module built into the interface adaptation layer: First, it is determined whether the running environment is a web client, desktop client, or mobile client. Specifically, for the web client, a window object loading listening strategy is used to detect global object characteristics after the engine script has been loaded to avoid false judgments caused by the script not being fully loaded; for the desktop client, it is checked whether the target assembly has been referenced, and if not, it directly returns that the engine has not been loaded; for the mobile client, the integration status of the corresponding SDK is detected through the native API.
[0032] Based on the aforementioned detection strategy, detection is performed first for the Web client, and first for the desktop or mobile client, interface method feature detection is performed. If the detection is successful, the result verification is performed directly, and the map engine type recognition result is output.
[0033] If the initial detection fails (e.g., the engine's custom integration does not expose global objects), further resource file feature detection (e.g., engine-specific style files, icon resource paths) is performed. If multiple detections fail, a fault tolerance mechanism is triggered, prompting the user to manually select the map engine type and outputting the map engine type identification result. The number of detections is determined according to requirements; in this embodiment, it is three. If all three detections fail, the fault tolerance mechanism is triggered.
[0034] Furthermore, during the detection process, version consistency is verified. For example, after detecting a window.Cesium object, it is further verified whether Cesium.VERSION conforms to the mainstream version format to avoid forged global objects. Functionality availability is also verified. For example, after detecting ArcGIS Engine, an IMapControl2 instance is created and an empty map is loaded. If initialization is successful, the recognition result is confirmed to be valid.
[0035] Finally, the recognition results are cached locally (e.g., localStorage for web applications, configuration files for desktop applications, and SharedPreferences for mobile applications), with a validity period of 24 hours. Subsequent recognition calls directly read the cached results, avoiding duplicate detection and reducing processing time from 10ms to less than 1ms. This is particularly suitable for scenarios in emergency rescue systems where map engines are frequently switched.
[0036] It is understandable that step 2 enables automated identification of map engine types, providing accurate basis for subsequent adapter selection and coordinate transformation, reducing manual intervention and improving adaptation efficiency.
[0037] In the specific implementation of step 3, the emergency rescue icons are broken down into six basic geometric shapes: regular shapes, lines, text labels, icon textures, combined marks, and dynamic elements, covering the core visual elements of the rescue scene; among them, regular shapes include circles, rectangles, and triangles, and lines include straight lines, broken lines, and curves. See Table 1 for details.
[0038] Table 1. Basic Geometric Morphology Classification and Application Examples
[0039] Define a unified attribute parameter template for each type of basic geometric shape, and store the attribute parameter template in JSON format. The unified attributes include the geometric parameters, style parameters and scene parameters of the graphic primitive. The geometric parameters include initial coordinates, size and rotation angle, the style parameters include fill color, border color and transparency, and the scene parameters include application scene type and display priority.
[0040] Furthermore, when the emergency rescue icon is a complex icon, it is broken down into a basic layer, a functional layer, and a labeling layer according to visual logic. Each layer contains only a single type of basic geometric shape. For example, the basic layer uses a circle to represent the core area of the command point; the functional layer uses straight lines to represent the command coverage area and rectangles to represent the outline of the command tent; and the labeling layer uses text for text labeling.
[0041] Define the inter-layer association rules for the base layer, functional layer, and annotation layer, including positional association, size association, and style association. Specifically, in positional association, functional layer elements are positioned relative to base layer elements; in size association, the size of functional layer elements is proportional to the size of base layer elements; in style association, the color and transparency of elements across all layers of the same icon maintain a consistent style to avoid visual confusion. Through these inter-layer association rules, the relative positions, size ratios, and style of the basic geometric shapes in each layer are unified, and then the processed basic geometric shapes are converted into graphic primitives with unified attribute descriptions.
[0042] In addition, dynamic adaptation rules are set for complex icons based on the rendering characteristics of different map engines. According to the map engine type identification results output in step 2, all layer details and dynamic animation effects are preserved for vector map engines; non-core elements are simplified and the frequency of dynamic animations is reduced for tile map engines to ensure loading speed.
[0043] It is understandable that in step 3, abstracting emergency rescue icons into a series of graphic primitives with unified attribute descriptions avoids inconsistencies in icon styles due to engine differences, ensuring accurate recognition of icon information during rescue command. Regardless of the data structure and drawing method used by the map engine, the graphic primitives can be accurately rendered onto the map. When processing map engines based on vector data, the icon graphic primitives are converted into corresponding vector graphic instructions, utilizing the powerful graphic editing and scaling capabilities of the vector engine to achieve high-quality drawing of emergency rescue icons. For tile-based map engines, the icon graphic primitives are integrated with tile data, and through tile stitching and rendering, clear and complete emergency rescue icons are presented on the map. This not only ensures stable operation in various map engines but also lays a solid foundation for subsequent icon editing and interactive operations, fundamentally solving the problem of drawing compatibility between different map engines.
[0044] In the specific implementation of step 4, based on the map engine type identification result output in step 2, the interface adaptation layer retrieves entries matching the current engine from the pre-stored adaptation rule base and simultaneously calls the adapter bound to that entry. If the identification result is the cached result in step 2, the corresponding adapter and rule base are directly retrieved without repeated searching. After the adapter is loaded, the mapping logic between graphic primitives and engine graphic objects is automatically verified; if the verification fails, an error log is returned and a prompt to update the adaptation rule base is displayed.
[0045] It is understandable that step 4 ensures the accuracy of the conversion from graphics primitives to engine-specific instructions by precisely matching the adapter and rule base, providing core support for cross-engine rendering.
[0046] In the specific implementation of step 5, the default coordinate system of the current map engine is automatically matched according to the map engine type identification result in step 2; the reference coordinate system is set. In this embodiment, the WGS-84 coordinate system is used as the reference coordinate system. The preset coordinate system transformation formula library is retrieved, which includes transformation formulas such as GCJ-02 and WGS-84, BD-09 and WGS-84, etc. The specific formulas are added according to actual needs.
[0047] Perform transformation calculations on the initial coordinates of the graphic primitives in step 3. Calculate the deviation value between the transformed coordinates and the coordinates of the reference coordinate system using a preset deviation threshold. Determine whether the deviation value exceeds the preset deviation threshold. If it does, re-examine the transformation formula and perform the coordinate transformation again until the deviation value meets the deviation threshold requirement, and then output the transformed coordinates. If not, output the transformed coordinates directly.
[0048] Understandably, in this step, the current coordinate system can be automatically identified according to the type of map engine, and the emergency rescue icon can be quickly and losslessly converted between different coordinate systems. This ensures that the position of the icon on different map engines is always accurate, solves the problem of icon positioning deviation caused by the mixing of multiple coordinate systems, ensures that the position of the icon is consistent in different engines, and guarantees that key icons such as the location of rescue teams and material delivery points are accurately located in different engines, avoiding errors in the dispatch of rescue resources due to coordinate errors.
[0049] In the specific implementation of step 6, when performing structured processing on the graphic primitives obtained in step 3, a preset data structure is used to record the unified attributes of the graphic primitives, their relative positional relationship with the map, and their historical records under different operating states.
[0050] It's understandable that structured data provides a foundation for rapid retrieval and attribute tracking in subsequent icon editing. When icon editing is required, the system quickly retrieves and updates the corresponding attributes in the data structure based on the user's commands, and then uses a core algorithm to re-render the modified icon onto the map.
[0051] When modifying the color attribute of the relief supply point icon (e.g., green when supplies are plentiful, yellow when supplies are scarce), the system will find the corresponding color parameter in the data structure and update it, then redraw the icon based on the new color parameter. When performing a translation operation on the fire brigade icon, the data structure will record the new position information of the icon in real time, and then adjust the drawing position of the icon based on this information to ensure that the icon can move smoothly and accurately on the map; avoiding the need to redraw all icons during editing and improving the operation response speed.
[0052] In the specific implementation of step 7, the adapter selected in step 4 is invoked. First, the JSON attribute template of the graphic primitives in step 3 and the transformed coordinates output in step 5 are read. Combined with the engine API specification of the adaptation rule base in step 1, the graphic primitives are converted into dedicated rendering instructions recognizable by the current engine. Then, the parameter format of the dedicated rendering instructions is checked to ensure it meets the engine requirements, avoiding rendering failures due to instruction errors. After confirmation, the dedicated rendering instructions are sent to the map engine for rendering, completing the drawing of the emergency rescue icon.
[0053] It is understandable that step 7 enables the accurate rendering of unified graphic primitives across multiple engines, ensuring consistent presentation of rescue icons on different platforms and improving the collaborative efficiency of cross-terminal command.
[0054] In the specific implementation of step 8, the operation type and parameters are obtained, and the corresponding graphic primitive and its current attributes are located from the structured data according to the unique ID of the icon. If multiple users edit the same icon at the same time, the operation corresponding to the latest timestamp is retained using the timestamp priority mechanism, and the modification content of the old operation is backed up to the historical version library. For graphic primitives whose attributes have changed, a redraw instruction is triggered, and the attributes of the corresponding graphic primitive are updated. Then, the adapter selected in step 4 and the transformation coordinates output in step 5 are called to generate a new exclusive rendering instruction.
[0055] Specifically, when an icon editing request is received, the operation type and parameters (such as the X / Y axis offset of translation) are captured through the event listening module; the corresponding graphic primitive and its current state attributes are located from the structured data in step 6 based on the icon's unique ID.
[0056] When updating target attributes (such as changing the color parameter to red or adjusting the size ratio), if multiple users are editing concurrently, a timestamp priority mechanism is used to retain the operation corresponding to the latest timestamp, and the modifications of the old operation are backed up to the historical version repository.
[0057] Unlike existing technologies that require complete icon redrawing, this embodiment employs an incremental redrawing strategy: redrawing instructions are triggered only for graphic primitives whose attributes have changed, rather than redrawing the entire icon. After triggering a redrawing instruction for a graphic primitive with changed attributes, the adapter in step 4 is called, and a new dedicated rendering instruction is generated by combining the coordinate transformation in step 5. This new dedicated rendering instruction is sent to the map engine to perform incremental redrawing, significantly reducing computational load and achieving millisecond-level (≤50ms) redrawing response. This meets the real-time adjustment needs of emergency rescue and solves the lag problem.
[0058] After incremental redrawing, the old primitive resources that were replaced are released to avoid memory leaks, especially in long-term rescue command scenarios (such as 24 consecutive hours), to ensure that the system memory usage remains stable within a reasonable range.
[0059] Understandably, this step enables real-time response for icon editing, avoids lag and delays caused by full redrawing, and ensures that icons can be quickly and synchronously updated when the rescue situation changes, providing immediate visual support for command and decision-making.
[0060] This invention, through in-depth analysis of the internal architecture and rendering mechanisms of different map engines, constructs a universal underlying drawing logic for emergency icon creation. It employs a layered approach across four parts: graphic primitive parsing and generation, multi-engine instruction adaptation and conversion, real-time attribute mapping and redrawing, and intelligent coordinate system transformation, ensuring cross-engine compatibility and real-time operation.
[0061] It should be understood that, although this embodiment Figure 1The steps are shown sequentially as indicated by the arrows, but they are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are performed; they can be executed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0062] Example 2 Based on the general emergency rescue icon drawing method in Embodiment 1, this embodiment discloses a general emergency rescue icon drawing device, such as... Figure 2 As shown, the general emergency rescue icon drawing device includes: an interface adaptation layer construction module 401, a map engine type recognition module 402, a graphic primitive conversion module 403, a selection module 404, a coordinate conversion module 405, a structured processing module 406, an icon drawing module 407, and an icon editing module 408, wherein: The interface adaptation layer construction module 401 is used to construct the interface adaptation layer, which pre-stores the adaptation rule library corresponding to each map engine and the adapter bound to the adaptation rule library.
[0063] The map engine type recognition module 402 is used to identify the current map engine type to be used and output the map engine type recognition result.
[0064] The graphic primitive conversion module 403 is used to convert emergency rescue icons into graphic primitives with uniform attribute descriptions.
[0065] Module 404 is used to select an adapter and adaptation rule base that matches the current map engine from the interface adaptation layer based on the map engine type identification result.
[0066] The coordinate transformation module 405 is used to match the default coordinate system of the current map engine with the map engine type identification result, perform transformation calculations on the initial coordinates of the graphic primitives, and output the transformed coordinates.
[0067] The structured processing module 406 is used to perform structured processing on graphic primitives to form structured data.
[0068] The icon drawing module 407 is used to call the selected adapter, combine the transformation coordinates and the adaptation rule library, convert the graphic primitives into exclusive rendering instructions under the current map engine, and draw emergency rescue icons based on the exclusive rendering instructions.
[0069] The icon editing module 408 is used to retrieve structured data according to the editing operation type when receiving an icon editing request, update the attributes of the corresponding graphic primitive, call the selected adapter and transformation coordinates, generate a new exclusive rendering instruction, and edit the emergency rescue icon based on the new exclusive rendering instruction.
[0070] In this embodiment, the specific working process and working principle of the interface adaptation layer construction module 401, map engine type recognition module 402, graphics primitive conversion module 403, selection module 404, coordinate conversion module 405, structured processing module 406, icon drawing module 407, and icon editing module 408 are the same as those in Embodiment 1, and therefore will not be described again in this embodiment. Each unit module can be implemented entirely or partially through software, hardware, or a combination thereof. Each unit module can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above unit modules.
[0071] Example 3 like Figure 3 The diagram illustrates a terminal device disclosed in this embodiment, comprising a transmitter, a receiver, a memory, and a processor. The transmitter transmits instructions and data, the receiver receives instructions and data, the memory stores computer-executed instructions, and the processor executes the computer-executed instructions stored in the memory to implement the method described in Embodiment 1 above.
[0072] It is important to note that the aforementioned memory can be either standalone or integrated with the processor. When the memory is set up independently, the terminal device also includes a bus for connecting the memory and the processor.
[0073] Example 4 This embodiment discloses a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the method in Embodiment 1 above.
[0074] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0075] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0076] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A method for drawing universal emergency rescue icons, characterized in that, The method includes: Step 1: Construct an interface adaptation layer. The interface adaptation layer pre-stores the adaptation rule base corresponding to each map engine and the adapters bound to the corresponding adaptation rule base. Step 2: Identify the current map engine type to be used and output the map engine type identification result; Step 3: Convert the emergency rescue icons into graphic primitives with unified attribute descriptions; Step 4: Based on the map engine type identification results output in Step 2, select the adapter and adaptation rule base that match the current map engine from the interface adaptation layer constructed in Step 1. Step 5: Based on the map engine type identification result output in Step 2, match the default coordinate system of the current map engine, perform transformation calculations on the initial coordinates of the graphic primitives in Step 3, and output the transformed coordinates; Step 6: Perform structured processing on the graphical primitives obtained in Step 3 to form structured data; Step 7: Call the adapter selected in Step 4, combine the transformation coordinates output in Step 5 and the adaptation rule library in Step 1, convert the graphic primitives obtained in Step 3 into exclusive rendering instructions under the current map engine, and draw emergency rescue icons based on the exclusive rendering instructions. Step 8: When receiving an icon editing request, retrieve the structured data from Step 6 according to the editing operation type, update the attributes of the corresponding graphic primitive, then call the adapter selected in Step 4 and the transformation coordinates output in Step 5 to generate a new exclusive rendering instruction, and edit the emergency rescue icon based on the new exclusive rendering instruction.
2. The method for drawing universal emergency rescue icons according to claim 1, characterized in that, In step 2, identifying the current map engine type to be used includes: The engine detection module of the interface adaptation layer performs recognition, determines the current running environment, and loads the corresponding detection strategy. Based on the aforementioned detection strategy, global object feature detection or interface method feature detection is performed; if the detection is successful, the result verification is performed directly, and the map engine type identification result is output. If the detection fails, resource file feature detection is performed to supplement the identification of lightweight engine type; if multiple detections fail, the fault tolerance mechanism is triggered, the map engine type is manually selected, and the map engine type identification result is output.
3. The method for drawing universal emergency rescue icons according to claim 1, characterized in that, In step 3, the emergency rescue icon is converted into a graphic primitive with a unified attribute description, including: The emergency rescue icon is decomposed into basic geometric shapes, and a unified attribute parameter template is defined for each type of basic geometric shape to obtain graphic primitives.
4. The method for drawing universal emergency rescue icons according to claim 3, characterized in that, In step 3, when the emergency rescue icon is a complex icon, it also includes: Based on visual logic, complex icons are broken down into a basic layer, a functional layer, and a label layer, with each layer containing only a single type of basic geometric shape. Define the inter-layer association rules for the base layer, the functional layer, and the annotation layer. Through the inter-layer association rules, the relative position, size ratio, and style of the basic geometric shapes of each layer are uniformly processed. Then, the processed basic geometric shapes are converted into graphic primitives with uniform attribute descriptions.
5. The method for drawing universal emergency rescue icons according to any one of claims 1 to 4, characterized in that, In step 5, the initial coordinates of the graphic primitives from step 3 are transformed, and the transformed coordinates are output, including: Set the reference coordinate system and retrieve the preset coordinate system transformation formula library; Based on the default coordinate system of the current map engine, select the corresponding transformation formula from the preset coordinate system transformation formula library, perform coordinate transformation on the initial coordinates of the graphic primitives in step 3, and output the transformed coordinates.
6. The method for drawing universal emergency rescue icons according to claim 5, characterized in that, Step 5, which involves performing a transformation calculation on the initial coordinates of the graphic primitives from step 3 and outputting the transformed coordinates, also includes: Calculate the deviation between the transformed coordinates and the reference coordinate system coordinates, determine whether the deviation exceeds a preset deviation threshold, and if so, re-examine the transformation formula and perform the coordinate transformation again until the deviation meets the deviation threshold requirement, and then output the transformed coordinates.
7. The method for drawing universal emergency rescue icons according to any one of claims 1 to 4, characterized in that, In step 8, the structured data from step 6 is retrieved based on the editing operation type, the attributes of the corresponding graphic primitives are updated, and then the adapter selected in step 4 and the transformation coordinates output in step 5 are called to generate new dedicated rendering instructions, including: Obtain the operation type and parameters, and locate the corresponding graphic primitive and its current state attributes from the structured data based on the icon's unique ID; If multiple users edit the same icon at the same time, the operation corresponding to the latest timestamp is retained using a timestamp priority mechanism, and the modifications of the old operation are backed up to the historical version repository. For graphic primitives whose properties have changed, a redraw instruction is triggered, and the properties of the corresponding graphic primitives are updated. Then, the adapter selected in step 4 and the transformation coordinates output in step 5 are called to generate new dedicated rendering instructions.
8. A universal emergency rescue icon drawing device, characterized in that, The device includes: An interface adaptation layer construction module is used to construct an interface adaptation layer, wherein the interface adaptation layer pre-stores the adaptation rule library corresponding to each map engine and the adapter bound to the adaptation rule library. The map engine type identification module is used to identify the current map engine type to be used and output the map engine type identification result; The graphic primitive conversion module is used to convert emergency rescue icons into graphic primitives with unified attribute descriptions. The selection module is used to select the adapter and adaptation rule base that match the current map engine from the interface adaptation layer based on the map engine type identification result. The coordinate transformation module is used to match the default coordinate system of the current map engine based on the map engine type identification result, perform transformation calculations on the initial coordinates of the graphic primitives, and output the transformed coordinates; The structured processing module is used to perform structured processing on graphical primitives to form structured data; The icon drawing module is used to call the selected adapter, combine the transformation coordinates and the adaptation rule library to convert the graphic primitives into exclusive rendering instructions under the current map engine, and draw emergency rescue icons based on the exclusive rendering instructions; The icon editing module is used to retrieve structured data according to the editing operation type when receiving an icon editing request, update the attributes of the corresponding graphic primitive, call the selected adapter and transformation coordinates, generate new exclusive rendering instructions, and edit the emergency rescue icon based on the new exclusive rendering instructions.
9. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the general emergency rescue icon drawing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the steps of the general emergency rescue icon drawing method according to any one of claims 1 to 7.