my-openlayer 1.0.4 → 1.0.6
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.
- package/MyOl.d.ts +2 -9
- package/MyOl.js +17 -33
- package/core/DomPoint.d.ts +3 -10
- package/core/DomPoint.js +75 -31
- package/core/EventManager.d.ts +13 -3
- package/core/EventManager.js +77 -18
- package/core/Line.d.ts +2 -0
- package/core/Line.js +3 -1
- package/core/MapBaseLayers.d.ts +32 -2
- package/core/MapBaseLayers.js +91 -23
- package/core/MapTools.d.ts +1 -52
- package/core/MapTools.js +1 -153
- package/core/Point.d.ts +14 -11
- package/core/Point.js +22 -53
- package/core/Polygon.js +4 -4
- package/core/VueTemPoint.d.ts +163 -0
- package/core/VueTemPoint.js +432 -0
- package/core/VueTemplatePoint.d.ts +51 -0
- package/core/VueTemplatePoint.js +529 -0
- package/index.d.ts +2 -2
- package/index.js +1 -1
- package/package.json +6 -6
- package/types.d.ts +40 -20
- package/types.js +8 -8
package/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import BaseLayer from "ol/layer/Base";
|
|
2
|
+
import TileLayer from "ol/layer/Tile";
|
|
3
|
+
import { WMTS } from "ol/source";
|
|
2
4
|
export interface Feature {
|
|
3
5
|
type: string;
|
|
4
6
|
properties: any;
|
|
@@ -12,9 +14,10 @@ export interface MapJSONData {
|
|
|
12
14
|
name?: string;
|
|
13
15
|
features: Feature[];
|
|
14
16
|
}
|
|
17
|
+
type LayerItem = BaseLayer | TileLayer<WMTS>;
|
|
15
18
|
export interface MapInitType {
|
|
16
|
-
layers?:
|
|
17
|
-
[key: string]:
|
|
19
|
+
layers?: LayerItem[] | {
|
|
20
|
+
[key: string]: LayerItem[];
|
|
18
21
|
};
|
|
19
22
|
zoom?: number;
|
|
20
23
|
center?: number[];
|
|
@@ -121,14 +124,12 @@ export interface TextOptions {
|
|
|
121
124
|
* 点位选项接口 - 点位图层专用配置
|
|
122
125
|
*/
|
|
123
126
|
export interface PointOptions extends BaseOptions, StyleOptions, TextOptions {
|
|
124
|
-
/**
|
|
125
|
-
|
|
127
|
+
/** 文本字段键 */
|
|
128
|
+
textKey?: string;
|
|
126
129
|
/** 图标图片 */
|
|
127
130
|
img?: string;
|
|
128
131
|
/** 图标缩放比例 */
|
|
129
132
|
scale?: number;
|
|
130
|
-
/** 是否有图标 */
|
|
131
|
-
hasImg?: boolean;
|
|
132
133
|
/** 图标颜色 */
|
|
133
134
|
iconColor?: string;
|
|
134
135
|
}
|
|
@@ -143,8 +144,8 @@ export interface LineOptions extends BaseOptions, StyleOptions, TextOptions {
|
|
|
143
144
|
* 多边形选项接口 - 多边形图层专用配置
|
|
144
145
|
*/
|
|
145
146
|
export interface PolygonOptions extends BaseOptions, StyleOptions, TextOptions {
|
|
146
|
-
/**
|
|
147
|
-
|
|
147
|
+
/** 文本字段键 */
|
|
148
|
+
textKey?: string;
|
|
148
149
|
/** 是否为蒙版 */
|
|
149
150
|
mask?: boolean;
|
|
150
151
|
}
|
|
@@ -153,10 +154,9 @@ export interface PolygonOptions extends BaseOptions, StyleOptions, TextOptions {
|
|
|
153
154
|
* @deprecated 请使用具体的选项接口:PointOptions, LineOptions, PolygonOptions
|
|
154
155
|
*/
|
|
155
156
|
export type OptionsType = BaseOptions & StyleOptions & TextOptions & {
|
|
156
|
-
|
|
157
|
+
textKey?: string;
|
|
157
158
|
img?: string;
|
|
158
159
|
scale?: number;
|
|
159
|
-
hasImg?: boolean;
|
|
160
160
|
iconColor?: string;
|
|
161
161
|
type?: string;
|
|
162
162
|
mask?: boolean;
|
|
@@ -165,8 +165,8 @@ export type OptionsType = BaseOptions & StyleOptions & TextOptions & {
|
|
|
165
165
|
* 图片图层数据接口
|
|
166
166
|
*/
|
|
167
167
|
export interface ImageLayerData {
|
|
168
|
-
img
|
|
169
|
-
extent
|
|
168
|
+
img?: string;
|
|
169
|
+
extent?: number[];
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* 蒙版图层配置接口
|
|
@@ -191,8 +191,8 @@ export interface ColorMap {
|
|
|
191
191
|
* 要素颜色更新选项接口
|
|
192
192
|
*/
|
|
193
193
|
export interface FeatureColorUpdateOptions extends BaseOptions, StyleOptions, TextOptions {
|
|
194
|
-
/**
|
|
195
|
-
|
|
194
|
+
/** 文本字段键 */
|
|
195
|
+
textKey?: string;
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* 点位数据接口
|
|
@@ -255,7 +255,7 @@ export interface VueLegacyInstance {
|
|
|
255
255
|
/**
|
|
256
256
|
* DOM点位状态枚举
|
|
257
257
|
*/
|
|
258
|
-
export declare enum
|
|
258
|
+
export declare enum VueTemplatePointState {
|
|
259
259
|
CREATED = "created",
|
|
260
260
|
MOUNTED = "mounted",
|
|
261
261
|
VISIBLE = "visible",
|
|
@@ -263,16 +263,13 @@ export declare enum DomPointState {
|
|
|
263
263
|
DESTROYED = "destroyed"
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
|
-
*
|
|
266
|
+
* Vue模板点位选项接口
|
|
267
267
|
*/
|
|
268
|
-
export interface
|
|
269
|
-
Vue: any;
|
|
268
|
+
export interface VueTemplatePointOptions {
|
|
270
269
|
Template: any;
|
|
271
270
|
lgtd: number;
|
|
272
271
|
lttd: number;
|
|
273
272
|
props?: any;
|
|
274
|
-
longitude?: number;
|
|
275
|
-
latitude?: number;
|
|
276
273
|
styleType?: 'default' | 'custom';
|
|
277
274
|
positioning?: 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-center' | 'center-right' | 'top-left' | 'top-center' | 'top-right';
|
|
278
275
|
stopEvent?: boolean;
|
|
@@ -280,3 +277,26 @@ export interface DomPointOptions {
|
|
|
280
277
|
className?: string;
|
|
281
278
|
zIndex?: number;
|
|
282
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Vue模板点位实例接口
|
|
282
|
+
*/
|
|
283
|
+
export interface VueTemplatePointInstance {
|
|
284
|
+
id: string;
|
|
285
|
+
dom: HTMLElement;
|
|
286
|
+
anchor: any;
|
|
287
|
+
app: VueApp | VueLegacyInstance | null;
|
|
288
|
+
state: VueTemplatePointState;
|
|
289
|
+
position: number[];
|
|
290
|
+
options: VueTemplatePointOptions;
|
|
291
|
+
setVisible(visible: boolean): void;
|
|
292
|
+
updatePosition(lgtd: number, lttd: number): void;
|
|
293
|
+
updateProps(newProps: Record<string, any>): void;
|
|
294
|
+
setStyle(styles: Partial<CSSStyleDeclaration>): void;
|
|
295
|
+
addClass(className: string): void;
|
|
296
|
+
removeClass(className: string): void;
|
|
297
|
+
remove(): void;
|
|
298
|
+
getState(): VueTemplatePointState;
|
|
299
|
+
getOptions(): Readonly<VueTemplatePointOptions>;
|
|
300
|
+
isDestroyed(): boolean;
|
|
301
|
+
}
|
|
302
|
+
export {};
|
package/types.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DOM点位状态枚举
|
|
3
3
|
*/
|
|
4
|
-
export var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(
|
|
4
|
+
export var VueTemplatePointState;
|
|
5
|
+
(function (VueTemplatePointState) {
|
|
6
|
+
VueTemplatePointState["CREATED"] = "created";
|
|
7
|
+
VueTemplatePointState["MOUNTED"] = "mounted";
|
|
8
|
+
VueTemplatePointState["VISIBLE"] = "visible";
|
|
9
|
+
VueTemplatePointState["HIDDEN"] = "hidden";
|
|
10
|
+
VueTemplatePointState["DESTROYED"] = "destroyed";
|
|
11
|
+
})(VueTemplatePointState || (VueTemplatePointState = {}));
|