@revivejs/react-google-maps 17.0.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/LICENSE +21 -0
- package/README.md +271 -0
- package/dist/index.cjs +1834 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +457 -0
- package/dist/index.d.ts +457 -0
- package/dist/index.js +1797 -0
- package/dist/index.js.map +1 -0
- package/package.json +78 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode, HTMLAttributes, CSSProperties } from 'react';
|
|
4
|
+
import { Cluster, ClusterStats, Renderer, Algorithm, MarkerClusterer } from '@googlemaps/markerclusterer';
|
|
5
|
+
|
|
6
|
+
type GoogleMapsApiLoadOptions = {
|
|
7
|
+
apiKey: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
language?: string;
|
|
10
|
+
region?: string;
|
|
11
|
+
libraries?: string[];
|
|
12
|
+
mapIds?: string[];
|
|
13
|
+
authReferrerPolicy?: string;
|
|
14
|
+
channel?: string;
|
|
15
|
+
solutionChannel?: string;
|
|
16
|
+
nonce?: string;
|
|
17
|
+
};
|
|
18
|
+
declare function getDefaultGoogleMapsLibraries(): ("marker" | "places" | "geometry" | "visualization")[];
|
|
19
|
+
declare function loadGoogleMapsApi(options: GoogleMapsApiLoadOptions): Promise<typeof google>;
|
|
20
|
+
|
|
21
|
+
type GoogleMapsProviderProps = GoogleMapsApiLoadOptions & {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
declare function GoogleMapsProvider({ children, ...options }: GoogleMapsProviderProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
type ClusterRendererContext = {
|
|
27
|
+
cluster: Cluster;
|
|
28
|
+
stats: ClusterStats;
|
|
29
|
+
map: google.maps.Map;
|
|
30
|
+
count: number;
|
|
31
|
+
position: google.maps.LatLng;
|
|
32
|
+
color: string;
|
|
33
|
+
isAdvancedMarkerAvailable: boolean;
|
|
34
|
+
};
|
|
35
|
+
type CreateClusterRendererOptions = {
|
|
36
|
+
className?: string;
|
|
37
|
+
useAdvancedMarker?: boolean;
|
|
38
|
+
zIndexBase?: number;
|
|
39
|
+
title?: string | ((context: ClusterRendererContext) => string);
|
|
40
|
+
render?: (context: ClusterRendererContext) => HTMLElement | string;
|
|
41
|
+
fallbackTextColor?: string;
|
|
42
|
+
fallbackBorderColor?: string;
|
|
43
|
+
color?: string | ((context: ClusterRendererContext) => string);
|
|
44
|
+
};
|
|
45
|
+
declare function createClusterRenderer(options?: CreateClusterRendererOptions): Renderer;
|
|
46
|
+
|
|
47
|
+
type GoogleMapsStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
48
|
+
type MarkerLike = google.maps.Marker | google.maps.marker.AdvancedMarkerElement;
|
|
49
|
+
|
|
50
|
+
type LatLngLike = google.maps.LatLngLiteral | google.maps.LatLng;
|
|
51
|
+
|
|
52
|
+
type GoogleMapHandle = {
|
|
53
|
+
map: google.maps.Map | null;
|
|
54
|
+
fitBounds: (bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral) => void;
|
|
55
|
+
panBy: (x: number, y: number) => void;
|
|
56
|
+
panTo: (position: google.maps.LatLng | google.maps.LatLngLiteral) => void;
|
|
57
|
+
panToBounds: (bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding) => void;
|
|
58
|
+
setZoom: (zoom: number) => void;
|
|
59
|
+
setCenter: (position: google.maps.LatLng | google.maps.LatLngLiteral) => void;
|
|
60
|
+
setOptions: (options: google.maps.MapOptions) => void;
|
|
61
|
+
getBounds: () => google.maps.LatLngBounds | null;
|
|
62
|
+
getCenter: () => google.maps.LatLng | undefined;
|
|
63
|
+
getClickableIcons: () => boolean | undefined;
|
|
64
|
+
getHeading: () => number | undefined;
|
|
65
|
+
getMapTypeId: () => google.maps.MapTypeId | string | undefined;
|
|
66
|
+
getProjection: () => google.maps.Projection | null;
|
|
67
|
+
getStreetView: () => google.maps.StreetViewPanorama | null;
|
|
68
|
+
getTilt: () => number | undefined;
|
|
69
|
+
getZoom: () => number | undefined;
|
|
70
|
+
controls: () => google.maps.MVCArray<Node>[] | null;
|
|
71
|
+
data: () => google.maps.Data | null;
|
|
72
|
+
mapTypes: () => google.maps.MapTypeRegistry | null;
|
|
73
|
+
overlayMapTypes: () => google.maps.MVCArray<google.maps.MapType | null> | null;
|
|
74
|
+
};
|
|
75
|
+
type GoogleMapProps = Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> & {
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
center?: LatLngLike;
|
|
78
|
+
zoom?: number;
|
|
79
|
+
mapId?: string;
|
|
80
|
+
options?: google.maps.MapOptions;
|
|
81
|
+
width?: CSSProperties['width'];
|
|
82
|
+
height?: CSSProperties['height'];
|
|
83
|
+
loadingFallback?: ReactNode;
|
|
84
|
+
errorFallback?: ReactNode;
|
|
85
|
+
onMapLoad?: (map: google.maps.Map) => void;
|
|
86
|
+
onMapUnmount?: (map: google.maps.Map) => void;
|
|
87
|
+
onClick?: (event: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => void;
|
|
88
|
+
onDblClick?: (event: google.maps.MapMouseEvent) => void;
|
|
89
|
+
onDrag?: () => void;
|
|
90
|
+
onDragStart?: () => void;
|
|
91
|
+
onDragEnd?: () => void;
|
|
92
|
+
onIdle?: () => void;
|
|
93
|
+
onBoundsChanged?: () => void;
|
|
94
|
+
onCenterChanged?: () => void;
|
|
95
|
+
onHeadingChanged?: () => void;
|
|
96
|
+
onMapTypeIdChanged?: () => void;
|
|
97
|
+
onMouseMove?: (event: google.maps.MapMouseEvent) => void;
|
|
98
|
+
onMouseOut?: (event: google.maps.MapMouseEvent) => void;
|
|
99
|
+
onMouseOver?: (event: google.maps.MapMouseEvent) => void;
|
|
100
|
+
onProjectionChanged?: () => void;
|
|
101
|
+
onRightClick?: (event: google.maps.MapMouseEvent) => void;
|
|
102
|
+
onTilesLoaded?: () => void;
|
|
103
|
+
onTiltChanged?: () => void;
|
|
104
|
+
onZoomChanged?: () => void;
|
|
105
|
+
};
|
|
106
|
+
declare const GoogleMap: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "onClick"> & {
|
|
107
|
+
children?: ReactNode;
|
|
108
|
+
center?: LatLngLike;
|
|
109
|
+
zoom?: number;
|
|
110
|
+
mapId?: string;
|
|
111
|
+
options?: google.maps.MapOptions;
|
|
112
|
+
width?: CSSProperties["width"];
|
|
113
|
+
height?: CSSProperties["height"];
|
|
114
|
+
loadingFallback?: ReactNode;
|
|
115
|
+
errorFallback?: ReactNode;
|
|
116
|
+
onMapLoad?: (map: google.maps.Map) => void;
|
|
117
|
+
onMapUnmount?: (map: google.maps.Map) => void;
|
|
118
|
+
onClick?: (event: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => void;
|
|
119
|
+
onDblClick?: (event: google.maps.MapMouseEvent) => void;
|
|
120
|
+
onDrag?: () => void;
|
|
121
|
+
onDragStart?: () => void;
|
|
122
|
+
onDragEnd?: () => void;
|
|
123
|
+
onIdle?: () => void;
|
|
124
|
+
onBoundsChanged?: () => void;
|
|
125
|
+
onCenterChanged?: () => void;
|
|
126
|
+
onHeadingChanged?: () => void;
|
|
127
|
+
onMapTypeIdChanged?: () => void;
|
|
128
|
+
onMouseMove?: (event: google.maps.MapMouseEvent) => void;
|
|
129
|
+
onMouseOut?: (event: google.maps.MapMouseEvent) => void;
|
|
130
|
+
onMouseOver?: (event: google.maps.MapMouseEvent) => void;
|
|
131
|
+
onProjectionChanged?: () => void;
|
|
132
|
+
onRightClick?: (event: google.maps.MapMouseEvent) => void;
|
|
133
|
+
onTilesLoaded?: () => void;
|
|
134
|
+
onTiltChanged?: () => void;
|
|
135
|
+
onZoomChanged?: () => void;
|
|
136
|
+
} & react.RefAttributes<GoogleMapHandle>>;
|
|
137
|
+
|
|
138
|
+
type MapMarkerHandle = {
|
|
139
|
+
marker: google.maps.Marker | null;
|
|
140
|
+
getAnimation: () => google.maps.Animation | null | undefined;
|
|
141
|
+
getClickable: () => boolean | undefined;
|
|
142
|
+
getDraggable: () => boolean | undefined;
|
|
143
|
+
getIcon: () => string | google.maps.Icon | google.maps.Symbol | null | undefined;
|
|
144
|
+
getLabel: () => string | google.maps.MarkerLabel | null | undefined;
|
|
145
|
+
getPosition: () => google.maps.LatLng | null | undefined;
|
|
146
|
+
getTitle: () => string | null | undefined;
|
|
147
|
+
getVisible: () => boolean | undefined;
|
|
148
|
+
getZIndex: () => number | null | undefined;
|
|
149
|
+
setAnimation: (animation: google.maps.Animation | null) => void;
|
|
150
|
+
setOptions: (options: google.maps.MarkerOptions) => void;
|
|
151
|
+
setPosition: (position: google.maps.LatLng | google.maps.LatLngLiteral) => void;
|
|
152
|
+
setTitle: (title: string) => void;
|
|
153
|
+
setVisible: (visible: boolean) => void;
|
|
154
|
+
setZIndex: (zIndex: number) => void;
|
|
155
|
+
};
|
|
156
|
+
type MapAdvancedMarkerHandle = {
|
|
157
|
+
marker: google.maps.marker.AdvancedMarkerElement | null;
|
|
158
|
+
content: HTMLElement | null;
|
|
159
|
+
setMap: (map: google.maps.Map | null) => void;
|
|
160
|
+
setPosition: (position: google.maps.LatLng | google.maps.LatLngLiteral) => void;
|
|
161
|
+
setZIndex: (zIndex: number) => void;
|
|
162
|
+
};
|
|
163
|
+
type MapInfoWindowHandle = {
|
|
164
|
+
infoWindow: google.maps.InfoWindow | null;
|
|
165
|
+
open: (anchor?: MarkerLike | null) => void;
|
|
166
|
+
close: () => void;
|
|
167
|
+
getContent: () => string | Node | null | undefined;
|
|
168
|
+
getPosition: () => google.maps.LatLng | null | undefined;
|
|
169
|
+
getZIndex: () => number | undefined;
|
|
170
|
+
setContent: (content: string | Element | Text) => void;
|
|
171
|
+
setPosition: (position: google.maps.LatLng | google.maps.LatLngLiteral) => void;
|
|
172
|
+
setZIndex: (zIndex: number) => void;
|
|
173
|
+
};
|
|
174
|
+
type MapMarkerClustererHandle = {
|
|
175
|
+
clusterer: MarkerClusterer | null;
|
|
176
|
+
addMarker: (marker: MarkerLike, noDraw?: boolean) => void;
|
|
177
|
+
addMarkers: (markers: MarkerLike[], noDraw?: boolean) => void;
|
|
178
|
+
removeMarker: (marker: MarkerLike, noDraw?: boolean) => boolean;
|
|
179
|
+
clearMarkers: (noDraw?: boolean) => void;
|
|
180
|
+
render: () => void;
|
|
181
|
+
};
|
|
182
|
+
type MapMarkerProps = {
|
|
183
|
+
position: LatLngLike;
|
|
184
|
+
title?: string;
|
|
185
|
+
label?: string | google.maps.MarkerLabel;
|
|
186
|
+
clickable?: boolean;
|
|
187
|
+
draggable?: boolean;
|
|
188
|
+
icon?: string | google.maps.Icon | google.maps.Symbol;
|
|
189
|
+
visible?: boolean;
|
|
190
|
+
zIndex?: number;
|
|
191
|
+
animation?: google.maps.Animation;
|
|
192
|
+
options?: google.maps.MarkerOptions;
|
|
193
|
+
onLoad?: (marker: google.maps.Marker) => void;
|
|
194
|
+
onUnmount?: (marker: google.maps.Marker) => void;
|
|
195
|
+
onClick?: (event: google.maps.MapMouseEvent) => void;
|
|
196
|
+
onDblClick?: (event: google.maps.MapMouseEvent) => void;
|
|
197
|
+
onDrag?: (event: google.maps.MapMouseEvent) => void;
|
|
198
|
+
onDragEnd?: (event: google.maps.MapMouseEvent) => void;
|
|
199
|
+
onDragStart?: (event: google.maps.MapMouseEvent) => void;
|
|
200
|
+
onMouseDown?: (event: google.maps.MapMouseEvent) => void;
|
|
201
|
+
onMouseOut?: (event: google.maps.MapMouseEvent) => void;
|
|
202
|
+
onMouseOver?: (event: google.maps.MapMouseEvent) => void;
|
|
203
|
+
onMouseUp?: (event: google.maps.MapMouseEvent) => void;
|
|
204
|
+
onRightClick?: (event: google.maps.MapMouseEvent) => void;
|
|
205
|
+
};
|
|
206
|
+
type MapAdvancedMarkerProps = {
|
|
207
|
+
position: LatLngLike;
|
|
208
|
+
title?: string;
|
|
209
|
+
zIndex?: number;
|
|
210
|
+
gmpClickable?: boolean;
|
|
211
|
+
gmpDraggable?: boolean;
|
|
212
|
+
options?: google.maps.marker.AdvancedMarkerElementOptions;
|
|
213
|
+
collisionBehavior?: google.maps.CollisionBehavior;
|
|
214
|
+
children?: ReactNode;
|
|
215
|
+
onLoad?: (marker: google.maps.marker.AdvancedMarkerElement) => void;
|
|
216
|
+
onUnmount?: (marker: google.maps.marker.AdvancedMarkerElement) => void;
|
|
217
|
+
onClick?: (event: google.maps.MapMouseEvent) => void;
|
|
218
|
+
onDragStart?: (event: google.maps.MapMouseEvent) => void;
|
|
219
|
+
onDrag?: (event: google.maps.MapMouseEvent) => void;
|
|
220
|
+
onDragEnd?: (event: google.maps.MapMouseEvent) => void;
|
|
221
|
+
};
|
|
222
|
+
type MapInfoWindowProps = {
|
|
223
|
+
anchor?: MarkerLike | null;
|
|
224
|
+
open?: boolean;
|
|
225
|
+
position?: LatLngLike;
|
|
226
|
+
zIndex?: number;
|
|
227
|
+
options?: google.maps.InfoWindowOptions;
|
|
228
|
+
children?: ReactNode;
|
|
229
|
+
onLoad?: (infoWindow: google.maps.InfoWindow) => void;
|
|
230
|
+
onUnmount?: (infoWindow: google.maps.InfoWindow) => void;
|
|
231
|
+
onCloseClick?: () => void;
|
|
232
|
+
onDomReady?: () => void;
|
|
233
|
+
onContentChanged?: () => void;
|
|
234
|
+
onPositionChanged?: () => void;
|
|
235
|
+
onZIndexChanged?: () => void;
|
|
236
|
+
};
|
|
237
|
+
type MapMarkerClustererProps = {
|
|
238
|
+
children?: ReactNode;
|
|
239
|
+
algorithm?: Algorithm;
|
|
240
|
+
renderer?: Renderer;
|
|
241
|
+
onLoad?: (clusterer: MarkerClusterer) => void;
|
|
242
|
+
onUnmount?: (clusterer: MarkerClusterer) => void;
|
|
243
|
+
onClusterClick?: (event: google.maps.MapMouseEvent, cluster: Cluster, map: google.maps.Map) => void;
|
|
244
|
+
};
|
|
245
|
+
declare const MapMarker: react.ForwardRefExoticComponent<MapMarkerProps & react.RefAttributes<MapMarkerHandle>>;
|
|
246
|
+
declare const MapAdvancedMarker: react.ForwardRefExoticComponent<MapAdvancedMarkerProps & react.RefAttributes<MapAdvancedMarkerHandle>>;
|
|
247
|
+
declare const MapInfoWindow: react.ForwardRefExoticComponent<MapInfoWindowProps & react.RefAttributes<MapInfoWindowHandle>>;
|
|
248
|
+
declare const MapMarkerClusterer: react.ForwardRefExoticComponent<MapMarkerClustererProps & react.RefAttributes<MapMarkerClustererHandle>>;
|
|
249
|
+
|
|
250
|
+
type ShapeBaseProps<T> = {
|
|
251
|
+
options?: T;
|
|
252
|
+
onLoad?: (instance: any) => void;
|
|
253
|
+
onUnmount?: (instance: any) => void;
|
|
254
|
+
onClick?: (event: google.maps.MapMouseEvent) => void;
|
|
255
|
+
onDblClick?: (event: google.maps.MapMouseEvent) => void;
|
|
256
|
+
onMouseDown?: (event: google.maps.MapMouseEvent) => void;
|
|
257
|
+
onMouseMove?: (event: google.maps.MapMouseEvent) => void;
|
|
258
|
+
onMouseOut?: (event: google.maps.MapMouseEvent) => void;
|
|
259
|
+
onMouseOver?: (event: google.maps.MapMouseEvent) => void;
|
|
260
|
+
onMouseUp?: (event: google.maps.MapMouseEvent) => void;
|
|
261
|
+
onRightClick?: (event: google.maps.MapMouseEvent) => void;
|
|
262
|
+
onDrag?: (event: google.maps.MapMouseEvent) => void;
|
|
263
|
+
onDragEnd?: (event: google.maps.MapMouseEvent) => void;
|
|
264
|
+
onDragStart?: (event: google.maps.MapMouseEvent) => void;
|
|
265
|
+
};
|
|
266
|
+
type MapPolylineProps = ShapeBaseProps<google.maps.PolylineOptions> & {
|
|
267
|
+
path: LatLngLike[];
|
|
268
|
+
};
|
|
269
|
+
type MapPolygonProps = ShapeBaseProps<google.maps.PolygonOptions> & {
|
|
270
|
+
paths: LatLngLike[] | LatLngLike[][];
|
|
271
|
+
};
|
|
272
|
+
type MapRectangleProps = ShapeBaseProps<google.maps.RectangleOptions> & {
|
|
273
|
+
bounds: google.maps.LatLngBoundsLiteral;
|
|
274
|
+
};
|
|
275
|
+
type MapCircleProps = ShapeBaseProps<google.maps.CircleOptions> & {
|
|
276
|
+
center: LatLngLike;
|
|
277
|
+
radius: number;
|
|
278
|
+
};
|
|
279
|
+
type MapGroundOverlayProps = {
|
|
280
|
+
url: string;
|
|
281
|
+
bounds: google.maps.LatLngBoundsLiteral;
|
|
282
|
+
opacity?: number;
|
|
283
|
+
clickable?: boolean;
|
|
284
|
+
onLoad?: (overlay: google.maps.GroundOverlay) => void;
|
|
285
|
+
onUnmount?: (overlay: google.maps.GroundOverlay) => void;
|
|
286
|
+
onClick?: (event: google.maps.MapMouseEvent) => void;
|
|
287
|
+
};
|
|
288
|
+
type MapControlProps = {
|
|
289
|
+
position: google.maps.ControlPosition;
|
|
290
|
+
children: ReactNode;
|
|
291
|
+
index?: number;
|
|
292
|
+
};
|
|
293
|
+
type MapPolylineHandle = {
|
|
294
|
+
polyline: google.maps.Polyline | null;
|
|
295
|
+
getPath: () => google.maps.MVCArray<google.maps.LatLng> | null;
|
|
296
|
+
getVisible: () => boolean | undefined;
|
|
297
|
+
getDraggable: () => boolean | undefined;
|
|
298
|
+
getEditable: () => boolean | undefined;
|
|
299
|
+
setPath: (path: LatLngLike[]) => void;
|
|
300
|
+
setOptions: (options: google.maps.PolylineOptions) => void;
|
|
301
|
+
};
|
|
302
|
+
type MapPolygonHandle = {
|
|
303
|
+
polygon: google.maps.Polygon | null;
|
|
304
|
+
getPath: () => google.maps.MVCArray<google.maps.LatLng> | null;
|
|
305
|
+
getPaths: () => google.maps.MVCArray<google.maps.MVCArray<google.maps.LatLng>> | null;
|
|
306
|
+
getVisible: () => boolean | undefined;
|
|
307
|
+
getDraggable: () => boolean | undefined;
|
|
308
|
+
getEditable: () => boolean | undefined;
|
|
309
|
+
setPaths: (paths: LatLngLike[] | LatLngLike[][]) => void;
|
|
310
|
+
setOptions: (options: google.maps.PolygonOptions) => void;
|
|
311
|
+
};
|
|
312
|
+
type MapRectangleHandle = {
|
|
313
|
+
rectangle: google.maps.Rectangle | null;
|
|
314
|
+
getBounds: () => google.maps.LatLngBounds | null;
|
|
315
|
+
getVisible: () => boolean | undefined;
|
|
316
|
+
getDraggable: () => boolean | undefined;
|
|
317
|
+
getEditable: () => boolean | undefined;
|
|
318
|
+
setBounds: (bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral) => void;
|
|
319
|
+
setOptions: (options: google.maps.RectangleOptions) => void;
|
|
320
|
+
};
|
|
321
|
+
type MapCircleHandle = {
|
|
322
|
+
circle: google.maps.Circle | null;
|
|
323
|
+
getBounds: () => google.maps.LatLngBounds | null;
|
|
324
|
+
getCenter: () => google.maps.LatLng | null;
|
|
325
|
+
getRadius: () => number | undefined;
|
|
326
|
+
getVisible: () => boolean | undefined;
|
|
327
|
+
getDraggable: () => boolean | undefined;
|
|
328
|
+
getEditable: () => boolean | undefined;
|
|
329
|
+
setCenter: (center: google.maps.LatLng | google.maps.LatLngLiteral) => void;
|
|
330
|
+
setRadius: (radius: number) => void;
|
|
331
|
+
setOptions: (options: google.maps.CircleOptions) => void;
|
|
332
|
+
};
|
|
333
|
+
type MapGroundOverlayHandle = {
|
|
334
|
+
overlay: google.maps.GroundOverlay | null;
|
|
335
|
+
getBounds: () => google.maps.LatLngBounds | null;
|
|
336
|
+
getOpacity: () => number | null | undefined;
|
|
337
|
+
getUrl: () => string | undefined;
|
|
338
|
+
setOpacity: (opacity: number) => void;
|
|
339
|
+
setMap: (map: google.maps.Map | null) => void;
|
|
340
|
+
};
|
|
341
|
+
declare const MapPolyline: react.ForwardRefExoticComponent<ShapeBaseProps<google.maps.PolylineOptions> & {
|
|
342
|
+
path: LatLngLike[];
|
|
343
|
+
} & react.RefAttributes<MapPolylineHandle>>;
|
|
344
|
+
declare const MapPolygon: react.ForwardRefExoticComponent<ShapeBaseProps<google.maps.PolygonOptions> & {
|
|
345
|
+
paths: LatLngLike[] | LatLngLike[][];
|
|
346
|
+
} & react.RefAttributes<MapPolygonHandle>>;
|
|
347
|
+
declare const MapRectangle: react.ForwardRefExoticComponent<ShapeBaseProps<google.maps.RectangleOptions> & {
|
|
348
|
+
bounds: google.maps.LatLngBoundsLiteral;
|
|
349
|
+
} & react.RefAttributes<MapRectangleHandle>>;
|
|
350
|
+
declare const MapCircle: react.ForwardRefExoticComponent<ShapeBaseProps<google.maps.CircleOptions> & {
|
|
351
|
+
center: LatLngLike;
|
|
352
|
+
radius: number;
|
|
353
|
+
} & react.RefAttributes<MapCircleHandle>>;
|
|
354
|
+
declare const MapGroundOverlay: react.ForwardRefExoticComponent<MapGroundOverlayProps & react.RefAttributes<MapGroundOverlayHandle>>;
|
|
355
|
+
declare function MapControl({ position, children, index }: MapControlProps): react.ReactPortal | null;
|
|
356
|
+
|
|
357
|
+
type HeatmapDatum = LatLngLike | google.maps.visualization.WeightedLocation | {
|
|
358
|
+
location: LatLngLike;
|
|
359
|
+
weight: number;
|
|
360
|
+
};
|
|
361
|
+
type MapTrafficLayerHandle = {
|
|
362
|
+
layer: google.maps.TrafficLayer | null;
|
|
363
|
+
setMap: (map: google.maps.Map | null) => void;
|
|
364
|
+
setOptions: (options: google.maps.TrafficLayerOptions) => void;
|
|
365
|
+
};
|
|
366
|
+
type MapTransitLayerHandle = {
|
|
367
|
+
layer: google.maps.TransitLayer | null;
|
|
368
|
+
setMap: (map: google.maps.Map | null) => void;
|
|
369
|
+
};
|
|
370
|
+
type MapBicyclingLayerHandle = {
|
|
371
|
+
layer: google.maps.BicyclingLayer | null;
|
|
372
|
+
setMap: (map: google.maps.Map | null) => void;
|
|
373
|
+
};
|
|
374
|
+
type MapKmlLayerHandle = {
|
|
375
|
+
layer: google.maps.KmlLayer | null;
|
|
376
|
+
getDefaultViewport: () => google.maps.LatLngBounds | null;
|
|
377
|
+
getMetadata: () => google.maps.KmlLayerMetadata | null;
|
|
378
|
+
getStatus: () => google.maps.KmlLayerStatus | null;
|
|
379
|
+
getUrl: () => string | null;
|
|
380
|
+
setMap: (map: google.maps.Map | null) => void;
|
|
381
|
+
setOptions: (options: google.maps.KmlLayerOptions) => void;
|
|
382
|
+
setUrl: (url: string) => void;
|
|
383
|
+
};
|
|
384
|
+
type MapHeatmapLayerHandle = {
|
|
385
|
+
layer: google.maps.visualization.HeatmapLayer | null;
|
|
386
|
+
getData: () => google.maps.MVCArray<google.maps.LatLng | google.maps.visualization.WeightedLocation> | null;
|
|
387
|
+
setData: (data: HeatmapDatum[]) => void;
|
|
388
|
+
setMap: (map: google.maps.Map | null) => void;
|
|
389
|
+
setOptions: (options: google.maps.visualization.HeatmapLayerOptions) => void;
|
|
390
|
+
};
|
|
391
|
+
type MapKmlLayerProps = {
|
|
392
|
+
url: string;
|
|
393
|
+
options?: google.maps.KmlLayerOptions;
|
|
394
|
+
onLoad?: (layer: google.maps.KmlLayer) => void;
|
|
395
|
+
onUnmount?: (layer: google.maps.KmlLayer) => void;
|
|
396
|
+
};
|
|
397
|
+
type MapHeatmapLayerProps = {
|
|
398
|
+
data: HeatmapDatum[];
|
|
399
|
+
options?: google.maps.visualization.HeatmapLayerOptions;
|
|
400
|
+
onLoad?: (layer: google.maps.visualization.HeatmapLayer) => void;
|
|
401
|
+
onUnmount?: (layer: google.maps.visualization.HeatmapLayer) => void;
|
|
402
|
+
};
|
|
403
|
+
declare const MapTrafficLayer: react.ForwardRefExoticComponent<{
|
|
404
|
+
options?: google.maps.TrafficLayerOptions;
|
|
405
|
+
onLoad?: (layer: google.maps.TrafficLayer) => void;
|
|
406
|
+
onUnmount?: (layer: google.maps.TrafficLayer) => void;
|
|
407
|
+
} & react.RefAttributes<MapTrafficLayerHandle>>;
|
|
408
|
+
declare const MapTransitLayer: react.ForwardRefExoticComponent<{
|
|
409
|
+
onLoad?: (layer: google.maps.TransitLayer) => void;
|
|
410
|
+
onUnmount?: (layer: google.maps.TransitLayer) => void;
|
|
411
|
+
} & react.RefAttributes<MapTransitLayerHandle>>;
|
|
412
|
+
declare const MapBicyclingLayer: react.ForwardRefExoticComponent<{
|
|
413
|
+
onLoad?: (layer: google.maps.BicyclingLayer) => void;
|
|
414
|
+
onUnmount?: (layer: google.maps.BicyclingLayer) => void;
|
|
415
|
+
} & react.RefAttributes<MapBicyclingLayerHandle>>;
|
|
416
|
+
declare const MapKmlLayer: react.ForwardRefExoticComponent<MapKmlLayerProps & react.RefAttributes<MapKmlLayerHandle>>;
|
|
417
|
+
declare const MapHeatmapLayer: react.ForwardRefExoticComponent<MapHeatmapLayerProps & react.RefAttributes<MapHeatmapLayerHandle>>;
|
|
418
|
+
|
|
419
|
+
type DirectionsServiceResult = {
|
|
420
|
+
status: google.maps.DirectionsStatus;
|
|
421
|
+
result: google.maps.DirectionsResult | null;
|
|
422
|
+
};
|
|
423
|
+
type MapDirectionsRendererHandle = {
|
|
424
|
+
renderer: google.maps.DirectionsRenderer | null;
|
|
425
|
+
getDirections: () => google.maps.DirectionsResult | null | undefined;
|
|
426
|
+
getPanel: () => Node | null | undefined;
|
|
427
|
+
getRouteIndex: () => number | undefined;
|
|
428
|
+
setDirections: (directions: google.maps.DirectionsResult | null) => void;
|
|
429
|
+
setOptions: (options: google.maps.DirectionsRendererOptions) => void;
|
|
430
|
+
setRouteIndex: (routeIndex: number) => void;
|
|
431
|
+
};
|
|
432
|
+
type MapDirectionsRendererProps = {
|
|
433
|
+
directions?: google.maps.DirectionsResult | null;
|
|
434
|
+
options?: google.maps.DirectionsRendererOptions;
|
|
435
|
+
onLoad?: (renderer: google.maps.DirectionsRenderer) => void;
|
|
436
|
+
onUnmount?: (renderer: google.maps.DirectionsRenderer) => void;
|
|
437
|
+
onDirectionsChanged?: () => void;
|
|
438
|
+
};
|
|
439
|
+
declare const MapDirectionsRenderer: react.ForwardRefExoticComponent<MapDirectionsRendererProps & react.RefAttributes<MapDirectionsRendererHandle>>;
|
|
440
|
+
declare function MapDirectionsService({ request, onResult, onError }: {
|
|
441
|
+
request?: google.maps.DirectionsRequest | null;
|
|
442
|
+
onResult: (response: DirectionsServiceResult) => void;
|
|
443
|
+
onError?: (error: Error) => void;
|
|
444
|
+
}): null;
|
|
445
|
+
|
|
446
|
+
declare function useGoogleMapsApi(): {
|
|
447
|
+
isLoaded: boolean;
|
|
448
|
+
status: GoogleMapsStatus;
|
|
449
|
+
error: Error | null;
|
|
450
|
+
google: typeof google | null;
|
|
451
|
+
options: GoogleMapsApiLoadOptions | null;
|
|
452
|
+
};
|
|
453
|
+
declare function useGoogleMap(): google.maps.Map | null;
|
|
454
|
+
declare function useMapGeocoder(): google.maps.Geocoder | null;
|
|
455
|
+
declare function useDirectionsService(): google.maps.DirectionsService | null;
|
|
456
|
+
|
|
457
|
+
export { type ClusterRendererContext, type CreateClusterRendererOptions, type DirectionsServiceResult, GoogleMap, type GoogleMapHandle, type GoogleMapProps, type GoogleMapsApiLoadOptions, GoogleMapsProvider, type GoogleMapsProviderProps, type GoogleMapsStatus, type HeatmapDatum, MapAdvancedMarker, type MapAdvancedMarkerHandle, type MapAdvancedMarkerProps, MapBicyclingLayer, type MapBicyclingLayerHandle, MapCircle, type MapCircleHandle, type MapCircleProps, MapControl, type MapControlProps, MapDirectionsRenderer, type MapDirectionsRendererHandle, type MapDirectionsRendererProps, MapDirectionsService, MapGroundOverlay, type MapGroundOverlayHandle, type MapGroundOverlayProps, MapHeatmapLayer, type MapHeatmapLayerHandle, MapInfoWindow, type MapInfoWindowHandle, type MapInfoWindowProps, MapKmlLayer, type MapKmlLayerHandle, MapMarker, MapMarkerClusterer, type MapMarkerClustererHandle, type MapMarkerClustererProps, type MapMarkerHandle, type MapMarkerProps, MapPolygon, type MapPolygonHandle, type MapPolygonProps, MapPolyline, type MapPolylineHandle, type MapPolylineProps, MapRectangle, type MapRectangleHandle, type MapRectangleProps, MapTrafficLayer, type MapTrafficLayerHandle, MapTransitLayer, type MapTransitLayerHandle, createClusterRenderer, getDefaultGoogleMapsLibraries, loadGoogleMapsApi, useDirectionsService, useGoogleMap, useGoogleMapsApi, useMapGeocoder };
|