-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
289 lines (236 loc) · 8.77 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
import { GoogleMapsCommon } from './common';
export declare class GoogleMaps extends GoogleMapsCommon {
public latitude: number;
public longitude: number;
public zoom: number;
public minZoom: number;
public maxZoom: number;
public bearing: number;
public tilt: number;
public padding: number[];
public mapAnimationsEnabled: boolean;
public notifyMapReady(): void;
public updateCamera(): void;
public setViewport(bounds: Bounds, padding?: number): void;
public updatePadding(): void;
public static mapReadyEvent: string;
public static myLocationTappedEvent: string;
public static coordinateTappedEvent: string;
public static coordinateLongPressEvent: string;
public static markerSelectEvent: string;
public static markerBeginDraggingEvent: string;
public static markerEndDraggingEvent: string;
public static markerDragEvent: string;
public static markerInfoWindowTappedEvent: string;
public static markerInfoWindowClosedEvent: string;
public static shapeSelectEvent: string;
public static cameraChangedEvent: string;
public static cameraMoveEvent: string;
public static indoorBuildingFocusedEvent: string;
public static indoorLevelActivatedEvent: string;
public nativeView: any; /* GMSMapView | com.google.android.gms.maps.MapView */
public gMap: any;
public settings: UISettings;
public projection: Projection;
public myLocationEnabled: boolean;
public setMinZoomMaxZoom(): void;
public addMarker(...markers: Marker[]): void;
public removeMarker(...markers: Marker[]): void;
public removeAllMarkers(): void;
public findMarker(callback: (marker: Marker) => boolean): Marker;
public notifyMarkerEvent(eventName: string, marker: Marker);
public addPolyline(shape: Polyline): void;
public addPolygon(shape: Polygon): void;
public addCircle(shape: Circle): void;
public removeShape(shape: Shape): void;
public removeAllShapes(): void;
public findShape(callback: (shape: Shape) => boolean): Shape;
public clear(): void;
public setStyle(style: Style): boolean;
}
import { Point } from "@nativescript/core/ui/core/view";
import { Property, View, Image, Color, EventData } from "@nativescript/core";
export class IndoorLevel {
public name: string;
public shortName: string;
}
export class IndoorBuilding {
public defaultLevelIndex: number;
public levels: IndoorLevel[];
public isUnderground: boolean;
}
export class Camera {
public latitude: number;
public longitude: number;
public zoom: number;
public bearing: number;
public tilt: number;
}
export const latitudeProperty: Property<MapView, number>;
export const longitudeProperty: Property<MapView, number>;
export const bearingProperty: Property<MapView, number>;
export const zoomProperty: Property<MapView, number>;
export const tiltProperty: Property<MapView, number>;
export const paddingProperty: Property<MapView, number | number[]>;
export class UISettings {
// Whether the compass is enabled/disabled.
compassEnabled: boolean;
// Whether the indoor level picker is enabled/disabled.
indoorLevelPickerEnabled: boolean;
// Whether the indoor level picker is enabled/disabled.
mapToolbarEnabled: boolean;
// Whether the my-location button is enabled/disabled.
myLocationButtonEnabled: boolean;
// Whether rotate gestures are enabled/disabled.
rotateGesturesEnabled: boolean;
// Whether scroll gestures are enabled/disabled.
scrollGesturesEnabled: boolean;
// Whether tilt gestures are enabled/disabled.
tiltGesturesEnabled: boolean;
// Whether the zoom controls are enabled/disabled.
zoomControlsEnabled: boolean;
// Whether zoom gestures are enabled/disabled
zoomGesturesEnabled: boolean;
}
export class Projection {
public visibleRegion: VisibleRegion;
public fromScreenLocation(point: Point): Position;
public toScreenLocation(position: Position): Point;
public ios: any; /* GMSProjection */
public android: any;
}
export class VisibleRegion {
public nearLeft: Position;
public nearRight: Position;
public farLeft: Position;
public farRight: Position;
public bounds: Bounds;
}
export class Position {
public latitude: number;
public longitude: number;
public static positionFromLatLng(latitude: number, longitude: number): Position;
public ios: any; /* CLLocationCoordinate2D */
public android: any;
}
export class Bounds {
public northeast: Position;
public southwest: Position;
public ios: any; /* GMSCoordinateBounds */
public android: any;
public static fromCoordinates(southwest: Position, northeast: Position): Bounds;
}
export class Marker {
public position: Position;
public rotation: number;
public anchor: Array<number>;
public title: string;
public snippet: string;
public color: Color | string | number; /* Default Icon color - either Color, string color name, string color hex, or number hue (0-360) */
public icon: Image | string;
public alpha: number;
public flat: boolean;
public draggable: boolean;
public visible: boolean;
public zIndex: number;
public showInfoWindow(): void;
public isInfoWindowShown(): boolean;
public infoWindowTemplate: string;
public hideInfoWindow(): void;
public userData: any;
public _map: any;
public ios: any;
public android: any;
}
export class Shape {
public shape: string;
public visible: boolean;
public zIndex: number;
public userData: any;
public _map: any;
public ios: any;
public android: any;
public clickable: boolean;
}
export class Polyline extends Shape {
public width: number;
public color: Color;
public geodesic: boolean;
public addPoint(shape: Position): void;
public addPoints(shapes: Position[]): void;
public removePoint(shape: Position): void;
public removeAllPoints(): void;
public getPoints(): Array<Position>;
}
export class Polygon extends Shape {
public strokeWidth: number;
public strokeColor: Color;
public fillColor: Color;
public addPoint(shape: Position): void;
public addPoints(shapes: Position[]): void;
public removePoint(shape: Position): void;
public removeAllPoints(): void;
public addHole(hole: Position[]): void;
public addHoles(hole: Position[][]): void;
public removeHole(hole: Position[]): void;
public removeAllHoles(): void;
public getPoints(): Array<Position>;
public getHoles(): Array<Array<Position>>;
}
export class Circle extends Shape {
public center: Position;
public radius: number;
public strokeWidth: number;
public strokeColor: Color;
public fillColor: Color;
}
export class StyleBase extends Array<StyleElement> {
public center: Position;
public radius: number;
public strokeWidth: number;
public strokeColor: Color;
public fillColor: Color;
}
export class StyleElement {
public featureType?: StyleFeatureType;
public elementType?: StyleElementType;
public stylers: Array<StyleStylers>;
}
export type StyleElementType = "all" | "administrative" | "administrative.country" | "administrative.land_parcel" |
"administrative.locality" | "administrative.neighborhoodadministrative.province" | "landscape" |
"landscape.man_made" | "landscape.natural" | "landscape.natural.landcover" | "landscape.natural.terrain" |
"poi" | "poi.attraction" | "poi.business" | "poi.government" | "poi.medical" | "poi.park" |
"poi.place_of_worship" | "poi.school" | "poi.sports_complex" | "road" | "road.arterial" | "road.highway" |
"road.highway.controlled_access" | "road.local" | "transit" | "transit.line" | "transit.station" |
"transit.station.airport" | "transit.station.bus" | "transit.station.rail" | "water";
export type StyleFeatureType = "all" | "geometry" | "geometry.fill" | "geometry.stroke" | "labels" | "labels.icon" |
"labels.text" | "labels.text.fill" | "labels.text.stroke";
export type StyleVisibility = "on" | "off" | "simplified";
export class StyleStylers {
public hue?: string;
public lightness?: number;
public saturation?: number;
public gamma?: number;
public invert_lightness: boolean;
public visibility: StyleVisibility;
public color?: string;
public weight: number;
}
export interface MarkerEventData extends EventData {
marker: Marker;
}
export interface ShapeEventData extends EventData {
shape: Shape;
}
export interface CameraEventData extends EventData {
camera: Camera;
}
export interface PositionEventData extends EventData {
position: Position;
}
export interface BuildingFocusedEventData extends EventData {
indoorBuilding: IndoorBuilding;
}
export interface IndoorLevelActivatedEventData extends EventData {
activateLevel: IndoorLevel;
}