1 | declare namespace google.maps {
|
2 | /**
|
3 | * A service for obtaining the highest zoom level at which satellite imagery is available for a given location.
|
4 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomService Maps JavaScript API}
|
5 | */
|
6 | class MaxZoomService {
|
7 | /**
|
8 | * Returns the maximum zoom level for which detailed imagery is available at a particular {@link LatLng} for the
|
9 | * {@link MapTypeId.SATELLITE satellite} map type. As this request is asynchronous, you must pass a `callback`
|
10 | * function which will be executed upon completion of the request, being passed a {@link MaxZoomResult}.
|
11 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomService.getMaxZoomAtLatLng Maps JavaScript API}
|
12 | */
|
13 | getMaxZoomAtLatLng(latlng: LatLng | LatLngLiteral, callback: (result: MaxZoomResult) => void): void;
|
14 | }
|
15 |
|
16 | /**
|
17 | * @see {@link MaxZoomResult}
|
18 | * @see {@link MaxZoomResultOk}
|
19 | */
|
20 | interface MaxZoomResultError {
|
21 | /**
|
22 | * Status of the request.
|
23 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomResult.status Maps JavaScript API}
|
24 | * @see {@link MaxZoomResultOk#status}
|
25 | */
|
26 | status: MaxZoomStatus.ERROR;
|
27 | }
|
28 |
|
29 | /**
|
30 | * @see {@link MaxZoomResult}
|
31 | * @see {@link MaxZoomResultError}
|
32 | */
|
33 | interface MaxZoomResultOk {
|
34 | /**
|
35 | * Status of the request.
|
36 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomResult.status Maps JavaScript API}
|
37 | * @see {@link MaxZoomResultError#status}
|
38 | */
|
39 | status: MaxZoomStatus.OK;
|
40 |
|
41 | /**
|
42 | * The maximum zoom level found at the given {@link LatLng}.
|
43 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomResult.zoom Maps JavaScript API}
|
44 | */
|
45 | zoom: number;
|
46 | }
|
47 |
|
48 | /**
|
49 | * A MaxZoom result in JSON format retrieved from the {@link MaxZoomService}.
|
50 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomResult Maps JavaScript API}
|
51 | */
|
52 | type MaxZoomResult = MaxZoomResultError | MaxZoomResultOk;
|
53 |
|
54 | /**
|
55 | * The status returned by the {@link MaxZoomService} on the completion of a call to
|
56 | * {@link MaxZoomService#getMaxZoomAtLatLng getMaxZoomAtLatLng()}. Specify these by value, or by using the
|
57 | * constant's name. For example, `'OK'` or {@link MaxZoomStatus.OK}.
|
58 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomStatus Maps JavaScript API}
|
59 | */
|
60 | enum MaxZoomStatus {
|
61 | /**
|
62 | * There was a problem contacting the Google servers.
|
63 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomStatus.ERROR Maps JavaScript API}
|
64 | */
|
65 | ERROR = 'ERROR',
|
66 |
|
67 | /**
|
68 | * The response contains a valid {@link MaxZoomResult}.
|
69 | * @see {@link https://developers.google.com/maps/documentation/javascript/reference/max-zoom#MaxZoomStatus.OK Maps JavaScript API}
|
70 | */
|
71 | OK = 'OK',
|
72 | }
|
73 | }
|