A method for displaying and outputting a desktop map engine and a web graphics engine
By loading web page content into a desktop application and adjusting its position and scale, the system achieves integrated display and interactive operation of the desktop map engine and the web graphics engine. This solves the problem of overlaying multiple web page contents, reduces manpower and maintenance costs, and enables rich functionality and stable data overlay.
Patent Information
- Application Number
- CN202210628799.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-06
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-06-06
AI Technical Summary
Existing technologies make it difficult to overlay and interact with multiple web page contents in desktop applications, and require a significant amount of manpower to design and maintain the plotting function of desktop applications.
By setting the target desktop application, loading web page content, adjusting the web page size to match the desktop application window size, determining the relative position and scaling ratio, the desktop map engine and web graphics engine are integrated for display. Interaction is achieved through mouse and keyboard operations, and an overlaid PDF file is output.
It enables the overlay display and interactive operation of multiple web page contents in desktop applications, reducing design and maintenance costs, enriching functionality, and ensuring that the relative positions of the data remain unchanged after overlay.
Smart Images

Figure CN114880614B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geographic information systems, and in particular to a method for merging and displaying desktop map engines and web graphics engines. Background Technology
[0002] Currently, there are many mature web applications for plotting and situation plotting in the industry. If a similar plotting function is to be implemented in a desktop application, the existing database structure and plotting method need to be modified. A lot of manpower and time need to be invested from product design to product maturity.
[0003] Traditional desktop applications display web pages using WebBrowser windows, where only one web page can be displayed per screen, and custom content cannot be drawn on the window. With technological advancements, in recent years, some web application modules have emerged that are embedded into desktop applications to render server-provided pages and display them on the desktop. However, these modules still cannot overlay multiple web page contents within the desktop application, nor can they perform operations such as dragging, rotating, or scaling on the overlaid content. Summary of the Invention
[0004] To address the problems mentioned in the background section, the present invention aims to provide a method for the integrated display and output of desktop map engines and web graphics engines.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: a method for fusion display and output of desktop map engine and web graphics engine, comprising the following steps:
[0006] S1. Set the target desktop application and load web page content through the web application;
[0007] S2. Adjust the web page size setting in the web application to match the window size in the desktop application, and determine the relative position and scaling ratio between the desktop content and the web page content.
[0008] S3. Overlay the content of the web application onto the desktop application to achieve a fusion display of the desktop map engine and the web application;
[0009] S4. Based on user needs, overlay the custom content drawn on the desktop with the output file of the web page content, merge them into one file and output it.
[0010] In some embodiments, during step S1, when loading web page content through a web application, the web page content is loaded in memory using an embedded Chromium framework.
[0011] In some embodiments, in step S2, the relative positional relationship and scaling ratio between the desktop content and the web page content are determined by comparing the preset reference points and reference scaling factors on the desktop content and the web page content.
[0012] In some embodiments, in step S3, specifically, after the user draws custom content on the form of the desktop application, the current memory bitmap of the web application is obtained and overlaid on the form of the desktop application.
[0013] Alternatively, after the user saves the content displayed on the web application, the content drawn on the current desktop application's window interface is cleared, then the current memory bitmap of the desktop application is obtained and drawn onto the window, and then the content saved by the web application is overlaid and displayed on the desktop application's window.
[0014] In some embodiments, during step S3, in the process of realizing the integrated display of the desktop map engine and the web application, the size of the web page in the web application is always kept consistent with the size of the window in the desktop application, and the relative position and scaling ratio of the desktop content and the web page content are always kept in the relationship determined in step S2.
[0015] In some embodiments, in step S4, both the custom content drawn on the desktop and the web page content are output as PDF files, and the output PDF files are superimposed and merged into a single PDF file for output.
[0016] In some embodiments, during steps S1-S4, the user can transmit data to the webpage via mouse and / or keyboard operations to achieve interactive operation.
[0017] In some embodiments, in step S1, multiple web page contents are loaded by multiple web programs respectively; in step S2, the page size settings between each web program and the desktop application are adjusted, and the relative positional relationship and scaling ratio are determined respectively; in step S3, each web program is processed separately, and finally the desktop map engine and multiple web programs are integrated and displayed; in step S4, according to user needs, the custom content drawn on the desktop is overlaid with the files output by multiple web page contents, merged into one file and output.
[0018] Compared with the prior art, the beneficial effects of the present invention are:
[0019] This invention provides a method for integrating a desktop map engine and a web graphics engine for display and output. It renders custom desktop content and web page content on the same window, achieving overlay display and enabling interactive operations and accurate output of the target PDF. This invention incorporates mature web applications into desktop programs, eliminating the need for extensive manpower for design, development, and maintenance. It allows for the overlay of multiple web applications on a single window after custom content is rendered, offering rich functionality. Mouse and keyboard operations can be transferred to the web page for interactive functionality. Furthermore, by determining the position of a reference point and a reference scaling factor, the relative positions remain unchanged after data overlay. Attached Figure Description
[0020] Figure 1 A flowchart illustrating the method for fusion display and output of desktop map engine and web graphics engine provided by the present invention;
[0021] Figure 2 This is a schematic diagram of the processing procedure of step S2 in a specific embodiment. Detailed Implementation
[0022] To make the technical means, creative features, objectives and effects of this invention easier to understand, the following description, in conjunction with the accompanying drawings and specific embodiments, further explains how this invention is implemented.
[0023] Reference Figure 1 As shown, this invention provides a method for fusion display and output of desktop map engine and web graphics engine, including the following steps:
[0024] S1. Set the target desktop application and load web page content through the web application;
[0025] S2. Adjust the web page size setting in the web application to match the window size in the desktop application, and determine the relative position and scaling ratio between the desktop content and the web page content.
[0026] S3. Overlay the content of the web application onto the desktop application to achieve a fusion display of the desktop map engine and the web application;
[0027] S4. Based on user needs, overlay the custom content drawn on the desktop with the output file of the web page content, merge them into one file and output it.
[0028] Preferably, in step S1, when loading web page content through the web application, the embedded Chromium framework is used to load the web page content in memory. It can be understood that at this time, the web page content is loaded into memory and is not displayed on the web page interface.
[0029] Preferably, in step S2, the relative positional relationship and scaling ratio of the desktop content and the web page content are determined by comparing the preset reference points and reference scaling factors on the desktop content and the web page content, so as to ensure that the position of the superimposed display remains unchanged when the superimposed content is translated and scaled.
[0030] In step S3, specifically, after the user draws custom content on the desktop application's window, the current memory bitmap of the web application is obtained and overlaid on the desktop application's window; or, after the user saves the content displayed on the web application, the content drawn on the current desktop application's window interface is cleared, then the current memory bitmap of the desktop application is obtained and drawn onto the window, and then the content saved by the web application is overlaid on the desktop application's window.
[0031] In addition, in step S3, during the process of integrating the desktop map engine and the web application, the size of the web page in the web application and the window size in the desktop application are always kept consistent, and the relative position and scaling ratio of the desktop content and the web page content are always maintained as determined in step S2. It is understandable that in order to ensure the correctness of the displayed content, the following points need to be noted: (1) When the desktop is redrawn, the memory bitmap of the web page needs to be retrieved again. (2) When the web page content changes, the window content needs to be refreshed. (3) When the window size changes, the display range of the web page changes accordingly. (4) When the window content is scaled and panned, the web page content also needs to be scaled and panned.
[0032] Preferably, in step S4, both the custom content drawn on the desktop and the web page content are output as PDF files, and the output PDF files are superimposed and merged into a single PDF file for output.
[0033] It is understandable that in steps S1-S4, users can transmit data to the webpage through mouse and / or keyboard operations to achieve interactive operations.
[0034] Preferably, in step S1, multiple web page contents are loaded by multiple web programs respectively; in step S2, the page size settings between each web program and the desktop application are adjusted, and the relative position and scaling ratios are determined; in step S3, each web program is processed separately, and finally the desktop map engine and multiple web programs are integrated and displayed; in step S4, according to user needs, the custom content drawn on the desktop is overlaid with the files output by multiple web page contents, merged into one file and output.
[0035] The following describes a specific embodiment of the present invention using the example of overlaying plotting programs on MapControl in a thematic map system.
[0036] Understandably, a thematic map system is a desktop application; MapControl is a form within the system that can display and manipulate GIS (geographic information system) data; and the plotting program is a web application that can perform annotations; GIS data and the plotting program have different coordinate systems and scaling bases.
[0037] First, in step S1, GIS data is loaded into the desktop application's thematic mapping system; and the Chromium framework's dynamic library is referenced to create a browser object and load the web application. At this point, object creation and application loading occur in memory and are not displayed on the form.
[0038] Next, in step S2, the web application display size is adjusted so that the webpage display area matches the window drawing area, and then the positional and scaling relationships are determined. In this embodiment, the steps and effects of step S2 are as follows: Figure 2 As shown.
[0039] Since the coordinate system and scaling method of the thematic map system are different from those of the web application, it is necessary to determine the reference point and reference scaling factor to ensure that the position of the superimposed display remains unchanged when the superimposed map is translated and scaled.
[0040] Figure 2 In the diagram, the left side represents GIS data in a projected coordinate system with a scaling factor of 1:n. The right side represents the web application in a rectangular coordinate system with a scaling factor of n%. In this embodiment, to ensure the relative positions remain unchanged after data overlay, the coordinates (418470.8201, 4421315.7519) of the GIS data and the coordinates (0, 0) of the web application are chosen as reference points to ensure they are in the same position when overlaid. Furthermore, the scale of the GIS data (1:50000) is chosen to match the scaling factor of the web application (100%), thus determining the reference scaling factor. For example, when the GIS display scale is adjusted to 1:25000, the web application's scaling factor automatically adjusts to 200%, and then the point (0, 0) in the web application and the point (418470.8201, 4421315.7519) in the GIS data are displayed in the same position, maintaining the same display effect.
[0041] Subsequently, in step S3, after obtaining the drawing events of the desktop application and the web application, the desktop application and the web application are overlaid. There are two scenarios during this overlay display: (1) When the desktop application refreshes, it draws normally, saves the drawn content, obtains the memory bitmap currently displayed by the web application, and draws it onto the desktop application interface, completing the overlay display. (2) When the web application page refreshes, it first saves the content displayed by the web application, clears the drawing content of the current web page window, obtains the memory bitmap saved by the desktop application and draws it onto the desktop application interface, and then draws the content saved by the web application onto the interface, completing the overlay display. It is understandable that in both cases, the web page content is overlaid on top of the desktop content; therefore, the web page content is drawn after the desktop custom drawing content.
[0042] In addition, during data manipulation, to ensure the accuracy of the overlay display, relevant operations are automatically performed based on the positional and scaling relationships determined in step S2. For example, after the window size changes, the display range of the web application is first adjusted to match the window of the desktop application, and then the reference position of the web application is adjusted to match the reference position of the GIS data using a reference point; after the window is scaled, the data of the web application is scaled accordingly based on the scaling relationship, and then the reference point is moved to the same position.
[0043] During operation, in order to enable interactive operations on GIS data and plotted data, various mouse and keyboard events of the form are acquired and then passed to the browser. These events mainly include: mouse press event; mouse move event; mouse release event; mouse wheel scrolling event; mouse click event (including double-click); keyboard press event; and keyboard release event.
[0044] Finally, in step S4, when a PDF needs to be output, the paper size of the output PDF is first obtained based on the content of the form; then the system outputs the GIS PDF file; next, the web program outputs a PDF of the same paper size after scaling and panning the data to a suitable position; finally, the two PDFs are superimposed to obtain the final PDF.
[0045] In summary, the desktop map engine and web graphics engine fusion display and output method provided by this invention draws custom desktop content and web page content on the same window, achieving overlay display and enabling interactive operation and correct output of the target PDF. This invention incorporates relatively mature web applications into desktop programs, eliminating the need for significant manpower investment in design, development, and maintenance; it allows for the overlay of multiple web applications after custom content is drawn on a single window, providing rich functionality; it can transmit mouse and keyboard operations to the web page for interactive operation; and by determining the position of a reference point and a reference scaling factor, it ensures that the relative positions remain unchanged after data overlay.
[0046] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for displaying and outputting a desktop map engine and a web graphics engine, characterized by comprising the following steps: S1, setting a target desktop application program, and loading web page content through a web program; S2, adjusting a setting value of a web page size in the web program to be consistent with a window size in the desktop application program, and determining a relative position relationship and a scaling ratio relationship of desktop content and web page content; S3, superimposing and displaying content of the web program on the desktop application program, so as to realize fusion display of the desktop map engine and the web program; When superimposing and displaying, one of the following steps is performed: (S31) when the desktop application program is refreshed, the desktop application program is normally drawn, the drawing content is saved after drawing, a current display memory bitmap of the web program is obtained, and the drawing content is drawn on the desktop application program interface to complete superimposed display; (S32) when the web program page is refreshed, the content displayed by the web program is saved, the drawing content of the current web page window is cleared, the memory bitmap saved by the desktop application program is obtained and drawn on the desktop application program interface, and then the content saved by the web program is drawn on the interface to complete superimposed display; S4, according to user demand, superimposing and merging custom drawing content of the desktop and output files of the web content into one file and outputting the file; In step S4, the custom drawing content of the desktop and the web content are output as pdf files, and the output pdf files are superimposed and merged into one pdf file and output. In steps S1-S4, the user can pass the web page through mouse and / or keyboard operation to realize interactive operation. In step S1, when loading web page content through the web program, an embedded Chromium framework is used to load the web page content in memory.
2. The method of claim 1, wherein the desktop map engine and web graphic engine fusion display and output method is characterized by, In step S2, the relative position relationship and the scaling ratio relationship of the desktop content and the web content are determined by comparing preset reference points and reference scaling coefficients of the desktop content and the web content.
3. The method according to claim 1, wherein the desktop map engine and web graphic engine fusion display and output method is characterized in that, In step S3, specifically, after the user draws custom content on the window of the desktop application program, the current memory bitmap of the web program is obtained and superimposed and displayed on the window of the desktop application program; or, after the user saves the content displayed on the web program, the content drawn on the window interface of the current desktop application program is cleared, the current memory bitmap of the desktop application program is obtained and drawn on the window, and then the content saved by the web program is superimposed and displayed on the window of the desktop application program.
4. The method of claim 3, wherein the desktop map engine and web graphic engine fusion display and output method is characterized by, In step S3, in the process of realizing fusion display of the desktop map engine and the web program, the web page size in the web program is always consistent with the window size in the desktop application program, and the relative position and the scaling ratio of the desktop content and the web content always maintain the relationship determined in step S2.
5. The method of claim 4, wherein the desktop map engine and web graphic engine fusion display and output method is characterized by, 6. The method according to claim 1, wherein the desktop map engine and web graphic engine fusion display and output method is characterized in that, In step S1, multiple web programs are used to load multiple web page contents respectively; in step S2, the setting value adjustment of the page size between each web program and the desktop application, and the determination of the relative position relationship and the scaling ratio relationship are realized respectively; in step S3, each web program is processed respectively, and finally the fusion display of the desktop map engine and the multiple web programs is realized; in step S4, according to the user demand, the custom content drawn on the desktop is superimposed with the output file of the multiple web contents, and a file is merged and output.
Citation Information
Patent Citations
Scene fusion display method and device under WebGL
CN112445995A
Map construction method and device, storage medium and computer equipment
CN114371837A