uni-leaflet 1.1.0 → 1.2.0

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/engine/factory.ts CHANGED
@@ -5,6 +5,9 @@ import type {
5
5
  TileLayerConfig,
6
6
  MapOverlays,
7
7
  OverlayClickEvent,
8
+ ClusterOptions,
9
+ ClusterGroup,
10
+ GeoJsonStyle,
8
11
  } from '../types';
9
12
 
10
13
  // #ifdef H5
@@ -24,6 +27,8 @@ export interface CreateEngineOptions {
24
27
  subdomains: string[];
25
28
  layers?: Array<string | TileLayerConfig>;
26
29
  overlays?: MapOverlays;
30
+ geojson?: any;
31
+ geojsonStyle?: GeoJsonStyle;
27
32
  showControls?: boolean;
28
33
  onMove: (center: LatLngTuple, zoom: number) => void;
29
34
  onMoveEnd: (center: LatLngTuple, zoom: number) => void;
@@ -31,6 +36,8 @@ export interface CreateEngineOptions {
31
36
  onZoomEnd: (zoom: number) => void;
32
37
  onClick: (latLng: LatLngTuple, point: Point) => void;
33
38
  onOverlayClick?: (event: OverlayClickEvent) => void;
39
+ onClusterClick?: (cluster: ClusterGroup) => void;
40
+ clusterOptions?: ClusterOptions;
34
41
 
35
42
  // H5 container
36
43
  container?: HTMLElement | null;
@@ -64,12 +71,16 @@ export async function createMapEngine(
64
71
  subdomains: options.subdomains,
65
72
  layers: options.layers,
66
73
  overlays: options.overlays,
74
+ geojson: options.geojson,
75
+ geojsonStyle: options.geojsonStyle,
67
76
  onMove: options.onMove,
68
77
  onMoveEnd: options.onMoveEnd,
69
78
  onZoom: options.onZoom,
70
79
  onZoomEnd: options.onZoomEnd,
71
80
  onClick: options.onClick,
72
81
  onOverlayClick: options.onOverlayClick,
82
+ onClusterClick: options.onClusterClick,
83
+ clusterOptions: options.clusterOptions,
73
84
  });
74
85
  return adapter;
75
86
  // #endif
@@ -89,6 +100,8 @@ export async function createMapEngine(
89
100
  subdomains: options.subdomains,
90
101
  layers: options.layers,
91
102
  overlays: options.overlays,
103
+ geojson: options.geojson,
104
+ geojsonStyle: options.geojsonStyle,
92
105
  showControls: options.showControls,
93
106
  onMove: options.onMove,
94
107
  onMoveEnd: options.onMoveEnd,
@@ -96,6 +109,8 @@ export async function createMapEngine(
96
109
  onZoomEnd: options.onZoomEnd,
97
110
  onClick: options.onClick,
98
111
  onOverlayClick: options.onOverlayClick,
112
+ onClusterClick: options.onClusterClick,
113
+ clusterOptions: options.clusterOptions,
99
114
  });
100
115
  // #endif
101
116
  }