A third-party map docking device and method based on WEBGIS
By introducing the front-end canvas and related units into the WEBGIS engine, the longitude and latitude coordinates of the third-party map are converted into geographical plane coordinates, and the changes in the window range are monitored, which solves the problem in the existing technology that the WEBGIS engine cannot quickly connect to the third-party map, and achieves Seamless docking and functional decoupling improve development efficiency and customer satisfaction.
Patent Information
- Application Number
- CN202110164337.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-05
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-02-05
AI Technical Summary
The existing WEBGIS engine cannot quickly connect to third-party maps, and is highly coupled with business functions. As a result, developers need to spend a lot of manpower on pre-research and packaging, and cannot ensure seamless integration of functions.
By introducing the front-end canvas, projection transformation unit, window range change monitoring unit and third-party map integration unit into the WEBGIS engine, the longitude and latitude coordinates of the third-party map are converted into geographical plane coordinates, and the window range changes are monitored and the window of the third-party map is called. Change the method so that it coincides with the front-end canvas to achieve seamless connection.
It realizes the seamless connection between third-party maps and WEBGIS engine, decouples business functions and map functions, improves development efficiency and customer satisfaction, and makes the system more portable.
Smart Images

Figure CN112860834B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geographic information technology, and in particular to a third-party map docking device and method based on WEBGIS. Background Art
[0002] In urban governance products, such as WEBGIS engines, maps are often used to present a large number of visual business. Among them, the accuracy, style, and function of the map are the three points that users pay most attention to. There are many map products on the market, such as Amap, Baidu Map, Tencent Map, etc., and some map engines such as arcgis and openlayer. These map products have their own advantages and disadvantages. In the early stage of urban governance product development, it is often necessary to select a map type and choose the most suitable map product based on the future business direction and existing technical accumulation.
[0003] With the continuous enrichment of urban governance product business and the increasing expansion of application scenarios, the functions of existing map products may not meet some of the needs of customers. Therefore, in some projects such as on-site projects, customers do not want to use the original maps in the product, but require to use the maps provided by the customers themselves. In this case, if the new maps are pre-researched, packaged, and connected, it will not only consume a lot of manpower, but also fail to ensure that the existing product functions can be seamlessly connected to the new maps. Summary of the invention
[0004] The present application provides a third-party map docking device and method based on WEBGIS, aiming to solve the problem that the existing WEBGIS engine cannot quickly dock with third-party maps and has a high degree of coupling with business functions.
[0005] According to the first aspect, an embodiment provides a third-party map docking device based on WEBGIS, including:
[0006] The front-end canvas of the WEBGIS engine, the level of which is higher than that of the third-party map;
[0007] A projection transformation unit, used to transform the latitude and longitude coordinates of the third-party map into geographic plane coordinates and map them onto the front-end canvas, so as to project the elements of the third-party map onto the front-end canvas;
[0008] A window range change monitoring unit, used to monitor the window range change of the front-end canvas and capture the window range change parameters;
[0009] The third-party map integration unit is used to call the window change method of the third-party map, and pass the window range change parameter to the window change method, so that the third-party map makes adaptive adjustments to overlap with the front-end canvas.
[0010] In one embodiment, the projection transformation unit converts the latitude and longitude coordinates of the third-party map into geographic plane coordinates and maps them onto the front-end canvas in the following manner:
[0011] In the front-end canvas, a geographic plane coordinate system is drawn with GPS (0, 0) as the origin, the equator from west to east as the X-axis, and the prime meridian from south to north as the Y-axis;
[0012] If the third-party map uses an offset encryption algorithm, the standard GPS coordinates are offset by the corresponding algorithm to obtain the latitude and longitude coordinates of the third-party map, and then the latitude and longitude coordinates of the third-party map are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas;
[0013] If the third-party map does not use an offset encryption algorithm, the standard GPS coordinates are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas.
[0014] In one embodiment, the window range change parameters include the current window geographic range, the current window zoom level, the current window center point GPS coordinates, and the current canvas matrix transformation, and the window change method of the third-party map includes a method for setting the center point and zoom level of the third-party map.
[0015] According to the second aspect, an embodiment provides a third-party map docking method based on WEBGIS, including:
[0016] Draw the front-end canvas of the WEBGIS engine;
[0017] Convert the latitude and longitude coordinates of the third-party map into geographic plane coordinates and map them onto the front-end canvas, so as to project the elements of the third-party map onto the front-end canvas;
[0018] Setting the level of the front-end canvas above the third-party map;
[0019] Monitor the window range change of the front-end canvas and capture the window range change parameters;
[0020] The window change method of the third-party map is called, and the window range change parameter is passed to the window change method, so that the third-party map makes adaptive adjustments to overlap with the front-end canvas.
[0021] In one embodiment, converting the latitude and longitude coordinates of the third-party map into geographic plane coordinates and mapping them onto the front-end canvas includes:
[0022] In the front-end canvas, a geographic plane coordinate system is drawn with GPS (0, 0) as the origin, the equator from west to east as the X-axis, and the prime meridian from south to north as the Y-axis;
[0023] If the third-party map uses an offset encryption algorithm, the standard GPS coordinates are offset by the corresponding algorithm to obtain the latitude and longitude coordinates of the third-party map, and then the latitude and longitude coordinates of the third-party map are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas;
[0024] If the third-party map does not use an offset encryption algorithm, the standard GPS coordinates are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas.
[0025] In one embodiment, the window range change parameters include the current window geographic range, the current window zoom level, the current window center point GPS coordinates, and the current canvas matrix transformation, and the window change method of the third-party map includes a method for setting the center point and zoom level of the third-party map.
[0026] In one embodiment, the method also includes redrawing elements when a change in the window range is detected. Before redrawing the elements, it is first determined whether the geographic plane coordinates of the current element are within the visible range of the window. If so, the element is rendered, otherwise the element is not rendered.
[0027] In one embodiment, the window range change includes window roaming and window zooming. During the window roaming process, the element is redrawn only when a mouse release event is detected or the element is redrawn once every time the mouse moves a preset distance.
[0028] In one embodiment, the dynamic elements and the static elements in the front-end canvas are drawn separately so that the static elements are not updated frequently following the dynamic elements.
[0029] According to the third aspect, an embodiment provides a computer-readable storage medium, on which a program is stored, and the program can be executed by a processor to implement the method described in the second aspect.
[0030] According to the WEBGIS-based third-party map docking device, method and computer-readable storage medium of the above embodiment, the latitude and longitude coordinates of the third-party map are converted into geographic plane coordinates and mapped to the front-end canvas of the WEBGIS engine; the level of the front-end canvas is set above the third-party map; the window range change of the front-end canvas is monitored, and the window range change parameters are captured; then the window change method of the third-party map is called, and the window range change parameters are passed into it, so that the third-party map makes adaptive adjustments, thereby overlapping with the front-end canvas, so that the front-end canvas serves as a bridge between the third-party map and the WEBGIS engine, realizes the decoupling of business functions and map functions, and can develop business functions without relying on the API of the third-party map, so that the system has stronger portability; developers do not need to pay attention to map selection when developing business, nor do they need to pre-research the API of the map, which improves development efficiency; on-site delivery personnel can quickly switch the map that the customer wants according to customer requirements, thereby improving customer satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the structure of a third-party map docking device based on WEBGIS according to an embodiment;
[0032] Figure 2 A schematic diagram of a geographic plane coordinate system drawn on a front-end canvas in an embodiment;
[0033] Figure 3 This is an effect diagram of a third-party map overlapping with a front-end canvas in an embodiment;
[0034] Figure 4 This is a rendering of the connection between a WEBGIS engine and a third-party map in one embodiment;
[0035] Figure 5 A schematic diagram of the structure of a third-party map docking device based on WEBGIS in another embodiment;
[0036] Figure 6 A schematic diagram of a flow chart of a method for connecting to a third-party map based on WEBGIS according to an embodiment;
[0037] Figure 7 A schematic diagram of functions supported by a WEBGIS engine in an embodiment;
[0038] Figure 8 This is the effect diagram of the overlapping conflict detection algorithm;
[0039] Fig. 9 This is the effect diagram of the RGBA channel heat map algorithm;
[0040] Fig.10 This is the effect diagram of the Kriging interpolation algorithm;
[0041] Fig.11 This is the effect diagram of the IDW interpolation algorithm. DETAILED DESCRIPTION
[0042] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.
[0043] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.
[0044] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).
[0045] GIS (Geographic Information System), also known as geographic information system, is a technical system that collects, stores, manages, calculates, analyzes, displays and describes the geographical distribution data in the entire or part of the earth's surface (including the atmosphere) space with the support of computer hardware and software systems. The idea of GIS is to model the world by organizing spatial geographic elements in layers. WEBGIS (Web Geographic Information System) refers to GIS that works on the browser side. It displays the interface in the form of a web page in the browser through the front-end interface and interacts with the user. WEBGIS is the extension and development of traditional GIS on the Internet. It has the characteristics of traditional GIS and also has good interactive experience and portability. It is widely used in urban governance.
[0046] Most of the existing WEBGIS engines cannot quickly connect to third-party maps. When developing urban governance products, developers need to conduct preliminary research on the API (Application Program Interface) of third-party maps and rely on the API of third-party maps to develop business functions. When customers do not want to use the maps preset in the product and propose to use other maps, they need to conduct preliminary research, packaging, and docking for other maps, which consumes a lot of manpower and cannot ensure that the existing product functions can be seamlessly connected to the new map. Therefore, the applicant proposed a third-party map docking device and method based on WEBGIS to solve the problem that the existing WEBGIS engine cannot quickly connect to third-party maps and has a high degree of coupling with business functions. The third-party maps here can be electronic maps such as Baidu Maps, Amap, Google Maps, etc.
[0047] Please refer to Figure 1 In one embodiment, a third-party map docking device based on WEBGIS includes a front-end canvas 1 of a WEBGIS engine, a projection transformation unit 2, a window range change monitoring unit 3 and a third-party map integration unit 4, which are described in detail below.
[0048] The front-end canvas 1 of the WEBGIS engine is used to interact with the user. In a specific implementation, HTML (Hyper Text Markup Language) and JavaScript technology can be used to develop web pages, and the Canvas graphic container can be used to draw the front-end canvas 1 of the WEBGIS engine. Specifically, through the Canvas API, basic graphics knowledge is used to draw points, lines, and surfaces on the Canvas canvas and to achieve translation and scaling of the canvas. The distance between two pixels in the front-end canvas 1 represents 1 meter in geographic information. The user can interact with the WEBGIS engine through the front-end canvas 1, and realize window roaming by long pressing the mouse and dragging the front-end canvas 1, and realize window scaling by scrolling the mouse wheel, wherein window roaming refers to continuous translation of the front-end canvas 1, and window roaming and window scaling are collectively referred to as window range changes.
[0049] Dynamic elements and static elements in the front-end canvas 1 can be drawn separately. Dynamic elements such as animations, in order to make the human eye observe a smooth picture, will be guaranteed to be updated at a frame rate of at least twelve frames per second, which means that the Canvas must be redrawn at least twelve times per second. In order to ensure that static elements are not updated frequently with dynamic elements, dynamic elements and static elements are drawn separately to reduce the burden on system operation.
[0050] The level of the front-end canvas 1 is higher than that of the third-party map. Specifically, you can create a new DIV container, use the third-party map's own initialization method to initialize the map in the newly created DIV container, set the z-index level of the DIV container to 1, and set the z-index level of the graphic container of the front-end canvas 1 to 2. Since the level of the front-end canvas 1 is higher than that of the third-party map, when the user operates the web page, he directly operates the front-end canvas.
[0051] The projection transformation unit 2 is used to transform the latitude and longitude coordinates of the third-party map into geographic plane coordinates and map them onto the front-end canvas 1, so as to project the elements of the third-party map onto the front-end canvas 1. Specifically, the projection transformation unit 2 first draws a geographic plane coordinate system in the front-end canvas 1 with GPS (0, 0) as the origin, the equator from west to east as the X-axis, and the prime meridian from south to north as the Y-axis, such as Figure 2 As shown; then the latitude and longitude coordinates of the third-party map are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas 1.
[0052] For domestic third-party maps, due to national security regulations, they basically use offset encryption algorithms to offset the standard GPS coordinates. The main offset encryption algorithms are GCJ02 and BD09. Therefore, before converting the latitude and longitude coordinates of the third-party map to geographic plane coordinates, it is necessary to first determine whether the third-party map coordinate system has an offset. If there is an offset, it is necessary to determine what kind of offset it is. After offsetting the standard GPS coordinates with the corresponding algorithm, the latitude and longitude coordinates of the third-party map are obtained, and then the latitude and longitude coordinates of the third-party map are converted to the coordinates of the geographic plane coordinate system through the Web Mercator projection method. For example, Amap is obtained by encrypting the standard GPS coordinates with GCJ02, so it is necessary to first perform GCJ02 offset on the standard GPS coordinates to obtain the latitude and longitude coordinates of Amap, and then convert the obtained latitude and longitude coordinates of Amap to the coordinates of the geographic plane coordinate system through the Web Mercator projection method. For example, Baidu Map is obtained by encrypting the standard GPS coordinates by GCJ02 and then encrypting the result by BD09. Therefore, it is necessary to first perform GCJ02 offset on the standard GPS coordinates, and then perform BD09 offset on the result obtained by GCJ02 offset to obtain the longitude and latitude coordinates of Baidu Map, and then convert the longitude and latitude coordinates of Baidu Map into coordinates of the geographic plane coordinate system through the Web Mercator projection method.
[0053] For foreign third-party maps, they generally do not use offset encryption algorithms. Therefore, the standard GPS coordinates can be directly converted into coordinates of the geographic plane coordinate system through the WebMercator projection method.
[0054] After the latitude and longitude coordinates of the third-party map are converted into geographic plane coordinates and mapped to the front-end canvas 1 , the elements on the third-party map have corresponding positions on the front-end canvas 1 , and can thus be projected onto the front-end canvas 1 .
[0055] The window range change monitoring unit 3 is used to monitor the window range change of the front-end canvas 1 and capture the window range change parameters. When the user operates the front-end canvas 1, the window range will change when the window roams and zooms. When the window range change is monitored, the window range change monitoring unit 3 throws an event to the third-party map, and the event includes the captured window range change parameters. In one embodiment, the window range change parameters include the current window geographic range, the current window zoom level, the current window center point GPS coordinates and the current canvas matrix transformation.
[0056] The third-party map integration unit 4 is used to call the window change method of the third-party map, and pass the window range change parameters to the window change method, so that the third-party map makes adaptive adjustments, so as to overlap with the front-end canvas 1. Specifically, the third-party map integration unit 4 calls the method of setting the center point and zoom level of the third-party map, captures the event thrown by the window range change monitoring unit 3, and uses the current window geographic range, current window zoom level, current window center point GPS coordinates and current canvas matrix transformation parameters as parameters of the method of setting the center point and zoom level, so that the third-party map makes adaptive adjustments, so as to overlap with the front-end canvas 1, such as Figure 3 As shown. In this way, the operation of the third-party map is synchronized with the front-end canvas 1. Please refer to Figure 4 , users can interact with the WEBGIS engine through the front-end canvas 1 and use the functions provided by the WEBGIS engine to develop business. The front-end canvas 1 passes the user's operation to the third-party map. The user operates the front-end canvas 1 just like operating the third-party map. Figure 1 In this way, the front-end canvas 1 is transparent to the user, thereby realizing the seamless connection between the third-party map and the WEBGIS engine and decoupling the business function and the map function.
[0057] Please refer to Figure 5 In one embodiment, the third-party map docking device based on WEBGIS also includes an element redrawing unit 5, which is used to redraw the map elements when the window range changes are monitored to adapt to the change of the window range. In one embodiment, before redrawing the element, the element redrawing unit 5 first determines whether the geographic plane coordinates of the current element are within the visible range of the window. If so, the element is rendered, otherwise, the element is not rendered, which can improve the performance of the system.
[0058] In the process of window roaming, in order to ensure the accuracy of the element position, the element will be redrawn every time the mouse moves 1px (pixel). Although this provides a better interactive experience, there is also an obvious waste of performance. The jamming is particularly obvious when the number of elements that need to be drawn exceeds 10,000. In response to this situation, the present application proposes two optimization methods. The first method: the element redrawing unit 5 does not redraw the element when the mouse moves, but only redraws the element when the mouse release event is monitored. In this way, the element will only be redrawn once each time the window roams, and the performance is greatly improved, but some interactive experience is sacrificed. The second method: adopt the idea of throttling algorithm, pre-set a suitable distance, and the element redrawing unit 5 redraws the element every time the mouse moves the preset distance, such as redrawing the element every time it moves 100px. This retains the interactive experience while also improving some performance. The specific distance can be selected according to the actual situation of the project.
[0059] The following is an introduction to the third-party map docking method based on WEBGIS.
[0060] Please refer to Figure 6 In one embodiment, the third-party map docking method based on WEBGIS includes steps 101 to 105, which are described in detail below.
[0061] Step 101: Draw the front-end canvas of the WEBGIS engine. In a specific implementation, HTML and JavaScript technologies can be used to develop web pages, and the Canvas graphic container can be used to draw the front-end canvas of the WEBGIS engine. Specifically, through the Canvas API, basic graphics knowledge is used to draw points, lines, and surfaces on the Canvas canvas and to achieve translation and scaling of the canvas. The distance between two pixels in the front-end canvas represents 1 meter in geographic information. Users can interact with the WEBGIS engine through the front-end canvas, and realize window roaming by long pressing the mouse and dragging the front-end canvas, and realize window scaling by scrolling the mouse wheel, wherein window roaming refers to continuous translation of the front-end canvas, and window roaming and window scaling are collectively referred to as window range changes.
[0062] When drawing the front-end canvas, dynamic elements and static elements can be drawn separately. Dynamic elements such as animations, in order to make the human eye observe a smooth picture, will be guaranteed to be updated at a frame rate of at least twelve frames per second, which means that the Canvas must be redrawn at least twelve times per second. In order to ensure that static elements are not updated frequently with dynamic elements, dynamic elements and static elements are drawn separately to reduce the burden on system operation.
[0063] Step 102: Convert the latitude and longitude coordinates of the third-party map into geographic plane coordinates and map them to the front-end canvas to project the elements of the third-party map onto the front-end canvas. Specifically, first draw a geographic plane coordinate system in the front-end canvas with GPS (0, 0) as the origin, the equator from west to east as the X-axis, and the prime meridian from south to north as the Y-axis, such as Figure 2 As shown; then the latitude and longitude coordinates of the third-party map are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas.
[0064] For domestic third-party maps, due to national security regulations, they basically use offset encryption algorithms to offset the standard GPS coordinates. The main offset encryption algorithms are GCJ02 and BD09. Therefore, before converting the latitude and longitude coordinates of the third-party map to geographic plane coordinates, it is necessary to first determine whether the third-party map coordinate system has an offset. If there is an offset, it is necessary to determine what kind of offset it is. After offsetting the standard GPS coordinates with the corresponding algorithm, the latitude and longitude coordinates of the third-party map are obtained, and then the latitude and longitude coordinates of the third-party map are converted to the coordinates of the geographic plane coordinate system through the Web Mercator projection method. For example, Amap is obtained by encrypting the standard GPS coordinates with GCJ02, so it is necessary to first perform GCJ02 offset on the standard GPS coordinates to obtain the latitude and longitude coordinates of Amap, and then convert the obtained latitude and longitude coordinates of Amap to the coordinates of the geographic plane coordinate system through the Web Mercator projection method. For example, Baidu Map is obtained by encrypting the standard GPS coordinates by GCJ02 and then encrypting the result by BD09. Therefore, it is necessary to first perform GCJ02 offset on the standard GPS coordinates, and then perform BD09 offset on the result obtained by GCJ02 offset to obtain the longitude and latitude coordinates of Baidu Map, and then convert the longitude and latitude coordinates of Baidu Map into coordinates of the geographic plane coordinate system through the Web Mercator projection method.
[0065] For foreign third-party maps, they generally do not use offset encryption algorithms. Therefore, the standard GPS coordinates can be directly converted into coordinates of the geographic plane coordinate system through the WebMercator projection method.
[0066] After converting the latitude and longitude coordinates of the third-party map into geographic plane coordinates and mapping them to the front-end canvas, the elements on the third-party map will have corresponding positions on the front-end canvas and can thus be projected onto the front-end canvas.
[0067] Step 103: Set the level of the front-end canvas above the third-party map. Specifically, you can create a new DIV container, use the third-party map's own initialization method to initialize the map in the newly created DIV container, set the z-index level of the DIV container to 1, and set the z-index level of the graphic container of the front-end canvas to 2. Since the level of the front-end canvas is higher than that of the third-party map, when the user operates the web page, he directly operates the front-end canvas.
[0068] Step 104: monitor the window range change of the front-end canvas and capture the window range change parameters. When the user operates the front-end canvas, the window range will change when the window roams and zooms. When the window range change is monitored, an event is thrown to the third-party map, and the event includes the captured window range change parameters. In one embodiment, the window range change parameters include the current window geographic range, the current window zoom level, the current window center point GPS coordinates and the current canvas matrix transformation.
[0069] Step 105: Call the window change method of the third-party map, pass the window range change parameters to the window change method, so that the third-party map makes adaptive adjustments to overlap with the front-end canvas. Specifically, the method of setting the center point and zoom level of the third-party map can be called to capture the event thrown in step 104, and the parameters such as the current window geographic range, the current window zoom level, the current window center point GPS coordinates and the current canvas matrix transformation are used as parameters of the method of setting the center point and zoom level, so that the third-party map makes adaptive adjustments to overlap with the front-end canvas, such as Figure 3 As shown. In this way, the operation of the third-party map is synchronized with the front-end canvas. Please refer to Figure 4 Users can interact with the WEBGIS engine through the front-end canvas and use the functions provided by the WEBGIS engine to develop business. The front-end canvas transmits the user's operations to the third-party map. The user operates the front-end canvas just like operating the third-party map. Figure 1 In this way, the front-end canvas is transparent to the user, thus achieving seamless connection between third-party maps and WEBGIS engine and decoupling business functions and map functions.
[0070] When the window range changes, the map elements will be redrawn to adapt to the changes in the window range. In one embodiment, before redrawing the elements, it is first determined whether the geographic plane coordinates of the current element are within the visible range of the window. If so, the element is rendered, otherwise, the element is not rendered, which can improve the performance of the system.
[0071] In the process of window roaming, in order to ensure the accurate position of elements, generally the elements will be redrawn every time the mouse moves 1px (pixel). Although this provides a better interactive experience, there is also a significant waste of performance. The jamming is particularly obvious when the number of elements that need to be drawn exceeds 10,000. In response to this situation, this application proposes two optimization methods. The first method: do not redraw elements when the mouse moves, but only redraw elements when the mouse release event is monitored. In this way, the elements will only be redrawn once each time the window roams, and the performance is greatly improved, but some interactive experience is sacrificed. The second method: adopt the idea of throttling algorithm, pre-set the appropriate distance, and redraw the elements every time the mouse moves the preset distance, such as redrawing the elements every time it moves 100px. This retains the interactive experience while also improving some performance. The specific distance can be selected according to the actual situation of the project.
[0072] According to the WEBGIS-based third-party map docking device and method of the above embodiment, the front-end canvas is used as a bridge between the third-party map and the WEBGIS engine, so that the user operates the front-end canvas just like operating the third-party map. Figure 1 In this way, the front-end canvas is transparent to the user, thus achieving seamless integration of third-party maps and WEBGIS engines, decoupling business functions and map functions, and developing business functions without relying on third-party map APIs, making the system more portable; developers do not need to pay attention to map selection or pre-research map APIs when developing business, which improves development efficiency; on-site delivery personnel can quickly switch the maps that customers want according to customer requirements, thereby improving customer satisfaction.
[0073] Please refer to Figure 7 The functions supported by the WEBGIS engine provided by this application include map panning and zooming, vector element drawing, map event capture, massive point aggregation, animation, annotation, layer selection, distance measurement, surface measurement, graphic editing, heat map, spatial interpolation, static slice loading, etc. The engine also has the following built-in algorithms:
[0074] 1. Overlap conflict detection algorithm. If you need to add annotations to densely packed elements, this algorithm can improve system performance and provide a better user experience. Figure 8 shown.
[0075] 2. RGBA channel heat map algorithm. This algorithm has a significant improvement in the performance of converting massive points into heat maps. For example, it performs well in presenting heat maps of tourist flow in scenic spots. Fig. 9 shown.
[0076] 3. Two spatial interpolation algorithms: Kriging interpolation and IDW interpolation, which are often used to convert the measurement data of discrete points into continuous data surfaces. The distribution trend of other points in the space can be inferred from some known point data. The effect of Kriging interpolation is as follows: Fig.10 As shown, the effect of IDW interpolation is as follows Fig.11 shown.
[0077] This document is described with reference to various exemplary embodiments. However, those skilled in the art will recognize that changes and modifications may be made to the exemplary embodiments without departing from the scope of this document. For example, various operating steps and components for performing the operating steps may be implemented in different ways (e.g., one or more steps may be deleted, modified, or incorporated into other steps) depending on the specific application or considering any number of cost functions associated with the operation of the system.
[0078] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. In addition, as understood by those skilled in the art, the principles of this article can be reflected in a computer program product on a computer-readable storage medium, which is pre-installed with a computer-readable program code. Any tangible, non-temporary computer-readable storage medium can be used, including magnetic storage devices (hard disks, floppy disks, etc.), optical storage devices (CD to ROM, DVD, Blu Ray disks, etc.), flash memory and / or the like. These computer program instructions can be loaded onto a general-purpose computer, a special-purpose computer or other programmable data processing device to form a machine, so that these instructions executed on a computer or other programmable data processing device can generate a device that implements a specified function. These computer program instructions can also be stored in a computer-readable memory, which can instruct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory can form a manufactured product, including an implementation device that implements a specified function. Computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on a computer or other programmable device to generate a computer-implemented process, so that the instructions executed on a computer or other programmable device can provide steps for implementing a specified function.
[0079] Although the principles of this invention have been shown in various embodiments, many modifications of structures, arrangements, proportions, elements, materials and components particularly suitable for specific environments and operational requirements can be used without departing from the principles and scope of this disclosure. The above modifications and other changes or modifications will be included in the scope of this invention.
[0080] The foregoing specific description has been described with reference to various embodiments. However, those skilled in the art will recognize that various modifications and changes can be made without departing from the scope of the present disclosure. Therefore, the consideration of the present disclosure will be illustrative rather than restrictive, and all these modifications will be included in its scope. Similarly, the advantages, other advantages and solutions to the problems of various embodiments have been described above. However, the benefits, advantages, solutions to the problems and any elements that can produce these, or make them more clear, should not be interpreted as critical, necessary or necessary. The term "include" and any other variants used in this article are all non-exclusive inclusions, so that the process, method, article or device including the list of elements not only includes these elements, but also includes other elements that are not explicitly listed or do not belong to the process, method, system, article or device. In addition, the term "coupled" and any other variants used in this article refer to physical connections, electrical connections, magnetic connections, optical connections, communication connections, functional connections and / or any other connections.
[0081] Those skilled in the art will appreciate that many changes may be made to the details of the above-described embodiments without departing from the basic principles of the invention. Therefore, the scope of the present invention should be determined solely by the claims.
Claims
1. A third-party map docking device based on WEBGIS, characterized in that: include: The front-end canvas of the WEBGIS engine, the level of which is higher than that of the third-party map; A projection transformation unit, used to transform the latitude and longitude coordinates of the third-party map into geographic plane coordinates and map them onto the front-end canvas, so as to project the elements of the third-party map onto the front-end canvas; A window range change monitoring unit, used to monitor the window range change of the front-end canvas and capture the window range change parameters; A third-party map integration unit, used for calling a window change method of the third-party map, passing the window range change parameter to the window change method, so that the third-party map makes adaptive adjustments so as to overlap with the front-end canvas; The projection transformation unit converts the latitude and longitude coordinates of the third-party map into geographic plane coordinates and maps them onto the front-end canvas in the following manner: In the front-end canvas, a geographic plane coordinate system is drawn with GPS (0, 0) as the origin, the equator from west to east as the X-axis, and the prime meridian from south to north as the Y-axis; If the third-party map uses an offset encryption algorithm, the standard GPS coordinates are offset by the corresponding algorithm to obtain the latitude and longitude coordinates of the third-party map, and then the latitude and longitude coordinates of the third-party map are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas; If the third-party map does not use an offset encryption algorithm, the standard GPS coordinates are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas.
2. The device according to claim 1, characterized in that The window range change parameters include the current window geographic range, the current window zoom level, the current window center point GPS coordinates and the current canvas matrix transformation, and the third-party map window change method includes a method for setting the center point and zoom level of the third-party map.
3. A third-party map docking method based on WEBGIS, characterized in that: include: Draw the front-end canvas of the WEBGIS engine; Convert the latitude and longitude coordinates of the third-party map into geographic plane coordinates and map them onto the front-end canvas, so as to project the elements of the third-party map onto the front-end canvas; Setting the level of the front-end canvas above the third-party map; Monitor the window range change of the front-end canvas and capture the window range change parameters; Calling the window change method of the third-party map, passing the window range change parameter to the window change method, so that the third-party map makes adaptive adjustments to overlap with the front-end canvas; The step of converting the latitude and longitude coordinates of the third-party map into geographic plane coordinates and mapping them onto the front-end canvas includes: In the front-end canvas, a geographic plane coordinate system is drawn with GPS (0, 0) as the origin, the equator from west to east as the X-axis, and the prime meridian from south to north as the Y-axis; If the third-party map uses an offset encryption algorithm, the standard GPS coordinates are offset by the corresponding algorithm to obtain the latitude and longitude coordinates of the third-party map, and then the latitude and longitude coordinates of the third-party map are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas; If the third-party map does not use an offset encryption algorithm, the standard GPS coordinates are converted into coordinates of the geographic plane coordinate system through the Web Mercator projection method and mapped onto the front-end canvas.
4. The method according to claim 3, characterized in that The window range change parameters include the current window geographic range, the current window zoom level, the current window center point GPS coordinates and the current canvas matrix transformation. The third-party map window change method includes a method for setting the center point and zoom level of the third-party map.
5. The method according to claim 3, characterized in that It also includes redrawing elements when monitoring the window range changes. Before redrawing the elements, first determine whether the geographic plane coordinates of the current element are within the visible range of the window. If so, the element is rendered, otherwise the element is not rendered.
6. The method according to claim 5, characterized in that The window range change includes window roaming and window zooming. During the window roaming process, the element is redrawn only when a mouse release event is monitored or the element is redrawn once every time the mouse moves a preset distance.
7. The method according to claim 3, characterized in that The dynamic elements and the static elements in the front-end canvas are drawn separately so that the static elements are not updated frequently following the dynamic elements.
8. A computer-readable storage medium, characterized in that: The medium stores a program, which can be executed by a processor to implement the method according to any one of claims 3 to 7.
Citation Information
Patent Citations
Multithreading display mechanism of two-dimensional map tiles
CN102750180A
Quick-look client combined with three-dimensional earth
CN103324523A
Network thematic map making method and map making system
CN103530340A
Quick map drawing method of complex vector data
CN104268145A
Map service providing method and apparatus
CN104933057A
