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/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?: BaseLayer[] | {
17
- [key: string]: BaseLayer[];
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
- nameKey?: string;
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
- nameKey?: string;
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
- nameKey?: string;
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: string;
169
- extent: number[];
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
- nameKey?: string;
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 DomPointState {
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
- * DOM点位选项接口
266
+ * Vue模板点位选项接口
267
267
  */
268
- export interface DomPointOptions {
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 DomPointState;
5
- (function (DomPointState) {
6
- DomPointState["CREATED"] = "created";
7
- DomPointState["MOUNTED"] = "mounted";
8
- DomPointState["VISIBLE"] = "visible";
9
- DomPointState["HIDDEN"] = "hidden";
10
- DomPointState["DESTROYED"] = "destroyed";
11
- })(DomPointState || (DomPointState = {}));
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 = {}));