A WebGL-based widgetized 3D GIS framework system

By using a TypeScript-based widgetized 3D GIS framework system, the complexity and high cost of traditional 3D GIS development methods in agile development scenarios are solved, enabling efficient and modular 3D GIS development and improving development efficiency and user experience.

CN116893802BActive Publication Date: 2026-11-17CHINA UNIV OF MINING & TECH (BEIJING)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310907201.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2026-11-17
Estimated Expiration
2043-07-24

AI Technical Summary

Technical Problem

Traditional WebGL-based 3D GIS development methods suffer from high development difficulty, high cost, complex maintenance, complex component dependencies, large code volume, and poor functional modularity in agile development scenarios. In particular, when using ArcGIS Web AppBuilder, there are defects such as lag, strong dependencies, inability to modularize and encapsulate, and insufficient support for complex business logic.

Method used

It adopts a TypeScript-based widgetized 3D GIS framework system, assembling independent atomic functional components through DOM, CSS, and HTML technologies. It utilizes a Widget engine to parse configuration files, achieving modular design. Combined with Widget Config configuration items and Widget data transmission formats, it supports efficient data processing and high cohesion and low coupling between modules. It uses an Ajax i/o system for data transmission, supports multiple rendering engines, and provides flexible component combination and configuration.

Benefits of technology

It improves development efficiency, reduces development difficulty and cost, enhances system reusability and scalability, provides efficient data processing and interaction capabilities, simplifies development tasks, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116893802B_ABST
    Figure CN116893802B_ABST
Patent Text Reader

Abstract

This invention discloses a WebGL-based widgetized 3D GIS framework system. It employs TypeScript for logic design, utilizes Widget Config to manage and combine individual atomic components, uses a Widget engine for data processing, transmission, and caching, and leverages an Ajax I / O system for data transmission. The advantages of this invention include modularity, configurability, high efficiency and optimization, scalability, and convenience, enabling fast and accurate data processing and display; simplifying development tasks, reducing developer workload, and improving developer efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer geographic information graphics technology, and in particular to a widgetized 3D GIS framework system based on WebGL. Background Technology

[0002] With the development of the internet and the emergence of massive amounts of geographic information data, WebGIS-based applications have transformed desktop GIS from a professional analysis tool into a medium for conveying geographic information to a broad audience. As web front-end technologies and WebGL rapidly advance, the demands on WebGIS are increasing, leading to a continuous rise in the workload and difficulty of WebGIS development. Simultaneously, the pace of product and technology iteration in the current internet industry is accelerating, and agile development has become the norm. In this context of agile development, how to accelerate WebGIS development efficiency and reduce the workload and difficulty for developers has become a valuable research question.

[0003] Traditional WebGL-based 3D GIS development utilizes upper-layer services provided by commercial map development platforms such as ArcGIS, Baidu Maps, and Gaode Maps, or open-source map libraries like OpenLayer, MapBox, and Cesium. While commercial map platforms like ArcGIS offer advantages such as ease of use, intuitiveness, and out-of-the-box functionality, they also suffer from low openness, numerous developer restrictions, and high purchase and maintenance costs. Open-source map libraries like Cesium offer high flexibility, strong extensibility, and fewer restrictions, but this greater flexibility leads to greater complexity. As GIS functionality becomes more complex, the amount of code increases dramatically, resulting in large, complex structures and difficulties in later reuse. These issues make traditional WebGL-based 3D GIS development methods less effective in today's agile development scenarios.

[0004] Traditional B / S architecture WebGIS employs Web componentization to reduce the complexity of GIS functions. Web componentization focuses on the subdivision of system functions, encapsulating the HTML, CSS, and JavaScript required for each function into a component, increasing its cohesion and reducing coupling with the outside world. However, implementing Web componentization requires establishing complex communication mechanisms between different components. Furthermore, by breaking down the application into independent, reusable components, the dependencies and state management between these components become relatively complex, increasing application maintenance costs. In-depth analysis and design of component dependencies and state management are also required, along with extensive testing and debugging, further increasing development difficulty and cost. Web widget technology, on the other hand, offers strong reusability, scalability, and maintainability, effectively solving these problems.

[0005] Existing technologies typically use ArcGIS Web AppBuilder to build widgetized 3D WebGIS systems;

[0006] However, it has the following drawbacks:

[0007] 1. Web AppBuilder is built using the Dojo framework. The framework is too heavy and will load extra files. In addition, Web AppBuilder is a pure network request, and when there are many widget requests, the lag is obvious.

[0008] 2. Using Web AppBuilder requires an ArcGIS organization account or ArcGIS Developer account and is highly dependent.

[0009] 3. Unable to modularize and encapsulate widget functionality.

[0010] 4. Poor support for complex business logic and functional applications in 3D scenes.

[0011] 5. The number of functional widgets in the 3D scene is small.

[0012] 6. Poor support for advanced WebGL open-source libraries.

[0013] 7. The Web AppBuilder software has a complex operating environment and must be hosted on a portal or online platform, which poses a significant obstacle to its use by developers or users.

[0014] Since Web 2.0, web developers have increased their use of more complex interaction mechanisms, visual effects, and widgets to design Rich Internet Application (RIA) user interfaces. Since the advent of Web 2.0 and the "Ajax Movement," developers have been deploying web applications with dynamic content, which is presented as standalone widgets on the web. Furthermore, JavaScript programming is increasingly used to deploy complex interaction mechanisms and visual effects to provide rich user experiences. Web widgets are lightweight, standalone application modules that are typically embedded in web pages to provide specific functions or services. Web widgets are more flexible and easier to use; they can be embedded into WebGIS through simple configuration, offering reusability and significantly reducing development costs and complexity, allowing even non-professional developers to easily meet their needs. Web widgets are also easier to manage and deploy, often deployed independently, separated from the main application, allowing for independent updates, maintenance, and management without compromising the security and stability of the main application. Web Widgets are more efficient and reliable. They enable interaction and collaboration between components through certain communication mechanisms, allowing modules to work more efficiently and reliably. At the same time, Web Widgets can also achieve asynchronous loading and dynamic updates of Widget modules, thereby improving the performance and user experience of WebGIS systems. Summary of the Invention

[0015] This invention addresses the shortcomings of existing technologies by providing a WebGL-based widgetized 3D GIS framework system. This system enables more efficient construction of web applications and, by combining Web widgetization technology with 3D GIS for rapid development tasks in WebGIS development, simplifies development processes, reduces the workload of developers, and improves their efficiency. This is of great significance for accelerating the development speed of WebGIS systems.

[0016] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:

[0017] A WebGL-based widgetized 3D GIS framework system is designed with TypeScript as the logic and assembles independent atomic functional components using DOM, CSS, and HTML technologies. These atomic functional components are then extracted and combined into different Widget modules. The Widget engine parses the configuration files to automatically manage the system's functions and layout.

[0018] The widget-based 3D GIS framework system includes: Widget engine, Widget Config configuration items, Widget atomic functional component set, and Widget data transmission format.

[0019] The Widget engine is responsible for processing, transmitting, and controlling data caching, while also wrapping widget modules using HTML and CSS. It leverages the Document Object Model (DOM) and Browser Object Model (BOM) to support its communication model, achieving high cohesion and low coupling between modules through a message publishing pattern. By introducing isomorphic renderers (canvas, WebGL, etc.) and data management tools (three.js, cesium.js, etc.), it enables graphical representation and data management of 3D scenes.

[0020] The Widget Config option is responsible for changing the type of imported Widgets, allowing the system to determine which Widget modules to load during initialization based on the passed-in configuration list. It also allows configuration of how and when Widget modules are loaded, as well as setting the inclusion relationships between them. Through Widget Config, users can freely combine Widget modules or their internal atomic components, and change the structure and functionality of Widget modules.

[0021] A set of atomic functional components for a Widget consists of a collection of independent functional components, which, after being configured by Widget Config, form the target Widget module. Each atomic functional component contains three parts: an HTML template, business logic, and style definition. These are responsible for the component's prototype and structure, business logic processing and dynamic rendering code, and style definition and appearance enhancement, respectively.

[0022] Widget data transmission: Data transmission is performed using the Ajax I / O system (Axios), with JSON data format used for front-end and back-end data exchange. This enables fast data transfer and efficient processing, while also ensuring data security and reliability.

[0023] Furthermore, the structure of a Widget atomic functional component is as follows:

[0024] HTML Templates: Using <template>The `<prototype>` tag is used to define the component's prototype and structure. This section is responsible for showcasing the component's main content and layout structure.

[0025] Business logic: Use <script>标签编写,包含组件的业务逻辑处理和动态渲染代码。其中,name属性用于声明组件名称,应使用驼峰形式命名,作为组件的唯一标识符并在WidgetConfig配置项中使用作为依赖声明。此外,该部分也可以包括一些对外部数据的监测和处理逻辑。

[0026] 样式定义:使用<style>标签编写,定义组件的样式和外观。该部分负责组件的美化和风格定义。

[0027] 进一步地,所述Widget Config配置项是通过配置独立的.ts文件,用来配置Widget模块的构成,将Widget模块的基本属性、Widget原子功能组件加载路径、从属子Widget模块以及Widget模块的加载方式或者可操作事件以树状结构的形式进行存储;Widget模块对应一个Widget Config配置项,每个配置文件相互独立,并且由自动化脚本将Widget Config整合,并导出存为一个数组数据,由Widget引擎解析得到配置完成的功能模块。

[0028] 进一步地,所述Widget Config配置项由组件配置项和界面配置项两部分组成,

[0029] 组件配置项是一个数组对象,每一个对象包含id、container、component、preload四个属性;

[0030] id:用来唯一确定Widget的标识,每一个Widget模型中均会定义一个id,通过与配置项进行匹配,决定Widget模块中每个Widget原子组件的加载。

[0031] container:将浏览器视窗看作一个大容器,按比例分割为7个小容器,分别为top、bottom、left、right、centerFront、centerMain、centerBack,用7个枚举类型表示。通过配置对应的Widget模块载入显示的区域。

[0032] component:决定Widget模块是否使用懒加载的形式进行。

[0033] preload:决定Widget模块是否使用预加载。

[0034] 界面配置项是一个数组对象,以树状结构表示Widget模块与独立Widget之间的层级关系,每一个对象包含name、index、path、type、icon、children五个属性;

[0035] name:用来决定当前Widget模块在菜单中的名称。

[0036] index:是一个整数,通过index来决定Widget模块在菜单中的先后顺序,index越大,在菜单中的显示越靠前。

[0037] path:每一个Widget会声明一个唯一的name,通过将name配置到path中,来决定当前菜单需要加载的Widget,与组件配置项中的id是同一个值。

[0038] type:定义菜单对象的枚举类型,包括Widget、Route、URL、Action四种,不同的类型决定了当前菜单对象的加载形式。

[0039] icon:菜单中Widget的SVG图标。

[0040] children:Widget模块所包含的独立Widget,是一个数组对象,构成与菜单配置项一致。

[0041] 进一步地,Widget数据传输格式使用JSON。Widget Config配置项导出为数组数据后,会被Widget引擎序列化为JSON格式,利用JSON的跨平台性,将平台Widget数据信息传递给后台进行权限分配操作。

[0042] 进一步地,JSON数据传输文件由id、name、product、version、routes、widgetMenu、widgets构成。id是根据用户权限和当前平台版本哈希得到,name是平台名称,product为产品名称,version为当前平台版本,routes为系统功能模块的组成,以及全局组件的包含关系;widgetMenu为当前权限下,用户的widget菜单构成;widgetMenu与序列化前的界面配置项构成一致;widgets为当前权限下,用户所拥有的Widget原子功能组件;widgets是序列化前所有组件配置项的Widget原子功能组件集合。

[0043] 进一步地,所述widgetMenu对象包括以下属性:

[0044] name:表示该菜单项的名称,例如这里的名称为"图上量算"。

[0045] index:表示该菜单项在菜单栏中的索引位置,例如这里的值为22。

[0046] path:表示该菜单项所对应的Widget模块的引用路径,例如这里的值为"measurewidget"。

[0047] type:表示该菜单项所对应的Widget模块的类型。

[0048] children:表示该菜单项的子菜单项,是一个数组类型,包含多个子属性对象,每个子属性对象表示一个子菜单项。

[0049] 每个子菜单项包括以下属性:

[0050] name:表示子菜单项的名称。

[0051] path:表示子菜单项所对应的Widget模块引用路径。

[0052] type:表示子菜单项所对应的Widget模块的类型。

[0053] 进一步地,所述widgets的属性对象包含了多个子属性对象,每个子属性对象代表一个Widget模块。每个子属性对象有三个属性:id、container和preload。

[0054] id表示该Widget模块的唯一标识符;

[0055] container表示该Widget模块在页面上的容器位置,不同的值代表不同的容器;

[0056] preload表示该Widget模块是否被预加载。

[0057] 进一步地,用户可以对下发的JSON数据中的widgetMenu进行修改,从widgets中选取已有的Widget原子功能组件进行组合,将修改后的JSON数据传送到服务器,服务器就会解析JSON,对用户界面和功能进行更新,本地JSON更新流程如下:

[0058] Widget引擎序列化的Widget Config转换为JSON数据下发,会对本地JSON进行判断,如果不需要更新则使用上一次保存在本地的JSON数据对系统平台的功能和界面进行更新;如果需要更新,判断当前是本地环境还是线上平台环境,对于线上环境则直接下发新的配置JSON数据,本地环境则将本地更新的JSON上传至服务器,服务器将数据传送给平台,完成对系统平台的功能和界面更新。

[0059] 进一步地,所述Widget引擎通过解析Widget Config配置项中导出的数组数据,抓取封装完整的Widget模块,将Widget模块的HTML结构,CSS样式渲染至页面,并获取Widget模块中TypeScript中的数据,根据TypeScript的事件驱动原理进行数据交互,根据WidgetConfig配置项中设置的预加载或懒加载类型,决定模块的加载顺序和加载时机;Widget引擎定义了一个Widget管理类,将解析获得配置项数组,存放在其实例化对象中。

[0060] 进一步地,Widget引擎执行流程如下:Widget Config将导出的配置项数据,传入到Widget引擎中,根据配置项数据的结构解析传入到Widget管理类的实例化对象LayoutManger中,在Vue生命周期进入到挂载阶段时,决定Widgets模块的加载形式。当Widget进入到加载阶段时,Widget引擎会判断当前模块是否已经被预加载,满足预加载触发机制,就会从缓存中直接获取Widget模块组件,不再进行逻辑判断。首次加载时,会根据LayoutManger中的WidgetID,获取对应Widget的配置,然后进行加载渲染,Widget引擎会分析当前ID对应的Widget Config中包含的上层父级Widget模块或者下层子级Widget模块是否被加载,只有当前置的依赖Widget被加载时,才能够将当前Widget模块加载进入系统,如果依赖链没有闭合,就会向上递归加载父级依赖Widget模块,直到依赖关系完全。Widget模块卸载时,当前ID的Widget模块所包含的所有子级Widget均会被卸载掉。Widget模块的加载和卸载行为,会被Widget引擎中的事件总线监听,自动更新Widget Config的配置项数据,实现Widget的自动化更新。

[0061] 与现有技术相比,本发明的优点在于:

[0062] 1.模块化:该系统采用微件化的设计理念,将原子功能组件集进行抽离,再组合为不同的Widget模块,使得系统的功能可重用性和可扩展性得到了显著提高。

[0063] 2.可配置化:Widget Config配置项提供了改变引入Widget类别、设置Widget模块的加载方式、以及组合内部原子组件的功能,使得系统可以根据不同的业务需求进行轻松的调整和定制。

[0064] 3.高效优化:通过Widget引擎的优秀数据管理和渲染机制,以及Widget数据传输基于JSON格式的快速传输和处理,使得系统具有高效优化的特点,能够快速、精准地进行数据处理、显示和交互。

[0065] 4.可扩展性:该系统支持引用不同的渲染引擎,扩展新的Widget模块,根据不同的项目需求灵活选择使用的三维渲染引擎,从而实现系统的可扩展性。

[0066] 5.便捷性:该系统使用TypeScript进行逻辑设计,具有高度的可读性和可维护性,通过使用HTML、CSS、DOM等前端开发的技术,可以实现快速的开发、部署和运维,从而提高了开发效率和系统性能。

[0067] 6.Widget引擎以Widget Config作为框架数据源,基于其运行机制,WebGIS平台功能以及界面的控制是由Widget Config配置项决定,因此用户新增原子组件或Widget模块时只需要完成功能代码,并向Widget Config添加对应组件配置和界面配置,即可完成功能与界面的更新,无需再次关注复杂的组件逻辑,极大降低心智负担。

[0068] 7.提供高效、可配置、高度可视化的三维空间数据处理和分析功能,为用户提供更加直观、真实、有趣的工作和生活体验。用户可以根据自己的需要,自由组合构建和设计各种不同的Widget模块和原子功能组件,以满足不同的业务需求。同时,基于WebGL技术的渲染引擎,使得系统可以处理大规模的数据处理和可视化,展示更加详细、真实的三维空间信息,从而为用户提供更加高效、准确、及时的决策支持。简化开发任务,减少开发人员的工作量,提高开发人员的工作效率。附图说明

[0069] 图1是本发明实施例基于WebGL的微件化三维GIS框架系统结构示意图;

[0070] 图2是本发明实施例Widget原子功能组件结构示意图;

[0071] 图3是本发明实施例Widget Config配置项文件结构示意图;a为组件配置项,b为界面配置项;

[0072] 图4是本发明实施例JSON数据格式结构图;

[0073] 图5是本发明实施例widgetMenu组成结构图;

[0074] 图6是本发明实施例widgets组成结构图;

[0075] 图7是本发明实施例JSON更新流程图;

[0076] 图8是本发明实施例Widget引擎执行流程图。具体实施方式

[0077] 为使本发明的目的、技术方案及优点更加清楚明白,以下根据附图并列举实施例,对本发明做进一步详细说明。

[0078] 一、基于WebGL的微件化三维GIS框架系统概述

[0079] 本发明所述的一种基于WebGL的微件化三维GIS框架系统是可配置化、高度灵活、低耦合度的框架系统,Widget框架是基于TypeScript进行逻辑设计,并通过DOM、CSS、HTML技术组装相互独立的原子功能组件,从原子功能组件集合中进行抽离,组合为各个不同的Widget模块,利用Widget引擎解析配置化文件,对系统功能和布局进行自动管理。微件化三维GIS框架系统分为Widget引擎、Widget Config配置项、Widget原子功能组件集、Widget数据传输格式三个部分。其中最重要的部分即Widget引擎。Widget引擎负责处理数据、传递数据以及控制数据缓存,并通过HTML、CSS包装Widget模块,依靠文档对象模型(DOM)和浏览器对象模型(BOM)支撑Widget引擎的通讯模型,利用Widget通讯模型的消息发布模式,实现模块间的高内聚低耦合特性。Widget Config配置项可以改变引入Widget类别,让系统初始化时根据传入配置项列表决定加载的Widget模块,并且能够配置Widget模块的加载方式、加载时机以及设置Widget模块间的包含关系,并且基于Widget Config,用户可以对Widget模块或内部原子组件进行自由组合,以及改变Widget模块的构成功能,是Widget通讯模型的基础支持。Widget原子功能组件集是Widget模块构成的基本元素,是相互独立的功能组件集合,通过Widget Config进行配置,构成目标Widget模块。Widget数据传输是基于Ajax i / o system(Axios)进行数据传输,通过JSON数据格式进行前后端数据交换。图1描述了完整的Widget框架设计。

[0080] 二、Widget原子功能组件集

[0081] 原子组件是一个具有明确定义的功能和界面的UI组件,通常只有一个非常具体的目的和用途,它们可以被组合成更复杂的UI组件或页面,但本身不包含其他组件或模块,由HTML,CSS构成原子组件样式,TypeScript完成功能逻辑。Widget原子功能组件集,是基于Cesium,在Vue框架下对GIS分析常用的功能扩展至三维场景进行封装,包括绘制点线面,测量距离,计算等高线等功能,本发明封装了80余Widget原子功能组件,能够涵盖用户基本功能需求。Widget原子功能组件集是构成Widget模块的支撑,图2为Widget原子功能组件的构成。

[0082] template标签为Widget原子功能组件的HTML编写入口;script标签为业务功能逻辑编写入口,三维功能处理放在script中,其中name需要单独申明,以驼峰形式命名当前原子功能组件,是每个独立Widget原子功能组件的唯一标识,同时是Widget Config配置项解析组合成为Widget模块的关键依赖;style标签为Widget原子功能组件的CSS编写入口。

[0083] 三、Widget Config配置项

[0084] Widget Config配置项是通过配置独立的.ts文件,用来配置Widget模块的构成,将Widget模块的基本属性、Widget原子功能组件加载路径、从属子Widget模块以及Widget模块的加载方式或者可操作事件以树状结构的形式进行存储。Widget Config配置项主要由组件配置项和界面配置项两部分组成,如图3所示为Widget Config配置项文件,a为组件配置项,b为界面配置项。

[0085] 组件配置项是一个数组对象,每一个对象包含id、container、component、preload四个属性,组件配置项的描述如表1所示。

[0086] 表1组件配置项

[0087]

[0088] id:用来唯一确定Widget的标识,每一个Widget模型中均会定义一个id,通过与配置项进行匹配,决定Widget模块中每个Widget原子组件的加载。

[0089] container:本发明将浏览器视窗看作一个大容器,按比例分割为7个小容器,分别为top、bottom、left、right、centerFront、centerMain、centerBack,用7个枚举类型表示。通过配置对应的Widget模块载入显示的区域。

[0090] component:决定Widget模块是否使用懒加载的形式进行。

[0091] preload:决定Widget模块是否使用预加载。

[0092] 界面配置项是一个数组对象,以树状结构表示Widget模块与独立Widget之间的层级关系,每一个对象包含name、index、path、type、icon、children五个属性,界面配置项的描述如表2所示。

[0093] 表2界面配置项

[0094]

[0095] name:用来决定当前Widget模块在菜单中的名称。

[0096] index:是一个整数,通过index来决定Widget模块在菜单中的先后顺序,index越大,在菜单中的显示越靠前。

[0097] path:每一个Widget会声明一个唯一的name,通过将name配置到path中,来决定当前菜单需要加载的Widget,与组件配置项中的id是同一个值。

[0098] type:定义菜单对象的枚举类型,包括Widget、Route、URL、Action四种,不同的类型决定了当前菜单对象的加载形式。

[0099] icon:菜单中Widget的SVG图标。

[0100] children:Widget模块所包含的独立Widget,是一个数组对象,构成与菜单配置项一致。

[0101] Widget模块对应一个Widget Config配置项,每个配置文件相互独立,并且由自动化脚本将Widget Config整合,并导出存为一个数组数据,由Widget引擎解析得到配置完成的功能模块。

[0102] 三、Widget数据传输格式

[0103] Web系统开发中,常见的数据传输格式为JSON格式与XML格式。

[0104] XML扩展标记语言(Extensible Markup Language,XML),用于标记电子文件使其具有结构性的标记语言,可以用来标记数据、定义数据类型,是一种允许用户对自己的标记语言进行定义的源语言。但XML文件庞大,文件格式复杂,传输占带宽,并且客户端不同浏览器之间解析XML的方式不一致,需要重复编写很多代码,导致资源和时间的浪费。

[0105] JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,具有良好的可读和便于快速编写的特性。可在不同平台之间进行数据交换。数据格式比较简单,易于读写,格式都是压缩的,占用带宽小。

[0106] 通过比较两者的区别,由于Widget框架是基于TypeScript进行开发,将数据转换成JSON有天然的优势,因此选择使用JSON作为Widget数据传输格式。Widget Config配置项导出为数组数据后,会被Widget引擎序列化为JSON格式,利用JSON的跨平台性,将平台Widget数据信息传递给后台进行权限分配等相应操作。

[0107] 如图4所示,JSON数据传输文件由id、name、product、version、routes、widgetMenu、widgets构成。id是根据用户权限和当前平台版本哈希得到,name是平台名称,product为产品名称,version为当前平台版本,routes为系统功能模块的组成,以及全局组件的包含关系;

[0108] widgetMenu为当前权限下,用户的widget菜单构成;widgetMenu与序列化前的界面配置项构成一致;

[0109] 如图5所示,widgetMenu对象包括以下属性:

[0110] name:表示该菜单项的名称,这里的名称为"图上量算"。

[0111] index:表示该菜单项在菜单栏中的索引位置,这里的值为22。

[0112] path:表示该菜单项所对应的Widget模块的引用路径,这里的值为"measurewidget"。

[0113] type:表示该菜单项所对应的Widget模块的类型。

[0114] children:表示该菜单项的子菜单项,是一个数组类型,包含多个子属性对象,每个子属性对象表示一个子菜单项。

[0115] 每个子菜单项包括以下属性:

[0116] name:表示子菜单项的名称。

[0117] path:表示子菜单项所对应的Widget模块引用路径。

[0118] type:表示子菜单项所对应的Widget模块的类型。

[0119] widgets为当前权限下,用户所拥有的Widget原子功能组件;widgets是序列化前所有组件配置项的Widget原子功能组件集合。

[0120] 如图6所示,widgets的属性对象包含了多个子属性对象,每个子属性对象代表一个Widget模块。每个子属性对象有三个属性:id、container和preload。

[0121] id表示该Widget模块的唯一标识符;

[0122] container表示该Widget模块在页面上的容器位置,不同的值代表不同的容器;

[0123] preload表示该Widget模块是否被预加载。

[0124] 用户可以对下发的JSON数据中的widgetMenu进行修改,从widgets中选取已有的Widget原子功能组件进行组合,将修改后的JSON数据传送到服务器,服务器就会解析JSON,对用户界面和功能进行更新,本地JSON更新流程如图7所示。

[0125] Widget引擎序列化的Widget Config转换为JSON数据下发,会对本地JSON进行判断,如果不需要更新则使用上一次保存在本地的JSON数据对系统平台的功能和界面进行更新;如果需要更新,判断当前是本地环境还是线上平台环境,对于线上环境则直接下发新的配置JSON数据,本地环境则将本地更新的JSON上传至服务器,服务器将数据传送给平台,完成对系统平台的功能和界面更新。

[0126] 四、Widget引擎

[0127] Widget引擎通过解析Widget Config配置项中导出的数组数据,抓取封装完整的Widget模块,将Widget模块的HTML结构,CSS样式渲染至页面,并获取Widget模块中TypeScript中的数据,根据TypeScript的事件驱动原理进行数据交互,根据Widget Config配置项中设置的预加载或懒加载类型,决定模块的加载顺序和加载时机。

[0128] Widget引擎定义了一个Widget管理类,将解析获得配置项数组,存放在其实例化对象中。Widget管理类的API说明,如表3所示。

[0129] 表3Widget管理类API说明

[0130]

[0131] Widget Config将导出的配置项数据,传入到Widget引擎中,根据配置项数据的结构解析传入到Widget管理类的实例化对象LayoutManger中,在Vue生命周期进入到挂载阶段时,决定Widgets模块的加载形式。当Widget进入到加载阶段时,Widget引擎会判断当前模块是否已经被预加载,满足预加载触发机制,就会从缓存中直接获取Widget模块组件,不再进行逻辑判断。首次加载时,会根据LayoutManger中的WidgetID,获取对应Widget的配置,然后进行加载渲染,Widget引擎会分析当前ID对应的Widget Config中包含的上层父级Widget模块或者下层子级Widget模块是否被加载,只有当前置的依赖Widget被加载时,才能够将当前Widget模块加载进入系统,如果依赖链没有闭合,就会向上递归加载父级依赖Widget模块,直到依赖关系完全。Widget模块卸载时,当前ID的Widget模块所包含的所有子级Widget均会被卸载掉。Widget模块的加载和卸载行为,会被Widget引擎中的事件总线监听,自动更新Widget Config的配置项数据,实现Widget的自动化更新。Widget引擎执行流程如图8所示。

[0132] Widget引擎以Widget Config作为框架数据源,基于其运行机制,WebGIS平台功能以及界面的控制是由Widget Config配置项决定,因此用户新增原子组件或Widget模块时只需要完成功能代码,并向Widget Config添加对应组件配置和界面配置,即可完成功能与界面的更新,无需再次关注复杂的组件逻辑,极大降低心智负担。

[0133] Widget引擎采用事件驱动模型作为Widget模块间交互的基础即Widget通讯模型的核心,被集成在Widget引擎中,能够直接对客户端输入作出响应,通过监听具体事件形为,触发对应的处理逻辑,实现框架的自动化流程处理,它具有以下几个方面的优点:

[0134] (1)松耦合。事件发布者和事件订阅者无需知道对方的存在。

[0135] (2)多对多。一个Widget模块既可以作为消息的输入,也可以作为消息的输出,并且每个Widget模块之间是独立的,可以相互组合。

[0136] (3)细粒度。Widget引擎会将每个模块的事件响应结果保存,其他模块可以拿到当前Widget模块事件触发的所有数据,然后进行具体的响应事件处理。

[0137] 本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。

[0138] 本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和 / 或方框图来描述的。应理解可由计算机程序指令实现流程图和 / 或方框图中的每一流程和 / 或方框、以及流程图和 / 或方框图中的流程和 / 或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和 / 或方框图一个方框或多个方框中指定的功能的装置。

[0139] 这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和 / 或方框图一个方框或多个方框中指定的功能。

[0140] 这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和 / 或方框图一个方框或多个方框中指定的功能的步骤。

[0141] 本领域的普通技术人员将会意识到,这里所述的实施例是为了帮助读者理解本发明的实施方法,应被理解为本发明的保护范围并不局限于这样的特别陈述和实施例。本领域的普通技术人员可以根据本发明公开的这些技术启示做出各种不脱离本发明实质的其它各种具体变形和组合,这些变形和组合仍然在本发明的保护范围内。< / script> < / template>

Claims

1. A WebGL-based widgetized 3D GIS framework system, which is logically designed based on TypeScript and assembled into independent atomic functional components through DOM, CSS, and HTML technologies. The atomic functional components are extracted and combined into different Widget modules. The Widget engine is used to parse the configuration file and automatically manage the system functions and layout. The widget-based 3D GIS framework system includes: Widget engine, Widget Config configuration items, Widget atomic functional component set, and Widget data transmission format; Widget Engine: Responsible for processing, transmitting, and controlling data caching, while wrapping Widget modules with HTML and CSS; it uses the Document Object Model and Browser Object Model to support the communication model of the Widget Engine, and achieves high cohesion and low coupling between modules through the message publishing mode of the Widget communication model; by introducing isomorphic renderers and data management tools, it realizes the graphical representation and data management of 3D scenes. Widget Config configuration items: These are responsible for changing the type of Widget introduced, allowing the system to determine which Widget modules to load during initialization based on the list of configuration items passed in. They also configure the loading method and timing of Widget modules, as well as the inclusion relationship between Widget modules. Through Widget Config, users can freely combine Widget modules or their internal atomic components, and change the structure and functionality of Widget modules. Widget atomic functional component set: It consists of a collection of independent functional components, which are configured by Widget Config to form the target Widget module; Each atomic functional component contains three parts: HTML template, business logic and style definition, which are responsible for the component's prototype and structure, business logic processing and dynamic rendering code, and the component's style definition and appearance enhancement, respectively. Widget data transmission: Data transmission is performed using the Ajax i / o system, and data exchange between the front-end and back-end is conducted using JSON data format; The Widget engine parses the array data exported from the Widget Config configuration items, captures and encapsulates the complete Widget module, renders the HTML structure and CSS styles of the Widget module to the page, and obtains the data in the TypeScript of the Widget module. It performs data interaction based on the event-driven principle of TypeScript and determines the loading order and timing of the module according to the preloading or lazy loading type set in the Widget Config configuration items. The Widget engine defines a Widget management class, which stores the parsed configuration item array in its instantiated object. The Widget engine execution flow is as follows: The Widget Config passes the exported configuration data to the Widget engine. Based on the structure of the configuration data, it parses and passes it to the LayoutManager instance of the Widget management class. When Vue enters the mounting phase of its lifecycle, it determines the loading method of the Widget modules. When a Widget enters the loading phase, the Widget engine checks if the current module has already been preloaded. If the preloading trigger mechanism is met, the Widget module component is directly retrieved from the cache without further logical checks. On the first load, the engine retrieves the configuration of the corresponding Widget based on the WidgetID in the LayoutManager, and then loads and renders it. The Widget engine analyzes the Widget corresponding to the current ID. Whether the parent or child widget modules in the Config are loaded depends on the current widget module being loaded. The current widget module can only be loaded into the system when the current dependent widget is loaded. If the dependency chain is not closed, the parent dependent widget modules will be loaded recursively upwards until the dependency relationship is complete. When a widget module is unloaded, all child widgets contained in the widget module with the current ID will be unloaded. The loading and unloading behavior of widget modules is listened to by the event bus in the widget engine, which automatically updates the configuration item data of the widget Config, realizing the automatic update of widgets.

2. The widgetized 3D GIS framework system based on WebGL according to claim 1, characterized in that: The structure of a Widget atomic functional component is as follows: HTML Templates: Using <template> The tag section defines the component's prototype and structure; this section is responsible for showcasing the component's main content and layout structure.< / template> Business logic: Use <script>标签编写,包含组件的业务逻辑处理和动态渲染代码;其中,name属性用于声明组件名称,使用驼峰形式命名;样式定义:使用<style>标签编写,定义组件的样式和外观;该部分负责组件的美化和风格定义。3.根据权利要求1所述的一种基于WebGL的微件化三维GIS框架系统,其特征在于:所述Widget Config配置项是通过配置独立的.ts文件,用来配置Widget模块的构成,将Widget模块的基本属性、Widget原子功能组件加载路径、从属子Widget模块以及Widget模块的加载方式或者可操作事件以树状结构的形式进行存储;Widget模块对应一个Widget Config配置项,每个配置文件相互独立,并且由自动化脚本将Widget Config整合,并导出存为一个数组数据,由Widget引擎解析得到配置完成的功能模块。4.根据权利要求3所述的一种基于WebGL的微件化三维GIS框架系统,其特征在于:所述Widget Config配置项由组件配置项和界面配置项两部分组成,组件配置项是一个数组对象,每一个对象包含id、container、component、preload四个属性;id:用来唯一确定Widget的标识,每一个Widget模型中均会定义一个id,通过与配置项进行匹配,决定Widget模块中每个Widget原子组件的加载;container:将浏览器视窗看作一个大容器,按比例分割为7个小容器,分别为top、bottom、left、right、centerFront、centerMain、centerBack,用7个枚举类型表示;通过配置对应的Widget模块载入显示的区域;component:决定Widget模块是否使用懒加载的形式进行;preload:决定Widget模块是否使用预加载;界面配置项是一个数组对象,以树状结构表示Widget模块与独立Widget之间的层级关系,每一个对象包含name、index、path、type、icon、children五个属性;name:用来决定当前Widget模块在菜单中的名称;index:是一个整数,通过index来决定Widget模块在菜单中的先后顺序,index越大,在菜单中的显示越靠前;path:每一个Widget会声明一个唯一的name,通过将name配置到path中,来决定当前菜单需要加载的Widget,与组件配置项中的id是同一个值;type:定义菜单对象的枚举类型,包括Widget、Route、URL、Action四种,不同的类型决定了当前菜单对象的加载形式;icon:菜单中Widget的SVG图标;children:Widget模块所包含的独立Widget,是一个数组对象,构成与菜单配置项一致。5.根据权利要求1所述的一种基于WebGL的微件化三维GIS框架系统,其特征在于:Widget数据传输格式使用JSON;Widget Config配置项导出为数组数据后,会被Widget引擎序列化为JSON格式,利用JSON的跨平台性,将平台Widget数据信息传递给后台进行权限分配操作。6.根据权利要求5所述的一种基于WebGL的微件化三维GIS框架系统,其特征在于:JSON数据传输文件由id、name、product、version、routes、widgetMenu、widgets构成;id是根据用户权限和当前平台版本哈希得到,name是平台名称,product为产品名称,version为当前平台版本,routes为系统功能模块的组成,以及全局组件的包含关系;widgetMenu为当前权限下,用户的widget菜单构成;widgetMenu与序列化前的界面配置项构成一致;widgets为当前权限下,用户所拥有的Widget原子功能组件;widgets是序列化前所有组件配置项的Widget原子功能组件集合。7.根据权利要求6所述的一种基于WebGL的微件化三维GIS框架系统,其特征在于:所述widgetMenu包括以下属性:name: 表示菜单项的名称,这里的名称为"图上量算";index: 表示菜单项在菜单栏中的索引位置,这里的值为22;path: 表示菜单项所对应的Widget模块的引用路径,这里的值为"measurewidget";type: 表示菜单项所对应的Widget模块的类型;children: 表示菜单项的子菜单项,是一个数组类型,包含多个子属性对象,每个子属性对象表示一个子菜单项;每个子菜单项包括以下属性:name: 表示子菜单项的名称;path: 表示子菜单项所对应的Widget模块引用路径;type: 表示子菜单项所对应的Widget模块的类型;所述widgets的属性对象包含了多个子属性对象,每个子属性对象代表一个Widget模块;每个子属性对象有三个属性:id、container和preload;id表示该Widget模块的唯一标识符;container表示该Widget模块在页面上的容器位置,不同的值代表不同的容器;preload表示该Widget模块是否被预加载。8.根据权利要求7所述的一种基于WebGL的微件化三维GIS框架系统,其特征在于:用户可以对下发的JSON数据中的widgetMenu进行修改,从widgets中选取已有的Widget原子功能组件进行组合,将修改后的JSON数据传送到服务器,服务器就会解析JSON,对用户界面和功能进行更新,本地JSON更新流程如下:Widget引擎序列化的Widget Config转换为JSON数据下发,会对本地JSON进行判断,如果不需要更新则使用上一次保存在本地的JSON数据对系统平台的功能和界面进行更新;如果需要更新,判断当前是本地环境还是线上平台环境,对于线上环境则直接下发新的配置JSON数据,本地环境则将本地更新的JSON上传至服务器,服务器将数据传送给平台,完成对系统平台的功能和界面更新。< / script>

Citation Information

Patent Citations

  • Map application rapid construction method and construction system based on data driving

    CN111176620A

  • WEB system development framework based on combination of form drive combined with dynamic rule engine

    CN113849178A