mirage2d 1.1.67 → 1.1.69

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.
@@ -15,6 +15,8 @@ export declare class baseGraphicLayer extends baseLayer {
15
15
  option: IGraphicLayerOption;
16
16
  constructor(layerid: string, Options?: IGraphicLayerOption);
17
17
  initSelect(): void;
18
+ startMove(): void;
19
+ endMove(): void;
18
20
  startEdit(): void;
19
21
  endEdit(): void;
20
22
  bindContextmenu(menu: any): void;
@@ -1,6 +1,5 @@
1
- import { Style, Icon } from 'ol/style';
1
+ import { Style } from 'ol/style';
2
2
  import { Coordinate } from "ol/coordinate";
3
- import FillPattern from "ol-ext/style/FillPattern";
4
3
  import { crsType, featuretype } from "../Enum/typeEnum";
5
4
  export interface IContextmenu {
6
5
  classname?: string;
@@ -138,45 +137,49 @@ export interface IClusterImageLayerOption extends IGraphicLayerOption {
138
137
  animationDuration?: number;
139
138
  maxResolution?: number;
140
139
  }
141
- interface ITextOption {
140
+ export interface ITextOption {
142
141
  font?: string;
143
142
  text?: string;
144
- fill?: IFilleOption;
143
+ fill?: IFillOption;
145
144
  stroke?: IStrokeOption;
146
- backgroundFill?: IFilleOption;
145
+ backgroundFill?: IFillOption;
147
146
  backgroundStroke?: IStrokeOption;
148
147
  padding?: Array<number>;
149
148
  offsetX?: number;
150
149
  offsetY?: number;
151
150
  textBaseline?: string;
152
151
  }
153
- interface IStrokeOption {
152
+ export interface IStrokeOption {
154
153
  color?: string;
155
154
  width?: number;
156
155
  lineDash?: Array<number>;
156
+ image?: string | undefined;
157
157
  opacity?: number;
158
- pattern?: FillPattern | string | undefined;
158
+ pattern?: string | undefined;
159
159
  patternColor?: string;
160
160
  offset?: number;
161
161
  size?: number;
162
162
  spacing?: number;
163
163
  angle?: number;
164
164
  scale?: number;
165
+ ratio?: number;
165
166
  }
166
- interface IFilleOption {
167
+ export interface IFillOption {
167
168
  color?: string;
168
- Image?: Icon | undefined;
169
+ image?: string;
169
170
  opacity?: number;
170
- pattern?: FillPattern | string | undefined;
171
+ pattern?: string | undefined;
171
172
  patternColor?: string;
172
173
  offset?: number;
173
174
  size?: number;
174
175
  spacing?: number;
175
176
  angle?: number;
176
177
  scale?: number;
178
+ ratio?: number;
177
179
  }
178
180
  export interface IGraphicOption {
179
181
  lnglat?: Array<number> | Coordinate[][] | any;
182
+ graphicType: string;
180
183
  dataWkID?: crsType | string;
181
184
  attribute?: any;
182
185
  popupInfo?: any;
@@ -189,57 +192,57 @@ export interface IGraphicOption {
189
192
  };
190
193
  style?: any;
191
194
  }
195
+ export interface IImageStyle {
196
+ scale?: number;
197
+ radius?: number;
198
+ fill?: IFillOption;
199
+ stroke?: IStrokeOption;
200
+ }
201
+ export interface ILabelStyle {
202
+ text?: ITextOption;
203
+ image?: IImageStyle;
204
+ zIndex?: number;
205
+ }
192
206
  export interface ILabelOption extends IGraphicOption {
193
- style?: {
194
- text?: ITextOption;
195
- image?: {
196
- radius?: number;
197
- scale?: number;
198
- fill?: IFilleOption;
199
- stroke?: IStrokeOption;
200
- };
201
- zIndex?: number;
202
- };
207
+ style: IPointStyle;
208
+ }
209
+ export interface IPointStyle {
210
+ text?: ITextOption;
211
+ image?: IImageStyle;
212
+ zIndex?: number;
203
213
  }
204
214
  export interface IPointOption extends IGraphicOption {
205
- style?: {
206
- text?: ITextOption;
207
- image?: {
208
- radius?: number;
209
- scale?: number;
210
- fill?: IFilleOption;
211
- stroke?: IStrokeOption;
212
- };
213
- zIndex?: number;
214
- };
215
+ style: IPointStyle;
215
216
  }
216
217
  export interface IimagePointOption extends IGraphicOption {
217
- style?: {
218
+ style: {
218
219
  text: ITextOption;
219
220
  imageOption: any;
220
221
  zIndex?: number;
221
222
  };
222
223
  }
224
+ export interface IPolylineStyle {
225
+ text?: ITextOption;
226
+ stroke?: IStrokeOption;
227
+ zIndex?: number;
228
+ }
223
229
  export interface IPolylineOption extends IGraphicOption {
224
- style?: {
225
- text?: ITextOption;
226
- stroke?: IStrokeOption;
227
- zIndex?: number;
228
- };
230
+ style: IPolylineStyle;
231
+ }
232
+ export interface IPolygonStyle {
233
+ text?: ITextOption;
234
+ stroke?: IStrokeOption;
235
+ fill?: IFillOption;
236
+ zIndex?: number;
229
237
  }
230
238
  export interface IPolygonOption extends IGraphicOption {
231
- style?: {
232
- text?: ITextOption;
233
- stroke?: IStrokeOption;
234
- fill?: IFilleOption;
235
- zIndex?: number;
236
- };
239
+ style: IPolygonStyle;
237
240
  }
238
- export interface ICurveGraphic extends IGraphicOption {
239
- style?: {
241
+ export interface ICurveGraphicOption extends IGraphicOption {
242
+ style: {
240
243
  text?: ITextOption;
241
244
  stroke?: IStrokeOption;
242
- fill?: IFilleOption;
245
+ fill?: IFillOption;
243
246
  zIndex?: number;
244
247
  radius?: number;
245
248
  startAngle?: number;
@@ -279,4 +282,3 @@ export interface IPathLayerOption extends IGraphicLayerOption {
279
282
  pointDistance: number;
280
283
  };
281
284
  }
282
- export {};
@@ -73,7 +73,7 @@
73
73
  "type": "tdt",
74
74
  "layertype": "img_d",
75
75
  "key": ["ad5bee3fe473a639887fa9d57a670c6e"],
76
- "url":"//192.168.28.201:9999/map/{z}/{x}/{y}.png"
76
+ "url":"//192.168.5.212:9295/bjsyx/{z}/{x}/{y}.png"
77
77
 
78
78
  },
79
79
  {
@@ -81,7 +81,7 @@
81
81
  "type": "tdt",
82
82
  "layertype": "img_z",
83
83
  "key": ["ad5bee3fe473a639887fa9d57a670c6e"],
84
- "url":"//192.168.28.201:9999/mapzj/{z}/{x}/{y}.png"
84
+ "url":"//192.168.28.201:9295/bjszj/{z}/{x}/{y}.png"
85
85
  }
86
86
  ]
87
87
  },
@@ -91,10 +91,10 @@
91
91
  "name": "离线影像2",
92
92
  "type": "xyz",
93
93
  "icon": "image/basemaps/gaode_img.png",
94
- "url":"//192.168.28.201:9999/map/{z}/{x}/{y}.png",
94
+ "url":"//192.168.28.201:9888/{z}/{x}/{y}.png",
95
95
  "layer": "vec",
96
- "show": true,
97
- "chinaCRS": "GCJ02"
96
+ "show": true
97
+
98
98
  },
99
99
  {
100
100
  "id": 2021,
@@ -333,5 +333,5 @@
333
333
  { "pid":20,"name": "经纬网", "type": "graticule" }
334
334
  ]
335
335
  },
336
- "appkey":"U2FsdGVkX18tMsBEV5FfQF7ufuq4ZOmVnCreta9VsR86m1UJg6Tscxsi1wdo6GrfHTJzv/2jRln7hUu6i+y9LIKwTjrb9RK9OpHgd0ab9VKj6bgg8CRhdDxknzWMEb8UpPcn1zOmFT0xmdDId/CTX56jVlZP1+BgZKMFi/2RZAoTJhpv6+wd/IOL3YrU2OLXpaohhRLstmhGh6UGPxLuwycG1u4AmPhDpD5ggQQxOYhgbl1xHBKl8oq3l1WFKyds+rvmw/RvLyigb3ugllFKfUCQTX1Qkh5qMB5a6GtstXRt6XnYz3j6fs0LvmbX4316I5Pn9XWsE2oyxdpx0qpySp+fHtUpLv/2+eKADevxHmkIej4lMh0x/K+y213T5IXIXerwAlUXccXg8beQzc7aNkyWvod2LKa7pt/1LoncmapjWezo05TOlZ0o3KHSTJWffdrxn064FvvNXar1wsHqoKhoImtoI1cMA6uYrZME7zDHKTqQBQj0gz2N4niOvhpC87H86gt6SlIEpnfsodY7Ej1AHIQIXWJgA4DOCIORVt15er4zSMyCj0J6G1tTrHi/FkNxm8O7WQLOT3/NmiDhD3aIFfccm7hjmB9icgFI5yJ1t+++fGORjDpLeWfygINI33z5NOdfk6a1MFf4vuti5dbcfNMLVG0IrSVYZqVZdw4YG6zqTCVgyQ=="
336
+ "appkey":"U2FsdGVkX18U4oqomCgBLQJGYX67uC4rmckZk//SZ+tTM2wLvyvRC2L8L0Yu+MCo+DwHa7m0avqHcSkIxh8aUBV8+Mj/W2hilkSEusbxqfzbMwSg8cgNjPwoDSzGEJsdpsVXhnuUDy/v0DdpywGbQxZij8IVzaOOYW8f3c4kgsYlgPhbuyXY/ymOGB/euBiEY929AjY3CJe3+jiso1FKQaXeZkK4qDAPapCIhHF6Cwrdi1yHl4bof/Pv1n74AmwnGPwD9LufUh7ZHTATqt0aRrNvzvRHQ8a6vZqpMymUeUFr3WER5IrgjSsVs8bCth4boOF1R3W2lthJMFC23/0mG9aTstTD9BqKI7QlkXV6kBfg93mhxySCPUdUqnQY67xwtWOHvc/NMMkJzxXZrqKNQfh+sHrIjDSIEaAAI9KBMYba6ryWSNnEoEoRDelc//pF34+SGxR/E3nptAefxsLHfYxH6Gq5QTCaFnPmaS6iU5MsJUivR+lmMJb/7ruA7ii+PFI9D/w/nQCaYhrjJYNA4KHyC9fceJ3QgbEnXTwQyxdcFInMjS3vBCyaJoEESRmRl1kW0Q/JySZFlCHVHnTsy8MpjY2A9olR6utwhAW4X6MT0yJKa6qhd5+lXN7RmaJWVuj9vCgSP1WMHMTp4bhpKxqfwAwkCz8pq9fJsilt1TJwD4WVb2FjHQ=="
337
337
  }
@@ -1,10 +1,8 @@
1
- import { Geometry } from 'ol/geom';
2
1
  import { baseGraphic } from "./baseGraphic";
3
- import { ICurveGraphic } from "../base/baseOptionType";
4
- import { Coordinate } from 'ol/coordinate';
2
+ import { ICurveGraphicOption } from "../base/baseOptionType";
5
3
  export declare class CurveGraphic extends baseGraphic {
6
- constructor(options: ICurveGraphic);
4
+ constructor(options: ICurveGraphicOption);
7
5
  setAngle(startAngle: number, stopAngle: number): void;
8
- getCoordinates(): Coordinate[][];
9
- createRegularPolygonCurve(origin: Coordinate, radius: number, startAngle: number, stopAngle: number, rotation: number): Geometry;
6
+ setCoordinates(coordinates: Array<number>, dataWkID?: string): void;
7
+ private createRegularPolygonCurve;
10
8
  }
@@ -2,6 +2,18 @@ import { baseGraphic } from "./baseGraphic";
2
2
  import { IPolylineOption } from "../base/baseOptionType";
3
3
  export declare class LineGraphic extends baseGraphic {
4
4
  constructor(options: IPolylineOption);
5
- getCoordinates(): import("ol/coordinate").Coordinate[];
5
+ getGraphicJson(projection?: string): {
6
+ type: string;
7
+ lnglat: any;
8
+ dataWkID: string;
9
+ style: {
10
+ stroke: any;
11
+ text: any;
12
+ };
13
+ attribute: {
14
+ [x: string]: any;
15
+ };
16
+ };
17
+ setCoordinates(coordinates: Array<number>, dataWkID?: string): void;
6
18
  lineStyle(): any[];
7
19
  }
@@ -1,7 +1,9 @@
1
1
  import { baseGraphic } from "./baseGraphic";
2
- import { IPolygonOption } from "../base/baseOptionType";
2
+ import { IPolygonOption, IPolygonStyle } from "../base/baseOptionType";
3
+ import { crsType } from "../Enum/typeEnum";
3
4
  export declare class PolygonGraphic extends baseGraphic {
4
5
  constructor(options: IPolygonOption);
5
- getCoordinates(): import("ol/coordinate").Coordinate[][];
6
+ setPolygonStyle(polygonStyleOption: IPolygonStyle): void;
7
+ setCoordinates(coordinates: Array<number>, dataWkID?: crsType): void;
6
8
  setGeometryFromExtent(extent: any): void;
7
9
  }
@@ -1,10 +1,10 @@
1
1
  import Feature from "ol/Feature";
2
- import { IFeatureAttribute, IGraphicLayerOption, IGraphicOption, ITooltipInfo } from "../base/baseOptionType";
2
+ import { IFeatureAttribute, IFillOption, IGraphicLayerOption, IGraphicOption, IImageStyle, IStrokeOption, ITextOption, ITooltipInfo } from "../base/baseOptionType";
3
3
  import { proj } from "../proj4/proj";
4
4
  export declare class baseGraphic extends Feature {
5
5
  protected option: IGraphicOption;
6
6
  protected Proj: proj;
7
- constructor(options: any);
7
+ constructor(options: IGraphicOption);
8
8
  setAttribute(attribute: IFeatureAttribute | any): void;
9
9
  toGeoJSON(): import("geojson").Geometry;
10
10
  bindPopup(popupInfo: string, option?: {
@@ -18,4 +18,125 @@ export declare class baseGraphic extends Feature {
18
18
  openPopup(popupInfo?: Array<ITooltipInfo> | string, popupOption?: IGraphicLayerOption["popupOption"]): void;
19
19
  closePopup(): void;
20
20
  openTooltip(tooltipInfo: string, tooltipOption?: IGraphicLayerOption["popupOption"]): void;
21
+ private chaikin_copy;
22
+ private chaikin_smooth_line;
23
+ private chaikin_smooth_polygon;
24
+ /**
25
+ * 平滑方法
26
+ * @param coordinate 坐标
27
+ * @param param 参数
28
+ * @returns {*}
29
+ */
30
+ smoothFunc(coordinate: any[], param?: number, isLine?: boolean): any;
31
+ /**
32
+ * 平滑曲线
33
+ * @param param 越大越平滑
34
+ */
35
+ setSmooth(param?: number, isLine?: boolean): void;
36
+ /**
37
+ * 设置图形文字样式
38
+ * @param ITextOption
39
+ * @example
40
+ * setTextStyle({
41
+ font: "14px Microsoft YaHei",
42
+ text: "示例",
43
+ fill: {
44
+ color: "#8B4513", //"rgba(255, 255, 255, 1)",
45
+ },
46
+ stroke: {
47
+ color: "rgba(255, 255, 255,1)", //"#fff",
48
+ width: 2, //2,
49
+ },
50
+ backgroundFill: {
51
+ color: "rgba(255, 255, 255, 0.0)", //"rgba(255, 255, 255, 1)",
52
+ },
53
+ backgroundStroke: {
54
+ color: "rgba(0, 0, 0, 0.0)", //"#fff",
55
+ width: 2,
56
+ },
57
+ padding: [3, 3, 3, 3],
58
+ offsetX: 0,
59
+ offsetY: -10,
60
+ textBaseline: "bottom",
61
+ })
62
+ */
63
+ setTextStyle(textStyleOption: ITextOption): void;
64
+ setTrianglePointStyle(ImageStyleOption: IImageStyle): void;
65
+ setCirclePointStyle(ImageStyleOption: IImageStyle): void;
66
+ /**
67
+ * 设置边框简单模式样式
68
+ * @param IStrokeOption
69
+ * @example
70
+ * setStrokeSimpleStyle({
71
+ color: "rgba(255, 255, 255,1)", //"#fff",
72
+ width: 2, //2,
73
+ lineDash:[10,10] 或null
74
+ })
75
+ */
76
+ setStrokeSimpleStyle(strokeStyleOption: IStrokeOption): void;
77
+ /**
78
+ * 设置边框图案填充模式样式,pattern与image 二选一,不用的需undefined,同时配置优先pattern
79
+ * @param IStrokeOption
80
+ * @example
81
+ * setStrokePatternStyle({
82
+ pattern: undefined,图案Enum:mirage2d.DataType.featureStyleType.caps
83
+ // image: undefined,
84
+ color: "rgba(255, 255, 0,1)",//背景色
85
+ width: 2,
86
+ lineDash: null,
87
+ ratio: 1,
88
+ patternColor: "rgba(0, 0, 0,1)",//图案颜色
89
+ offset: 0,
90
+ scale: 1,
91
+ size: 5,
92
+ spacing: 10,
93
+ angle: 0
94
+ })
95
+ */
96
+ setStrokePatternStyle(strokeStyleOption: IStrokeOption): void;
97
+ /**
98
+ * 设置填充简单模式样式 ,从图片模式转到普通模式时,需注意等图片加载完成后才可设置
99
+ * @param ITextOption
100
+ * @example
101
+ * setFillColor("rgba(255, 255, 255,1)")//"#fff"
102
+ */
103
+ setFillColor(color: string): void;
104
+ /**
105
+ * 设置多边形图案填充模式样式,pattern与image 二选一,不用的需undefined,同时配置优先pattern
106
+ * @param fillStyleOption
107
+ * @example
108
+ * setFillPatternStyle({
109
+ pattern: undefined,图案Enum:mirage2d.DataType.featureStyleType.caps
110
+ // image: undefined,
111
+ patternColor: "rgba(0, 0, 0,1)",//图案颜色
112
+ fill: "rgba(255, 255, 0,1)",//背景色
113
+ width: 2,
114
+ lineDash: null,
115
+ ratio: 1,
116
+ offset: 0,
117
+ scale: 1,
118
+ size: 5,
119
+ spacing: 10,
120
+ angle: 0
121
+ })
122
+ */
123
+ setFillPatternStyle(fillStyleOption: IFillOption): void;
124
+ /**
125
+ * 设置多边形图片填充模式样式,初始设置时当pattern==null或undefined 且image有值才能生效
126
+ * @param fillStyleOption
127
+ * @example
128
+ * setFillImageStyle(imageurl)
129
+ */
130
+ setFillImageStyle(imageUrl: string): void;
131
+ setZIndex(zindex: number): void;
132
+ getCoordinates(projection?: string): any;
133
+ getGraphicJson(projection?: string): {
134
+ type: string;
135
+ lnglat: any;
136
+ dataWkID: string;
137
+ style: any;
138
+ attribute: {
139
+ [x: string]: any;
140
+ };
141
+ };
21
142
  }
@@ -3,7 +3,7 @@ import { crsType } from "../Enum/typeEnum";
3
3
  import { IimagePointOption } from "../base/baseOptionType";
4
4
  export declare class ImagePointGraphic extends baseGraphic {
5
5
  constructor(options: IimagePointOption);
6
- getCoordinates(): import("ol/coordinate").Coordinate;
6
+ setPointIconStyle(imageOption: any): void;
7
7
  setCoordinates(lng: number, lat: number, dataWkID?: crsType): void;
8
8
  setRotation(angle: number): void;
9
9
  }
@@ -3,6 +3,5 @@ import { crsType } from "../Enum/typeEnum";
3
3
  import { ILabelOption } from "../base/baseOptionType";
4
4
  export declare class LabelGraphic extends baseGraphic {
5
5
  constructor(options: ILabelOption);
6
- getCoordinates(): import("ol/coordinate").Coordinate;
7
6
  setCoordinates(lng: number, lat: number, dataWkID?: crsType): void;
8
7
  }
@@ -3,6 +3,5 @@ import { crsType } from "../Enum/typeEnum";
3
3
  import { IPointOption } from "../base/baseOptionType";
4
4
  export declare class PointGraphic extends baseGraphic {
5
5
  constructor(options: IPointOption);
6
- getCoordinates(): import("ol/coordinate").Coordinate;
7
6
  setCoordinates(lng: number, lat: number, dataWkID?: crsType): void;
8
7
  }