Method and device for developing two-dimensional and three-dimensional map application engine, medium equipment and two-dimensional and three-dimensional map application engine

By integrating and encapsulating toolkits for multiple GIS engines, a unified application engine supporting two-dimensional and three-dimensional maps is generated, which solves the problem of separation of two-dimensional and three-dimensional maps in the existing technology, and realizes efficient and unified map development and operation.

CN119536692APending Publication Date: 2025-02-28XIAMEN CITY PLANNING DIGITAL TECHNOLOGY RESEARCH CENTER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411593629.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing technology is difficult to integrate two-dimensional and three-dimensional maps into a unified map engine, which leads to developers need to develop and maintain two-dimensional and three-dimensional map applications separately, and does not support the interoperability of multiple GIS engines.

Method used

By determining the target map and its functions, the toolkits are integrated and integrated into the package to generate a two-dimensional map application engine that supports multiple GIS engines. This method defines a unified interface and class, and calls methods of each toolkit internally to realize seamless switching and unified operations of two-dimensional and three-dimensional maps.

Benefits of technology

It realizes seamless integration of two-dimensional and three-dimensional maps, reduces the difficulty of development and maintenance, provides unified interfaces and efficient functions, supports the interoperability of multiple GIS engines, and improves development efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536692A_ABST
    Figure CN119536692A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a method for developing a two-dimensional and three-dimensional map application engine, which comprises the following steps of: determining a target map; determining a target function of each target map; integrating the determined target functions of the same target map to form a toolkit; and packaging and integrating the plurality of toolkits of the plurality of integrated target maps to obtain a two-dimensional and three-dimensional map application engine. According to the method for developing the two-dimensional and three-dimensional map application engine, after target functions needed by the target maps are screened, the single target maps are packaged to form the toolkits, then the packaged toolkits of the multiple target maps are packaged, unified input parameters and output parameters are set, and therefore the target functions of the two-dimensional and three-dimensional map application engine can be developed. The two-dimensional and three-dimensional map application development engine for developing and integrating multiple GIS engines is generated, the use difficulty of the two-dimensional and three-dimensional map is reduced, and the method has good use value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, medium equipment and a two-dimensional and three-dimensional map application engine for developing a two-dimensional and three-dimensional map application engine. Background Art

[0002] The mainstream products on the market are: ArcGIS JS for API, GeoScene JS for API for 2D and 3D map application development, SuperMap iClient Javascript for 2D map application development, SuperMapiClient3D for WebGL, SuperMap iClient3D for Cesium for 3D map application development, OpenLayers for 2D map application development, and Cesium for 3D map application development.

[0003] ArcGIS JS for API and GeoScene JS for API require a license to be purchased before use, and do not support loading SuperMap's 3D services or 3DTiles services. SuperMap iClient Javascript, SuperMap iClient3D for WebGL, and SuperMap iClient3D for Cesium require a license to be purchased before use, and 2D and 3D are not integrated, so 2D and 3D need to be developed separately. The 2D and 3D linkage functions need to be developed by yourself, and do not support loading Esri's 3D services or 3DTiles services. OpenLayers only has 2D scenes, and Cesium only has 3D scenes, and does not support loading Esri and SuperMap's 3D services.

[0004] Map applications often require the selection of map engines based on the owner's purchasing situation or needs. The same map application system may need to use different map engines to develop similar functions, which often requires developers to learn multiple map engines and maintain multiple sets of codes.

[0005] Therefore, there is an urgent need for a map engine that can fuse two-dimensional and three-dimensional maps. Summary of the invention

[0006] In order to solve the deficiencies of the prior art, the present invention provides a method for developing a two-dimensional and three-dimensional map application engine, comprising the following steps: S100, determining a target map; S200, determining the target function of each target map; S300, integrating the determined target functions of the same target map into a toolkit; S400: Encapsulate and integrate several toolkits of the integrated several target maps to obtain a two-dimensional or three-dimensional map application engine.

[0007] Furthermore, the specific steps of S300 are: S310, defining the config configuration of the target map; S320, using adm mode, loading the target map dependency and reading the config configuration of the target map; S330, define the interface IView and class View of the target map; S340, creating a view management method for a target map; S350, a method for creating a target function; S360, event-related method for creating a target map; S370: Create an export file of the target map.

[0008] Furthermore, the specific steps of S400 are: S410, define the view input parameter interface IViewOptions and the view class View; S420, defining an interface of a target map engine constructor; S430, when the constructor of the View class is initialized, a corresponding engine constructor is created according to the input target map; S440, define the interface and class of the manager Manager; S450, initialize the engine in the engine constructor, introduce libInit of the toolkit, and initialize the manager Manager; S460, the manager calls the scene creation method in the toolkit of each engine to create the scene and creates a manager instance; S470, define object interface and class; S480, loading an object into the scene; S490. Class attributes changed.

[0009] Furthermore, a manager instance includes events, layers, and objects.

[0010] Furthermore, the target map includes a two-dimensional map and a three-dimensional map.

[0011] The present invention provides a two-dimensional and three-dimensional map application engine, which is generated using a method for developing a two-dimensional and three-dimensional map application engine.

[0012] Furthermore, the two-dimensional maps and three-dimensional maps include ArcGIS, SuperMap, OpenLayers, Cesium, and GeoScene.

[0013] The present invention provides a device for developing a two-dimensional or three-dimensional map application engine, comprising: A map module, used to determine the target map; A function module, used to determine the target function of each target map; A first encapsulation module is used to integrate the determined target functions of the same target map into a toolkit; The second encapsulation module is used to encapsulate and integrate several toolkits of the integrated several target maps to obtain a two-dimensional or three-dimensional map application engine.

[0014] The present invention provides a computer-readable storage medium, which stores computer instructions and implements a method for developing a two-dimensional or three-dimensional map application engine when executed by a computer processor.

[0015] An electronic device provided by the present invention is characterized in that it includes at least one processor and a memory connected to the processor for communication, wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the processor to execute a method for developing a two-dimensional or three-dimensional map application engine.

[0016] Compared with the prior art, the method for developing a two-dimensional and three-dimensional map application engine provided by the present invention screens the target functions required by the target map, encapsulates a single target map to form a toolkit, then encapsulates the toolkits of multiple encapsulated target maps, sets unified input parameters and output parameters, so as to generate a two-dimensional and three-dimensional map application development engine that integrates the development of multiple GIS engines, reduces the difficulty of using two-dimensional and three-dimensional maps, and has good use value. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 A flowchart of a method for developing a two-dimensional and three-dimensional map application engine provided in Embodiment 1 of the present invention; Figure 2 A flow chart of forming a single toolkit for a target map provided in the first embodiment of the present invention; Figure 3A flowchart of packaging and integrating several target map toolkits provided in the first embodiment of the present invention into an engine; Figure 4 A schematic diagram of the structure of an apparatus for developing a two-dimensional or three-dimensional map application engine provided in Embodiment 3 of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

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

[0020] In the description of the present invention, it should be noted that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0021] Embodiment 1 The present invention provides a method for developing a two-dimensional and three-dimensional map application engine. Figure 1 As shown, the following steps are included: S100, determining a target map; Specifically, the target maps include two-dimensional maps and three-dimensional maps, such as ArcGIS, SuperMap, OpenLayers, Cesium, and GeoScene, but are not limited to the above maps. Any map required during the use of the project can be determined as a target map.

[0022] S200, determining the target function of each target map; Specifically, before integrating individual maps, the functions of each map need to be extracted and organized to form target functions. The number of target functions to be subsequently integrated can be based on user needs, or all of them can be protected.

[0023] S300, integrating the determined target functions of the same target map into a toolkit; S400: Encapsulate and integrate several toolkits of the integrated several target maps to obtain a two-dimensional or three-dimensional map application engine.

[0024] like Figure 2 As shown, S300 integrates the target functions of the same target map to form a toolkit in the following specific steps: S310, defining the config configuration of the target map; it includes the configuration of the addresses of js files, css files, font files, gp services, etc. of ArcGIS native API.

[0025] S320, using the adm method, loading the target map dependency and reading the config configuration of the target map; specifically, injecting each module of the native ArcGIS, such as 'esri / views / MapView'.

[0026] S330. Define the interface IView and class View of the target map; specifically, in the class View, a two-dimensional scene or a three-dimensional scene is created according to whether the type passed in is 2d or 3d. Taking ArcGIS as an example, the creation of the two-dimensional view calls the MapView related methods of the native ArcGIS API, and the creation of the three-dimensional view calls the SceneView related methods of the native ArcGIS API.

[0027] S340, create a view management method for the target map; specifically, createView creates a view. In this method, new View creates a new view and returns it. removeView deletes the view. geiView gets the view. focusView modifies the main view. When there are multiple map views in a system, there will be a main view.

[0028] S350, a method for creating a target function; specifically, layer-related functions addLayer loads a layer into the map, addLayers loads multiple layers, removeLayer deletes a layer, clearLayer clears a layer, changes layer visibility changeLayerVisible, changes layer transparency changeLayerOpacity, layer sorting recordLayer, getting all map layers getAllLayers, layer positioning gotoLayer, addRender adds a layer style, removeRender removes a layer style, filterLayer filters a layer, and clearFilterLayer clears a layer filter.

[0029] Attribute picking function related methods, bufferAnalysis buffer analysis related methods, Camera camera related methods, common general mathematical methods, contour contour analysis related methods, convert file import and export related methods, draw drawing related methods, geometry graphics related methods, hawkeye eagle eye image related methods, highlight highlight related methods, legend legend related methods, location coordinate positioning related methods, measure measurement related methods, model model related methods, pick picking related methods, profile profile analysis related methods, projection coordinate conversion related methods, screenshots screenshots related methods, search query statistics related methods, spatialAnalysis overlay analysis related methods, spatialRelationships spatial relationship related methods, splitScreen split-screen related methods, swipe rolling curtain related methods, thematicPrint printing related methods, visibility line of sight analysis related methods.

[0030] S360. Event-related methods for creating the target map; specifically, on event monitoring, once single monitoring, emit event emission, remove deletion monitoring, clear clearing all monitoring, map loading completion event, layer addition event, layer deletion event, layer modification event, 2D and 3D switching event, view range modification event and other event monitoring.

[0031] S370, creating an export file of the target map. Specifically, providing a unified export index file, in which all encapsulated methods are made available to the outside, supporting external on-demand method calls.

[0032] like Figure 4 As shown, S400 encapsulates and integrates all the determined two-dimensional map and three-dimensional map toolkits to obtain the specific steps of the two-dimensional and three-dimensional map application engine: S410. Define the view input interface IViewOptions and the view class View; IViewOptions description: For example, you can pass in apiType to specify the API type used when creating the target map, viewType to specify whether to initialize a 2D or 3D map, base to pass in the basic parameters required for view initialization, such as center, scale, spatialCRS, etc., baseLayers to pass in the base map layer to be loaded, scene to pass in the parameters of the 3D scene such as msaaSamples anti-aliasing, and effects to pass in special effect parameters such as light.

[0033] View Class additional description: The attributes have id unique identifier, containerId creates a view in the specified dom container, type indicates whether it is currently two-dimensional or three-dimensional, eBuilder is the engine builder instance class, and the constructor receives IViewOptions parameters. If no id is passed in, a random unique id is generated, and each attribute is assigned a value, and initialization operations are performed. The initialization operation is described in the S430 step below. View class also provides methods to destroy the view and then listen to the completion of the view. Users can use new View to create a map view and use the properties or methods therein to perform corresponding operations.

[0034] S420, define the interface of the target map engine builder; specifically, the structure of the engine builder is determined according to the required target map. In this embodiment, the engine builder interface includes IEngineBuilder, SuperMapEngineBuilder, OpenGISEngineBuilder, and ArcGISEngineBuilder. It should be noted that the engine builder interface is not limited to the above interface types, and can also be other engines that can be encapsulated and integrated.

[0035] Take IEngineBuilder as an example, it is used to define the property manager, define the init method to initialize the engine and the initManager method to initialize the manager; Supplement: implement IEngineBuilder, implement the init and initManager methods in the class, and the specific implementation is supplemented in S450; S430. When the constructor of the View class is initialized, a corresponding engine builder is created according to the passed target map; specifically, if the passed apiType is ArcGIS, view.builder=new ArcGISEngineBuilder(); if the passed apiType is SuperMap, view.builder=new SuperMapEngineBuilder(); if the passed apiType is OpenGIS, view.builder=new OpenGISEngineBuilder().

[0036] S440, define the manager interface and class; the general manager interface IManager defines methods, where init means initializing the map scene, and destroy means destroying the map scene. The init and destroy methods in IManager are implemented in the ArcGISManager class, which internally calls methods provided in the encapsulated ArcGIS toolkit, such as createView(), removeView(), etc., and also initializes various managers, such as view.events = newArcGISEventManager, view.layers = new ArcGISLayerManager, etc. The same is true for the OpenGISManager and SuperMapManager classes, which call methods in their respective toolkits during internal implementation.

[0037] The event manager interface IEventManager defines the on event monitoring method, once event monitoring method, emit event method, remove event monitoring method, and clear event monitoring method. The ArcGISEventManager class implements the methods in IEventManager, and internally calls the methods provided in the encapsulated ArcGIS toolkit, such as events.on(), events.emit(), etc. The OpenGISEventManager and SuperMapEventManager classes are similar, and the methods in their respective toolkits are called during internal implementation. The above three classes all inherit the EventManager class. The EventManager class extracts the codes that need to be rewritten in the above three classes to avoid repetitive writing. Only the difference codes need to be retained in each class.

[0038] The layer manager interface ILayerManager defines the attribute layers to store layer objects, defines the methods add to add layers to the scene, remove to delete layers from the scene, getById to get layers according to their id, etc. The methods in ILayerManager are implemented in the ArcGISLayerManager class, and the methods provided in the encapsulated ArcGIS toolkit are called internally, such as addLayer(), removeLayer(), etc. The OpenGISLayerManager and SuperMapLayerManager classes are similar, and the methods in their respective toolkits are called during internal implementation. The above three classes all inherit the LayerManager class. The LayerManager class extracts the codes that need to be repeatedly written in the above three classes to avoid repeated writing. Only the difference codes need to be retained in each class.

[0039] The object manager interface IObjectManager defines the property objects to store rendering objects, defines the methods add to add rendering objects to the scene, remove to delete rendering objects from the scene, getById to obtain rendering objects according to their id, etc. The methods in IObjectManager are implemented in the ArcGISObjectManager class, and the methods provided in the encapsulated ArcGIS toolkit are called internally, such as addGeometry(), removeGeometry(), etc. The OpenGISObjectManager and SuperMapObjectManager classes are similar, and the methods in their respective toolkits are called during internal implementation. The above three classes all inherit the ObjectManager class. The ObjectManager class extracts the codes that need to be repeatedly written in the above three classes to avoid repeated writing. Only the difference codes need to be retained in each class.

[0040] The camera manager interface ICameraManager defines the methods setExtent to set the map extent, getExtent to obtain the map extent, goToCamera to locate the specified camera position, getCamera to obtain the current camera position, zoomIn to zoom in the map, zoomOut to zoom out the map, startSceneRoam to start scene roaming, stopSceneRoam to stop scene roaming, etc. The methods in ICameraManager are implemented in the ArcGISCameraManager class, and the methods provided in the encapsulated ArcGIS toolkit are called internally, such as goToCamera(), zoomIn(), etc. The same is true for the OpenGISCameraManager and SuperMapCameraManager classes, and the methods in their respective toolkits are called during the internal implementation.

[0041] The tool manager interface IToolManager defines methods such as locateCoordinate for coordinate positioning and startMeasure for starting measurement. The ArcGISToolManager class implements the methods in IToolManager, and internally calls the methods provided in the encapsulated ArcGIS toolkit, such as locateCoordinate() and startMeasure(). The OpenGISToolManager and SuperMapToolManager classes are similar, and the methods in their respective toolkits are called during internal implementation.

[0042] S450, initialize the engine in the engine constructor, introduce the toolkit's libInit, and initialize the manager Manager; for example, ArcGISEngineBuilder implements the init method, calls the ArcGIS toolkit's libInit method, injects ArcGIS's native library, and then calls other methods in the toolkit. The implementation of initManger is newArcGISManager, and the same applies to OpenGISEngineBuilder and SuperMapEngineBuilder.

[0043] S460: The manager calls the scene creation method in the toolkit of each engine to create a scene and creates a manager instance.

[0044] S470, define object interfaces and classes; specifically, define the basic object interface IObject for attribute constraints, including id unique identification, visible display or not, etc. ILayer and IRenderObject both inherit IObject, and the rendering object IRenderObject defines the attributes of geometry spatial information, symbol style, and attributes field attributes, and defines the fromJson method to update and clone objects according to GeoJSON. Classes such as RenderPoint, RenderPolyline, and RenderPolygon implement IRenderObject, and users can use new RenderPoint to create point objects. There are currently more than 20 types of layer types, such as EsriImageLayer, WMSLayer, etc. Each layer type has its own special attribute fields. For example, the IWMSLayer interface inherits ILayer and adds its own unique attribute fields. The WMSLayer class implements IWMSLayer, and users can use new WMSLayer to create WMS layer objects.

[0045] Technical points: The value of the coordinate attribute in the Geometry class is set using a decorator to verify whether the point, line, and surface coordinates are correct. If not, an error is reported. If correct, an update operation is triggered. Determine whether the coordinate is a legal point coordinate. The specific point coordinate is also a one-dimensional array and the array length is equal to 2 or 3; determine whether it is a legal line coordinate. If the array length is less than 2, it does not constitute a necessary condition to meet a line. Otherwise, determine whether each point in the line array is a legal point; determine whether it is a legal surface coordinate. The length of the number is greater than or equal to three, and each point is a legal point. Determine whether each ring is closed, whether the inner ring does not intersect with itself, and whether each inner ring is inside the outer ring; determine whether it is multiple points, it is a point array and each point is a legal point; determine whether it is multiple lines, it is a line array and each line is a legal line; determine whether it is multiple faces, it is a face array and each face is a legal face; use an array proxy to monitor the changes in the Geometry coordinate array to trigger the change of the RenderObject position; obtain the length and area of ​​Geometry, convert the coordinates into coordinates of the 4326 coordinate system, and use mathematical methods to calculate the length of the line, the perimeter and the area of ​​the face.

[0046] S480, loading an object in the scene; specifically, for example, loading a layer, calling the add method in LayerManage, and passing in the Layer object.

[0047] S490, class attribute changes, for example, view View changes type, triggers the call of the changeViewType method in the Manager, and calls the 2D / 3D switching method in the corresponding engine toolkit. Specifically, in order to implement some functions, for example, the type attribute in the view View class indicates whether the current view is 2D or 3D, and the type attribute change can trigger the 2D / 3D switching function; for example, the visible attribute in the RenderPoint class indicates whether the object is displayed in the scene, and the visible attribute change can trigger the display and hiding of the object in the map scene.

[0048] When developing map applications for various projects, different map engines will be used as needed. Multiple projects may be developed using the same map engine, or the same project may require different map engines in different cities.

[0049] The first situation will lead to repeated coding of the same map-related functions in multiple projects, with code copying and pasting. Once a problem occurs, the code bases of multiple projects need to be modified. Over time, the large number of projects may result in different content for the same function in each project, making it inconvenient to troubleshoot problems.

[0050] In the second case, the business logic of the same project is the same, but the map-related code is different. It is necessary to establish multiple branches in one code base for maintenance, which requires a lot of code synchronization and branch maintenance work. The present invention adopts two steps to solve these two situations. First, the relevant functions developed using each native map engine are encapsulated into their own single-engine toolkits. The toolkits provide function methods, which are introduced into each project in the form of npm or js files. The methods provided by the toolkit are called in the project. Once the map-related functions are modified, each project only needs to update and introduce the latest toolkit without modifying the code. In each single-engine toolkit, the native engine js is injected first, and then the created view View is taken as the core. Each function needs to pass in the view as a parameter. It can be clearly seen that it is to operate on a specific view in the system. The functions encapsulated in the toolkit are all the requirements that have been realized in various projects of previous map development. The function name, input parameters, and output parameters of the functions are defined based on past experience. The same functions in each single-engine toolkit, such as measurement and positioning, try to keep the function name, input parameters, and output parameters consistent, which provides convenience for switching map engines for the same project. While maintaining consistency, there are differences among the engine toolkits. Because the support of the native API is different, even the same function can achieve better or more flexible effects by passing in some unique parameters. Therefore, the same function also has extended input or output parameters. For example, ArcGIS's measurement tool can pass in dom nodes and insert ArcGIS's measurement UI components into a specified panel, but OpenLayers does not provide this function, so the startMeasure in the encapsulated ArcGIS toolkit will have one more optional parameter than the startMeasure method in the OpenGIS toolkit. There is also a situation where, due to differences in native APIs, some functions can be implemented by some map engines but not by other map engines. For example, OpenGIS can draw and cut models, but ArcGIS cannot. Therefore, the methods of each engine toolkit are not exactly the same, and different methods need to be unified.

[0051] With various single-engine toolkits, the problem in situation 1 can be solved, and the differences in code between branches in situation 2 can be reduced. However, situation 2 has not been solved, and different toolkits need to be introduced in different branches of the same project.

[0052] The second step is to develop a multi-engine integrated map engine, which can have its own class library and interface constraints like other native engines. Therefore, various interfaces and classes are defined using steps S410-S490, and then the methods of various toolkits are called inside the class to implement initialization, create views and other functions. The core is still the view. When creating a view, you need to select the type of native engine to be used. View strings together other classes to implement various operations on the map view. With the map engine created as described above, there can be only one branch in the project. As long as this map engine is introduced, a set of code is written, and then parameter configuration is performed, the purpose of using different native engines can be achieved.

[0053] It should be noted that the present invention is not limited to the target map mentioned above. When other native map engines need to be added according to user or project requirements, a single engine toolkit is first encapsulated according to the map functions that will be used in the project, and the function names and input and output parameters are unified with other toolkits as much as possible, while retaining its unique methods and parameters. Then, the ApiType type is added to the all-in-one map engine, the EngineBuilder engine constructor and various Manager management classes of the native map engine are added, and the methods in the toolkit are called internally to support the development of multiple map applications using this native engine.

[0054] Embodiment 2 A two-dimensional and three-dimensional map application engine is generated using a method for developing a two-dimensional and three-dimensional map application engine as described in an embodiment. Specifically, the two-dimensional map and the three-dimensional map include ArcGIS, SuperMap, OpenLayers, Cesium, and GeoScene; it should be noted that it is not limited to the above-defined scope, and other maps that meet the conditions may also be included.

[0055] The 2D and 3D map application engine provided in this embodiment has the following functions: 1. Seamless switching between 2D and 3D maps. The OpenGIS toolkit provides powerful 2D and 3D map functions, allowing users to switch seamlessly between the two views. The OpenGIS toolkit has built-in complex mechanisms and algorithms to ensure data consistency and spatial consistency between the 2D plane and the 3D space, thereby greatly reducing the differences between 2D and 3D. Through this design, users can easily switch between the 2D top view and the 3D stereo view, which is suitable for a variety of application scenarios, such as urban planning, real-time monitoring, etc.

[0056] 2. Unified general function interface. The OpenGIS toolkit provides a unified method interface for all general functions. Whether in a 2D or 3D scene, users can operate through the same calling method without having to process them separately. This design simplifies the development process. Users do not have to worry about the implementation details behind it, so they can focus on the development of business logic. This unified interface greatly improves user experience and development efficiency, and is especially suitable for complex projects that need to process 2D and 3D data at the same time.

[0057] 3. Support for multiple lighting and soft shadow technologies. In 3D scenes, the toolkit uses shadowMap and PCF (Percentage-Closer Filtering) technologies to simulate the lighting and shadow effects in the real world. These technologies implement dynamic light sources, multi-light source support, and soft shadow effects between objects, making scene rendering more realistic and light and shadow effects softer. It can greatly enhance the user's immersion and visual experience.

[0058] 4. Visual field analysis and video fusion based on camera MVP transformation. Through shadowMap and camera MVP (Model-View-Projection) matrix transformation, the API can realize visual field analysis and video fusion functions. In visual field analysis, developers can accurately calculate the visible area within the viewing angle, while video fusion technology allows real-time video to be seamlessly integrated with 3D scenes. 5. Highly realistic weather effect rendering. The toolkit supports realistic weather effects rendering such as rain, snow, fog, etc. by using technologies such as depth buffer and normal texture. These effects can change dynamically according to the scene's lighting conditions, camera angle and the normal direction of the object, making the entire scene more realistic and natural.

[0059] 6. Realize complex scenes, such as city skylines. With the help of depth buffer technology, the toolkit can generate high-precision city skyline effects by calculating the depth information of each pixel in the scene.

[0060] 7. The toolkit ensures spatial consistency in different dimensions by establishing a two-way conversion mechanism between the 2D scale and range and the 3D camera position. This means that when users operate a 2D map, they can accurately map to the same position in the 3D view, and vice versa. This mechanism greatly facilitates cross-dimensional spatial analysis and data visualization, ensuring a seamless experience for users in 2D and 3D views.

[0061] 8. Optimize big data vector request and loading. For the processing of massive vector data, the toolkit uses slicing technology to request and load vector data in slices, thereby reducing the performance bottleneck caused by loading too much data at one time. This optimization method not only improves the loading speed, but also reduces memory usage, so that even in complex geographic information systems (GIS) or big data visualization applications, it can maintain a smooth user experience.

[0062] 9. The function of querying attributes based on the view extent. In ArcGIS, use view.extent to get the view extent; in OpenLayers, use view.calculateExtent(map.getSize()) and then use ol.extent; in Cesium, use viewer.camera.computeViewRectangle to get the view extent, but it may not be obtained. You need to first get viewer.scene.canvas and then use Cesium.Cartesian2 to convert the coordinates of the lower right corner of the canvas to 2D coordinates, then use viewer.camera.pickEllipsoid to convert 2D to 3D world coordinates, then use viewer.scene.globe.ellipsoid.cartesuabToCartographic to convert 3D world coordinates to radians, and then use Cesium.Math.toDegrees to convert radians to longitude and latitude.

[0063] 10. Cesium implements the effect of layering and household division. According to the floor position, floor height, floor base elevation, distance of each movement in the X direction, distance of each movement in the Y direction and other information in the building base surface service, first loop to build a building entity for each floor and each household. After selecting a floor and a household, the entity starts to pop up. Entity.polygon.hierarchy.getValue obtains the vertices of the polygon. Cesium.Transforms.eastNorthUpToFixedFrame and Cesium.Matrix4.setTranslation construct a 4*4 matrix in the east-north-up reference system. Cesium.Matrix4.multiply multiplies the current position matrix by the translation matrix to obtain the position matrix after translation. Cesium.Matrix4.getTranslation retrieves the coordinate information from the position matrix.

[0064] 11. The line of sight analysis function is implemented in ArcGIS using the LineOfSight tool, while in Cesium you need to draw and create the target point and observation point entities first, then use Cesium.Ray to establish the ray between the two points, viewer.scene.pickFromRay to calculate the interaction point, return the first one, and add line entities. The green line represents the visible area, and the red line represents the invisible area.

[0065] 12. Adding graphics functions, all toolkits are uniformly encapsulated into addGeometry methods, passing in geometry and symbol objects. In ArcGIS toolkit, geometry and symbol are converted into the format required by ArcGIS, a Graphic object is constructed, and it is added to the scene through the view.graphics.add method; in OpenLayers, geometry and symbol are converted into the format required by OpenLayers, an ol.Feature object is constructed, an ol.layer.Vector layer is constructed, and it is added to the scene through map.addLayer; in Cesium, geometry and symbol are converted into the format required by Cesium, a Cesium.Entity object is constructed, a Cesium.CustomDataSource object is constructed, and it is added to the scene through customDataSource.entities.add; 13. Add layer function. Each toolkit is uniformly encapsulated into addLayer method. The layer parameters are passed in. For example, when loading WMS service, in ArcGIS, the passed parameters are converted into the required format, WMSLayer object is constructed, and view.layers.add is used to add it to the scene; in OpenLayers, the passed parameters are converted into the required format, ol.source.ImageWMS is constructed, and then ol.layer.Image object is constructed, and map.addLayer is used to add it to the scene; in Cesium, the passed parameters are converted into the required format, Cesium.WebMapServiceImagryProvider object is constructed, and viewer.imageryLayers.addImageryProvider is used to add it to the scene. When loading ArcGIS dynamic services, in ArcGIS, convert the incoming parameters into the required format, construct a MapImageLayer object, and use view.layers.add to add it to the scene; in OpenLayers, convert the incoming parameters into the required format, construct an ol.source.ImageArcGISRest, and then construct an ol.layer.Image object, and use map.addLayer to add it to the scene; in Cesium, convert the incoming parameters into the required format, use Cesium.ArcGisMapServerImageryProvider.fromUrl to construct an object, and use viewer.imageryLayers.addImageryProvider to add it to the scene. When loading SuperMap dynamic services, in SuperMap 2D, convert the incoming parameters into the required format, construct an ol.source.ImageSuperMapRest, and then construct an ol.layer.Image object, and use map.addLayer to add it to the scene; in 3D, convert the incoming parameters into the required format, use Cesium.SuperMapImageryProvider to construct an object, and use viewer.imageryLayers.addImageryProvider to add it to the scene.

[0066] 14. Implement the model clipping function in Cesium. You can clip the model according to the drawn polygon or the coordinate information, get the tileset closest to the center of the screen, get the primitives in the scene, traverse each primitive to see if it is of Cesium3Tilesset type, get the center point of the scene, calculate the distance between each tileset and the center point using Cesium.Cartsian3.distance, find the tileset with the closest distance, and use getOutSideClippingPlanes or getClippingPlanes for drawing and clipping.

[0067] 15. The split screen function is uniformly encapsulated into the startSplitScreen method in each toolkit. Multiple div positions are set according to the split screen layout. A view instance is created in each div to monitor the range changes of each view and move the remaining views synchronously. Each view can add layers separately. It supports registering custom components in each split screen, which can be added to the four corners of the split screen. It has a built-in base map switching component and can also inject vue template custom components through local file paths. It uses the vue-template-compiler plug-in, uses XMLHttpRequest and FileReader to obtain local file content according to the url, uses complier to parse the file, converts dom to render, and then converts js into objects. Use vue.extend to inject render and js objects, and then add styles to inject custom components.

[0068] Embodiment 3 A device for developing a two-dimensional and three-dimensional map application engine, such as Figure 4 As shown, including: Map module, determines two-dimensional map and three-dimensional map; Functional module, determining the target function of each 2D map and 3D map; A first packaging module integrates the determined target functions of the same two-dimensional map or three-dimensional map into a toolkit; The second encapsulation module is used to provide method names, input parameters and output parameters of the same functions to all the determined two-dimensional map and three-dimensional map toolkits, and encapsulate and integrate all the determined two-dimensional map and three-dimensional map toolkits to obtain two-dimensional and three-dimensional map application engines.

[0069] Embodiment 4 A computer-readable storage medium stores computer instructions, and when executed by a processor of a computer, the computer implements the method of a two-dimensional and three-dimensional map application engine as in the first embodiment.

[0070] Embodiment 5 An electronic device, such as Figure 5 As shown, it includes at least one processor and a memory connected to the processor in communication, wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the processor to execute the method of the two-dimensional and three-dimensional map application engine as in Example 1.

[0071] Although the terms such as two-dimensional map, three-dimensional map, target function, toolkit, input parameter and output parameter are used more frequently in this article, the possibility of using other terms is not excluded. These terms are used only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional limitation is contrary to the spirit of the present invention.

[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for developing a two-dimensional or three-dimensional map application engine, characterized in that: The steps include: S100, determining a target map; S200, determining the target function of each target map; S300, integrating the determined target functions of the same target map into a toolkit; S400, encapsulating and integrating the toolkits of the integrated target maps to obtain a two-dimensional or three-dimensional map application engine.

2. The method for developing a two-dimensional or three-dimensional map application engine according to claim 1, characterized in that: The specific steps of S300 are: S310, defining the config configuration of the target map; S320, using adm mode, loading the target map dependency and reading the config configuration of the target map; S330, defining the interface IView and class View of the target map; S340, creating a view management method for the target map; S350, a method for creating the target function; S360, creating an event-related method for the target map; S370: Create an export file of the target map.

3. The method for developing a two-dimensional or three-dimensional map application engine according to claim 1, characterized in that: The specific steps of S400 are: S410, define the view input parameter interface IViewOptions and the view class View; S420, defining an interface of the target map engine builder; S430, when the constructor of the view class View is initialized, a corresponding engine constructor is created according to the target map passed in; S440, define the interface and class of the manager Manager; S450, initialize the engine in the engine constructor, introduce libInit of the toolkit, and initialize the manager Manager; S460, the manager calls the scene creation method in the toolkit of each engine to create the scene and creates a manager instance; S470, define object interface and class; S480, loading an object into the scene; S490. Class attributes changed.

4. The method for developing a two-dimensional or three-dimensional map application engine according to claim 3, characterized in that: The manager instance includes events, layers and objects.

5. The method for developing a two-dimensional or three-dimensional map application engine according to claim 1, characterized in that: The target map includes a two-dimensional map and a three-dimensional map.

6. A two-dimensional and three-dimensional map application engine, characterized in that: The two-dimensional and three-dimensional map application engine is generated using the method for developing a two-dimensional and three-dimensional map application engine as described in any one of claims 1-5.

7. The method for developing a two-dimensional or three-dimensional map application engine according to claim 6, characterized in that: The two-dimensional map and the three-dimensional map include ArcGIS, SuperMap, OpenLayers, Cesium, and GeoScene.

8. A device for developing a two-dimensional or three-dimensional map application engine, characterized in that: include: A map module, used to determine the target map; A function module, used for determining a target function of each of the target maps; A first packaging module, used for integrating the determined target functions of the same target map into a toolkit; The second encapsulation module is used to encapsulate and integrate the several toolkits of the integrated several target maps to obtain a two-dimensional or three-dimensional map application engine.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer is executed by a processor, the method for developing a two-dimensional or three-dimensional map application engine as described in any one of claims 1 to 4 is implemented.

10. An electronic device, characterized in that: It includes at least one processor and a memory that is communicatively connected to the processor, wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the processor to execute the method for developing a two-dimensional or three-dimensional map application engine as described in any one of claims 1-4.