mirage2d 1.2.57 → 1.2.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,11 +3,12 @@
3
3
  * @Date: 2022-01-13 22:43:45
4
4
  * @LastEditors: xd
5
5
  * @LastEditTime: 2023-06-02 16:40:19
6
- * @Description: 功能
6
+ * @Description: 功能 - 支持天地图WFS服务
7
7
  */
8
8
  import { IWFSFeatureOption } from "../../base/baseOptionType";
9
9
  import { GraphicLayer } from "./GraphicLayer";
10
10
  export declare class WfsLayer extends GraphicLayer {
11
+ static readonly CHINA_BBOX = "73,18,135,54,EPSG:4326";
11
12
  geoserverData: {
12
13
  wsName: string;
13
14
  uri: string;
@@ -24,45 +25,60 @@ export declare class WfsLayer extends GraphicLayer {
24
25
  } | any;
25
26
  defaultExtent: any;
26
27
  isLoading: boolean;
27
- /**
28
- * 设置要素属性
29
- * @param {string} layerid
30
- * @param {IWFSFeatureOption} options 要素属性数组
31
- * @example IWFSFeatureOption 中queryParams默认属性
32
- * queryParams = {
33
- service: "WFS",
34
- request: "GetFeature",
35
- version: "1.0.0",
36
- outputFormat: "application/json",
37
- maxFeatures: "1000",
38
- typeName: "mars:hfjy",
39
- bbox: "", // 范围,不传递时默认当前视图范围
40
- filter: "", // 空间查询条件,当传递feature时系统自动生成 也可以自行配置GML格式
41
- queryField: "", //属性查询字段
42
- querykeyword: "",//属性查询字段关键字
43
- autoShowFeature: false//自动显示,默认关闭,打开时会根据视图变化自动加载数据
44
- }
45
- */
28
+ private queryTimeout;
29
+ private moveEndHandler;
30
+ private resolutionHandler;
31
+ private lastExtent;
32
+ private geoJSONFormat;
46
33
  constructor(layerid: string, options?: IWFSFeatureOption);
34
+ private initEventHandlers;
35
+ private shouldQuery;
36
+ /**
37
+ * 从多边形几何对象中提取坐标字符串(用于Filter)
38
+ */
39
+ private getCoordinatesFromGeometry;
40
+ /**
41
+ * 从GeoJSON几何对象中提取坐标字符串
42
+ */
43
+ private getCoordinatesFromGeoJSON;
44
+ /**
45
+ * 构建WFS请求URL
46
+ */
47
+ private buildRequestUrl;
48
+ /**
49
+ * 处理JSON响应
50
+ */
51
+ private processJsonResponse;
47
52
  private queryData;
53
+ private executeQuery;
48
54
  /**
49
- * :查询数据方法
50
- * @param {any} queryParams 可根据wfs查询参数自定义配置
51
- * @example 默认属性
52
- * queryParams = {
53
- service: "WFS",
54
- request: "GetFeature",
55
- version: "1.0.0",
56
- outputFormat: "application/json",
57
- maxFeatures: "1000",
58
- typeName: "mars:hfjy",
59
- feature: //地图上绘制的feature:
60
- bbox: "", // 范围,不传递时默认当前视图范围
61
- filter: "", // 空间查询条件,当传递feature时系统自动生成 也可以自行配置GML格式
62
- queryField: "", //属性查询字段
63
- querykeyword: "",//属性查询字段关键字
64
- autoShowFeature: false//自动显示,默认关闭,打开时会根据视图变化自动加载数据
65
- }
66
- */
55
+ * 查询数据方法
56
+ * @param {any} queryParams 可根据wfs查询参数自定义配置
57
+ */
67
58
  query(queryParams?: {}): void;
59
+ /**
60
+ * 设置图层类型
61
+ * @param layerType 图层类型 (HYDL, HYDA, LRDL, BOUL, AANP)
62
+ */
63
+ setLayerType(layerType: string): void;
64
+ /**
65
+ * 设置中国范围过滤
66
+ */
67
+ enableChinaFilter(): void;
68
+ /**
69
+ * 禁用范围过滤
70
+ */
71
+ disableFilter(): void;
72
+ /**
73
+ * 清除所有要素
74
+ */
75
+ clearFeatures(): void;
76
+ /**
77
+ * 设置图层可见性
78
+ */
79
+ setVisible(visible: boolean): void;
80
+ /**
81
+ * 销毁图层
82
+ */
83
+ destroy(): void;
68
84
  }
@@ -111,6 +111,8 @@ export interface IArcGisFeatureOption extends IGraphicLayerOption {
111
111
  };
112
112
  }
113
113
  export interface IWFSFeatureOption extends IGraphicLayerOption {
114
+ url: string;
115
+ tk?: string;
114
116
  queryParams: {
115
117
  service?: string;
116
118
  request?: string;
@@ -124,6 +126,7 @@ export interface IWFSFeatureOption extends IGraphicLayerOption {
124
126
  queryField?: string;
125
127
  querykeyword?: string;
126
128
  autoShowFeature?: boolean;
129
+ [key: string]: any;
127
130
  };
128
131
  }
129
132
  export interface IImageCanvasLayerOption extends ILayerOption {