Reformat with prettier (#37427)

This commit is contained in:
Dmitry Demensky
2019-08-07 06:55:45 -07:00
committed by Nathan Shively-Sanders
parent c15bcd2e68
commit 5ac1719a24
2 changed files with 164 additions and 221 deletions
+99 -98
View File
@@ -8,12 +8,12 @@ let mapOptions: google.maps.MapOptions = {
draggable: true,
fullscreenControl: true,
fullscreenControlOptions: {
position: google.maps.ControlPosition.RIGHT_TOP
position: google.maps.ControlPosition.RIGHT_TOP,
},
gestureHandling: 'cooperative',
restriction: {
latLngBounds: { east: 180, west: -180, north: 85, south: -85 },
strictBounds: true
strictBounds: true,
},
scrollwheel: true,
styles: [
@@ -22,21 +22,21 @@ let mapOptions: google.maps.MapOptions = {
featureType: 'water',
stylers: [
{
color: '#00bdbd'
}
]
color: '#00bdbd',
},
],
},
{
elementType: 'geometry',
featureType: 'landscape.man_made',
stylers: [
{
color: '#f7f1df'
}
]
}
color: '#f7f1df',
},
],
},
],
zoom: 4
zoom: 4,
};
/***** Create map *****/
@@ -48,9 +48,9 @@ map.fitBounds(
north: 10,
east: 10,
west: 10,
south: 10
south: 10,
},
50
50,
);
map.fitBounds(
@@ -58,14 +58,14 @@ map.fitBounds(
east: 10,
north: 10,
south: 10,
west: 10
west: 10,
},
{
bottom: 100,
left: 150,
right: 150,
top: 50
}
top: 50,
},
);
/***** Pan map to bounds *****/
@@ -73,7 +73,7 @@ map.panToBounds({
north: 10,
east: 10,
west: 10,
south: 10
south: 10,
});
map.panToBounds(
@@ -81,9 +81,9 @@ map.panToBounds(
north: 10,
east: 10,
west: 10,
south: 10
south: 10,
},
50
50,
);
map.panToBounds(
@@ -91,14 +91,14 @@ map.panToBounds(
east: 10,
north: 10,
south: 10,
west: 10
west: 10,
},
{
bottom: 100,
left: 150,
right: 150,
top: 50
}
top: 50,
},
);
map.getProjection(); // $ExpectType Projection | null
@@ -119,7 +119,7 @@ data.add(feature);
data.add({
geometry: latLng,
id: 'Test feature',
properties: {}
properties: {},
});
let isIn: boolean = map.data.contains(feature);
@@ -146,7 +146,7 @@ data.setStyle({
strokeWeight: 1,
title: 'string',
visible: true,
zIndex: 1
zIndex: 1,
});
data.overrideStyle(feature, { visible: true });
@@ -154,7 +154,7 @@ data.revertStyle(feature);
data.addGeoJson({
type: 'Feature',
geometry: { type: 'Point', coordinates: [59.32709, 18.103701] }
geometry: { type: 'Point', coordinates: [59.32709, 18.103701] },
});
data.addGeoJson(
{
@@ -172,14 +172,14 @@ data.addGeoJson(
[121.06, -21.69],
[119.66, -22.22],
[119.0, -23.4],
[123.61, -22.14]
]
]
}
}
]
[123.61, -22.14],
],
],
},
},
],
},
{ idPropertyName: 'Test feature' }
{ idPropertyName: 'Test feature' },
);
data.loadGeoJson('http://magicGeoJsonSource.com');
@@ -197,39 +197,39 @@ data.toGeoJson(feature => {});
let dataMouseEvent: google.maps.Data.MouseEvent = {
feature,
latLng,
stop: (): void => {}
stop: (): void => {},
};
let addFeatureEvent: google.maps.Data.AddFeatureEvent = {
feature
feature,
};
let removeFeatureEvent: google.maps.Data.RemoveFeatureEvent = {
feature
feature,
};
let setGeometryEvent: google.maps.Data.SetGeometryEvent = {
feature,
newGeometry: geometry,
oldGeometry: geometry
oldGeometry: geometry,
};
let setPropertyEvent: google.maps.Data.SetPropertyEvent = {
feature,
name: 'test',
newValue: {},
oldValue: {}
oldValue: {},
};
let removePropertyEvent: google.maps.Data.RemovePropertyEvent = {
feature,
name: 'test',
oldValue: {}
oldValue: {},
};
let lineString = new google.maps.Data.LineString([
{ lat: 52.201203, lng: -1.72437 },
{ lat: 52.201203, lng: -2.72437 }
{ lat: 52.201203, lng: -2.72437 },
]);
lineString.forEachLatLng(latLng => console.log(`${latLng.lat} ${latLng.lng}`));
@@ -246,31 +246,31 @@ let icon: google.maps.Icon = {
origin: new google.maps.Point(0, 0),
scaledSize: new google.maps.Size(32, 32),
size: new google.maps.Size(32, 32),
url: 'dummy'
url: 'dummy',
};
/***** MapTypeStyle *****/
let mapTypeStyle1: google.maps.MapTypeStyle = {
featureType: 'all'
featureType: 'all',
};
let mapTypeStyle2: google.maps.MapTypeStyle = {
featureType: 'administrative.country',
elementType: 'all',
stylers: []
stylers: [],
};
let mapTypeStyle3: google.maps.MapTypeStyle = {
featureType: 'landscape.natural',
elementType: 'geometry',
stylers: []
stylers: [],
};
let mapTypeStyle4: google.maps.MapTypeStyle = {
featureType: 'poi.school',
elementType: 'labels',
stylers: []
stylers: [],
};
/***** MARKERS *****/
@@ -301,7 +301,7 @@ const markerWithAllOptions = new google.maps.Marker({
position: { lat: 0, lng: 0 },
title: 'test',
visible: true,
zIndex: 0
zIndex: 0,
});
// Marker methods
@@ -349,7 +349,7 @@ marker.setIcon({
origin: new google.maps.Point(0, 0),
scaledSize: new google.maps.Size(10, 10),
size: new google.maps.Size(10, 10),
url: 'test'
url: 'test',
});
marker.setIcon({ url: 'test' });
marker.setIcon({
@@ -362,7 +362,7 @@ marker.setIcon({
scale: 1,
strokeColor: 'black',
strokeOpacity: 0,
strokeWeight: 0
strokeWeight: 0,
});
marker.setIcon({}); // $ExpectError
marker.setIcon('test');
@@ -373,7 +373,7 @@ marker.setLabel({
color: 'test',
fontFamily: 'test',
fontSize: 'test',
fontWeight: 'test'
fontWeight: 'test',
});
marker.setLabel({ text: 'test' });
marker.setLabel({}); // $ExpectError
@@ -402,7 +402,7 @@ marker.setOptions({
position: { lat: 0, lng: 0 },
title: '',
visible: true,
zIndex: 0
zIndex: 0,
});
marker.setOptions({});
@@ -558,8 +558,8 @@ let rectangle = new google.maps.Rectangle({
north: 33.685,
south: 33.671,
east: -116.234,
west: -116.251
}
west: -116.251,
},
});
/***** Circles *****/
@@ -571,7 +571,7 @@ let circle1 = new google.maps.Circle({
strokeColor: '#FF0000',
fillOpacity: 0.35,
strokeOpacity: 0.5,
strokeWeight: 1
strokeWeight: 1,
});
// circleOptions with LatLngLiteral center
@@ -582,7 +582,7 @@ let circle2 = new google.maps.Circle({
strokeColor: '#FF0000',
fillOpacity: 0.35,
strokeOpacity: 0.5,
strokeWeight: 1
strokeWeight: 1,
});
/***** StreetViewPanorama *****/
@@ -595,7 +595,7 @@ let panoramaOptions: google.maps.StreetViewPanoramaOptions = {
linksControl: true,
visible: true,
motionTracking: true,
motionTrackingControl: true
motionTrackingControl: true,
};
let panorama = new google.maps.StreetViewPanorama(document.createElement('div'), panoramaOptions);
@@ -604,35 +604,36 @@ let panoramaEvent = panorama.addListener('pano_changed', () => {});
/***** StreetViewService *****/
let street_view_service = new google.maps.StreetViewService();
street_view_service.getPanorama({
location: new google.maps.LatLng(37.782551, -122.445368),
radius: 50
}, (data, status) => {
if (status === google.maps.StreetViewStatus.OK) {
const location_pano = (data == null || data.location == null) ? null : data.location.pano;
if (location_pano == null) {
// Not good
return;
}
street_view_service.getPanorama(
{
location: new google.maps.LatLng(37.782551, -122.445368),
radius: 50,
},
(data, status) => {
if (status === google.maps.StreetViewStatus.OK) {
const location_pano = data == null || data.location == null ? null : data.location.pano;
if (location_pano == null) {
// Not good
return;
}
const new_panorama = new google.maps.StreetViewPanorama(document.createElement('div'), panoramaOptions);
new_panorama.setPano(location_pano);
new_panorama.setPov({
heading: 0,
pitch: 0
});
}
});
const new_panorama = new google.maps.StreetViewPanorama(document.createElement('div'), panoramaOptions);
new_panorama.setPano(location_pano);
new_panorama.setPov({
heading: 0,
pitch: 0,
});
}
},
);
/***** MVCArray *****/
// MVCArray should be generic
let mvcArrayStr = new google.maps.MVCArray<string>(['a', 'b', 'c']);
mvcArrayStr.forEach(
(elem: string, i: number): void => {
elem.toUpperCase();
}
);
mvcArrayStr.forEach((elem: string, i: number): void => {
elem.toUpperCase();
});
mvcArrayStr.getArray()[0].toUpperCase();
mvcArrayStr.getAt(0).toUpperCase();
mvcArrayStr.insertAt(2, 'x');
@@ -647,9 +648,9 @@ let heatmap = new google.maps.visualization.HeatmapLayer({
data: [
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 })
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 }),
],
map
map,
});
// setData Should Accept MVCArray<LatLng>
@@ -657,8 +658,8 @@ heatmap.setData(
new google.maps.MVCArray<google.maps.LatLng>([
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 })
])
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 }),
]),
);
// setData Should Accept MVCArray<WeightedLocation>
@@ -666,21 +667,21 @@ heatmap.setData(
new google.maps.MVCArray<google.maps.visualization.WeightedLocation>([
{ weight: 1, location: new google.maps.LatLng(37.782551, -122.445368) },
{ weight: 2, location: new google.maps.LatLng(37.782745, -122.444586) },
{ weight: 3, location: new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 }) }
])
{ weight: 3, location: new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 }) },
]),
);
// setData Should Accept LatLng[]
heatmap.setData([
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 })
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 }),
]);
// setData Should Accept WeightedLocation[]
heatmap.setData([
{ weight: 1, location: new google.maps.LatLng(37.782551, -122.445368) },
{ weight: 2, location: new google.maps.LatLng({ lat: 37.782745, lng: -122.444586 }) }
{ weight: 2, location: new google.maps.LatLng({ lat: 37.782745, lng: -122.444586 }) },
]);
// setOptions should required data and accepted any HeatmapLayerOptions
@@ -688,11 +689,11 @@ heatmap.setOptions({
data: [
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 })
new google.maps.LatLng({ lat: 37.782842, lng: -122.443688 }),
],
dissipating: true,
map,
opacity: 8
opacity: 8,
});
/***** google.maps.places.PlacesService *****/
@@ -702,7 +703,7 @@ service.getDetails(
{
placeId: '-a1',
fields: ['name'],
sessionToken: new google.maps.places.AutocompleteSessionToken()
sessionToken: new google.maps.places.AutocompleteSessionToken(),
},
(result, status) => {
if (status === google.maps.places.PlacesServiceStatus.NOT_FOUND) {
@@ -710,13 +711,13 @@ service.getDetails(
}
result.name; // $ExpectType string
}
},
);
service.findPlaceFromQuery(
{
query: 'Big Ben London',
fields: ['name']
fields: ['name'],
},
(results, status) => {
if (status === google.maps.places.PlacesServiceStatus.ERROR) {
@@ -724,13 +725,13 @@ service.findPlaceFromQuery(
}
results[0].name; // $ExpectType string
}
},
);
service.findPlaceFromPhoneNumber(
{
phoneNumber: '123456',
fields: ['name']
fields: ['name'],
},
(results, status) => {
if (status === google.maps.places.PlacesServiceStatus.ERROR) {
@@ -738,7 +739,7 @@ service.findPlaceFromPhoneNumber(
}
results[0].name; // $ExpectType string
}
},
);
/***** google.maps.places.Autocomplete *****/
@@ -754,7 +755,7 @@ const imageMapType = new google.maps.ImageMapType({
minZoom: 10,
name: 'name',
opacity: 0.5,
tileSize: new google.maps.Size(256, 256)
tileSize: new google.maps.Size(256, 256),
});
imageMapType.alt; // $ExpectType string
imageMapType.maxZoom; // $ExpectType number
@@ -769,7 +770,7 @@ const styledMapType = new google.maps.StyledMapType([], {
alt: 'alt',
maxZoom: 20,
minZoom: 10,
name: 'name'
name: 'name',
});
styledMapType.alt; // $ExpectType string
styledMapType.maxZoom; // $ExpectType number
@@ -781,14 +782,14 @@ styledMapType.tileSize; // $ExpectType Size
const directionsWaypointEmpty: google.maps.DirectionsWaypoint = {};
const directionsWaypointLocationString: google.maps.DirectionsWaypoint = {
location: ''
location: '',
};
const directionsWaypointLocationLatLng: google.maps.DirectionsWaypoint = {
location: new google.maps.LatLng(0, 0)
location: new google.maps.LatLng(0, 0),
};
const directionsWaypointLocationPlace: google.maps.DirectionsWaypoint = {
location: { query: '' }
location: { query: '' },
};
const directionsWaypointStopover: google.maps.DirectionsWaypoint = {
stopover: true
stopover: true,
};
+65 -123
View File
@@ -58,10 +58,7 @@ declare namespace google.maps {
getZoom(): number;
panBy(x: number, y: number): void;
panTo(latLng: LatLng | LatLngLiteral): void;
panToBounds(
latLngBounds: LatLngBounds | LatLngBoundsLiteral,
padding?: number | Padding
): void;
panToBounds(latLngBounds: LatLngBounds | LatLngBoundsLiteral, padding?: number | Padding): void;
setCenter(latlng: LatLng | LatLngLiteral): void;
setHeading(heading: number): void;
setMapTypeId(mapTypeId: MapTypeId | string): void;
@@ -273,7 +270,7 @@ declare namespace google.maps {
/** This map type displays satellite images. */
SATELLITE,
/** This map type displays maps with physical features such as terrain and vegetation. */
TERRAIN
TERRAIN,
}
/***** Controls *****/
@@ -293,7 +290,7 @@ declare namespace google.maps {
enum MapTypeControlStyle {
DEFAULT,
DROPDOWN_MENU,
HORIZONTAL_BAR
HORIZONTAL_BAR,
}
type GestureHandlingOptions = 'cooperative' | 'greedy' | 'none' | 'auto';
@@ -348,7 +345,7 @@ declare namespace google.maps {
}
enum ScaleControlStyle {
DEFAULT
DEFAULT,
}
/** Options for the rendering of the Street View pegman control on the map. */
@@ -377,7 +374,7 @@ declare namespace google.maps {
enum ZoomControlStyle {
DEFAULT,
LARGE,
SMALL
SMALL,
}
/**
@@ -424,7 +421,7 @@ declare namespace google.maps {
/** Elements are positioned in the top left and flow towards the middle. */
TOP_LEFT,
/** Elements are positioned in the top right and flow towards the middle. */
TOP_RIGHT
TOP_RIGHT,
}
type DrawingMode = 'Point' | 'LineString' | 'Polygon';
@@ -442,11 +439,7 @@ declare namespace google.maps {
getFeatureById(id: number | string): Data.Feature;
getMap(): Map;
getStyle(): Data.StylingFunction | Data.StyleOptions;
loadGeoJson(
url: string,
options?: Data.GeoJsonOptions,
callback?: (features: Data.Feature[]) => void
): void;
loadGeoJson(url: string, options?: Data.GeoJsonOptions, callback?: (features: Data.Feature[]) => void): void;
overrideStyle(feature: Data.Feature, style: Data.StyleOptions): void;
remove(feature: Data.Feature): void;
revertStyle(feature?: Data.Feature): void;
@@ -712,19 +705,13 @@ declare namespace google.maps {
setVisible(visible: boolean): void;
/** @see {@link https://developers.google.com/maps/documentation/javascript/reference/marker#Marker.setZIndex Maps JavaScript API} */
setZIndex(zIndex: number | null): void;
addListener(
eventName: MarkerChangeOptionEventNames,
handler: (this: Marker) => void
): MapsEventListener;
addListener(eventName: MarkerChangeOptionEventNames, handler: (this: Marker) => void): MapsEventListener;
addListener(
eventName: MarkerMouseEventNames,
handler: (this: Marker, event: MouseEvent) => void
handler: (this: Marker, event: MouseEvent) => void,
): MapsEventListener;
/** @deprecated */
addListener(
eventName: string,
handler: (this: Marker, ...args: any[]) => void
): MapsEventListener;
addListener(eventName: string, handler: (this: Marker, ...args: any[]) => void): MapsEventListener;
}
/**
@@ -1169,7 +1156,7 @@ declare namespace google.maps {
* A forward-pointing open arrow.
* @see {@link https://developers.google.com/maps/documentation/javascript/reference/marker#SymbolPath.FORWARD_OPEN_ARROW Maps JavaScript API}
*/
FORWARD_OPEN_ARROW = 2
FORWARD_OPEN_ARROW = 2,
}
/**
@@ -1188,7 +1175,7 @@ declare namespace google.maps {
* Marker falls from the top of the map ending with a small bounce.
* @see {@link https://developers.google.com/maps/documentation/javascript/reference/marker#Animation.DROP Maps JavaScript API}
*/
DROP = 2
DROP = 2,
}
/**
@@ -1364,7 +1351,7 @@ declare namespace google.maps {
| LatLng[][]
| LatLngLiteral[][]
| LatLng[]
| LatLngLiteral[]
| LatLngLiteral[],
): void;
setVisible(visible: boolean): void;
}
@@ -1584,15 +1571,11 @@ declare namespace google.maps {
/** The stroke lies inside the polygon. */
INSIDE,
/** The stroke lies outside the polygon. */
OUTSIDE
OUTSIDE,
}
class GroundOverlay extends MVCObject {
constructor(
url: string,
bounds: LatLngBounds | LatLngBoundsLiteral,
opts?: GroundOverlayOptions
);
constructor(url: string, bounds: LatLngBounds | LatLngBoundsLiteral, opts?: GroundOverlayOptions);
getBounds(): LatLngBounds;
getMap(): Map;
getOpacity(): number;
@@ -1672,10 +1655,7 @@ declare namespace google.maps {
/***** Services *****/
class Geocoder {
geocode(
request: GeocoderRequest,
callback: (results: GeocoderResult[], status: GeocoderStatus) => void
): void;
geocode(request: GeocoderRequest, callback: (results: GeocoderResult[], status: GeocoderStatus) => void): void;
}
interface GeocoderRequest {
@@ -1702,7 +1682,7 @@ declare namespace google.maps {
OVER_QUERY_LIMIT,
REQUEST_DENIED,
UNKNOWN_ERROR,
ZERO_RESULTS
ZERO_RESULTS,
}
interface GeocoderResult {
@@ -1732,7 +1712,7 @@ declare namespace google.maps {
APPROXIMATE,
GEOMETRIC_CENTER,
RANGE_INTERPOLATED,
ROOFTOP
ROOFTOP,
}
class DirectionsRenderer extends MVCObject {
@@ -1766,10 +1746,7 @@ declare namespace google.maps {
}
class DirectionsService {
route(
request: DirectionsRequest,
callback: (result: DirectionsResult, status: DirectionsStatus) => void
): void;
route(request: DirectionsRequest, callback: (result: DirectionsResult, status: DirectionsStatus) => void): void;
}
/** A directions query to be sent to the DirectionsService. */
@@ -1844,12 +1821,12 @@ declare namespace google.maps {
BICYCLING,
DRIVING,
TRANSIT,
WALKING
WALKING,
}
enum UnitSystem {
IMPERIAL,
METRIC
METRIC,
}
interface TransitOptions {
@@ -1864,12 +1841,12 @@ declare namespace google.maps {
RAIL,
SUBWAY,
TRAIN,
TRAM
TRAM,
}
enum TransitRoutePreference {
FEWER_TRANSFERS,
LESS_WALKING
LESS_WALKING,
}
interface TransitFare {
@@ -1885,7 +1862,7 @@ declare namespace google.maps {
enum TrafficModel {
BEST_GUESS,
OPTIMISTIC,
PESSIMISTIC
PESSIMISTIC,
}
/**
@@ -1920,7 +1897,7 @@ declare namespace google.maps {
OVER_QUERY_LIMIT,
REQUEST_DENIED,
UNKNOWN_ERROR,
ZERO_RESULTS
ZERO_RESULTS,
}
interface DirectionsResult {
@@ -2087,17 +2064,17 @@ declare namespace google.maps {
SHARE_TAXI,
SUBWAY,
TRAM,
TROLLEYBUS
TROLLEYBUS,
}
class ElevationService {
getElevationAlongPath(
request: PathElevationRequest,
callback: (results: ElevationResult[], status: ElevationStatus) => void
callback: (results: ElevationResult[], status: ElevationStatus) => void,
): void;
getElevationForLocations(
request: LocationElevationRequest,
callback: (results: ElevationResult[], status: ElevationStatus) => void
callback: (results: ElevationResult[], status: ElevationStatus) => void,
): void;
}
@@ -2121,14 +2098,11 @@ declare namespace google.maps {
OK,
OVER_QUERY_LIMIT,
REQUEST_DENIED,
UNKNOWN_ERROR
UNKNOWN_ERROR,
}
class MaxZoomService {
getMaxZoomAtLatLng(
latlng: LatLng | LatLngLiteral,
callback: (result: MaxZoomResult) => void
): void;
getMaxZoomAtLatLng(latlng: LatLng | LatLngLiteral, callback: (result: MaxZoomResult) => void): void;
}
interface MaxZoomResult {
@@ -2138,13 +2112,13 @@ declare namespace google.maps {
enum MaxZoomStatus {
ERROR,
OK
OK,
}
class DistanceMatrixService {
getDistanceMatrix(
request: DistanceMatrixRequest,
callback: (response: DistanceMatrixResponse, status: DistanceMatrixStatus) => void
callback: (response: DistanceMatrixResponse, status: DistanceMatrixStatus) => void,
): void;
}
@@ -2187,13 +2161,13 @@ declare namespace google.maps {
OK,
OVER_QUERY_LIMIT,
REQUEST_DENIED,
UNKNOWN_ERROR
UNKNOWN_ERROR,
}
enum DistanceMatrixElementStatus {
NOT_FOUND,
OK,
ZERO_RESULTS
ZERO_RESULTS,
}
/***** Save to Google Maps *****/
@@ -2468,7 +2442,7 @@ declare namespace google.maps {
LIMITS_EXCEEDED,
OK,
TIMED_OUT,
UNKNOWN
UNKNOWN,
}
interface KmlMouseEvent {
@@ -2524,10 +2498,7 @@ declare namespace google.maps {
getStatus(): StreetViewStatus;
getVisible(): boolean;
getZoom(): number;
registerPanoProvider(
provider: (input: string) => StreetViewPanoramaData,
opts?: PanoProviderOptions
): void;
registerPanoProvider(provider: (input: string) => StreetViewPanoramaData, opts?: PanoProviderOptions): void;
setLinks(links: StreetViewLink[]): void;
setMotionTracking(motionTracking: boolean): void;
setOptions(options: StreetViewPanoramaOptions): void;
@@ -2614,12 +2585,12 @@ declare namespace google.maps {
enum StreetViewPreference {
BEST,
NEAREST
NEAREST,
}
enum StreetViewSource {
DEFAULT,
OUTDOOR
OUTDOOR,
}
interface StreetViewLocationRequest {
@@ -2636,29 +2607,23 @@ declare namespace google.maps {
class StreetViewService {
getPanorama(
request: StreetViewLocationRequest | StreetViewPanoRequest,
cb: (data: StreetViewPanoramaData | null, status: StreetViewStatus) => void
cb: (data: StreetViewPanoramaData | null, status: StreetViewStatus) => void,
): void;
getPanoramaById(
pano: string,
callback: (
streetViewPanoramaData: StreetViewPanoramaData,
streetViewStatus: StreetViewStatus
) => void
callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void,
): void;
getPanoramaByLocation(
latlng: LatLng | LatLngLiteral,
radius: number,
callback: (
streetViewPanoramaData: StreetViewPanoramaData,
streetViewStatus: StreetViewStatus
) => void
callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void,
): void;
}
enum StreetViewStatus {
OK,
UNKNOWN_ERROR,
ZERO_RESULTS
ZERO_RESULTS,
}
class StreetViewCoverageLayer extends MVCObject {
@@ -2697,7 +2662,7 @@ declare namespace google.maps {
instance: object,
eventName: string,
handler: (event: Event) => void,
capture?: boolean
capture?: boolean,
): MapsEventListener;
/**
* Wrapper around addDomListener that removes the listener after the first
@@ -2707,18 +2672,14 @@ declare namespace google.maps {
instance: object,
eventName: string,
handler: (event: Event) => void,
capture?: boolean
capture?: boolean,
): MapsEventListener;
/**
* Adds the given listener function to the given event name for the given
* object instance. Returns an identifier for this listener that can be used
* with removeListener().
*/
function addListener(
instance: object,
eventName: string,
handler: (...args: any[]) => void
): MapsEventListener;
function addListener(instance: object, eventName: string, handler: (...args: any[]) => void): MapsEventListener;
/**
* Like addListener, but the handler removes itself after handling the first
* event.
@@ -2726,7 +2687,7 @@ declare namespace google.maps {
function addListenerOnce(
instance: object,
eventName: string,
handler: (...args: any[]) => void
handler: (...args: any[]) => void,
): MapsEventListener;
/**
* Removes all listeners for all events for the given instance.
@@ -3055,24 +3016,14 @@ declare namespace google.maps {
* Returns the LatLng resulting from moving a distance from an origin in
* the specified heading (expressed in degrees clockwise from north).
*/
function computeOffset(
from: LatLng,
distance: number,
heading: number,
radius?: number
): LatLng;
function computeOffset(from: LatLng, distance: number, heading: number, radius?: number): LatLng;
/**
* Returns the location of origin when provided with a LatLng destination,
* meters travelled and original heading. Headings are expressed in
* degrees clockwise from North. This function returns null when no
* solution is available.
*/
function computeOffsetOrigin(
to: LatLng,
distance: number,
heading: number,
radius?: number
): LatLng;
function computeOffsetOrigin(to: LatLng, distance: number, heading: number, radius?: number): LatLng;
/**
* Returns the signed area of a closed path. The signed area may be used
* to determine the orientation of the path. The computed area uses the
@@ -3089,11 +3040,7 @@ declare namespace google.maps {
namespace poly {
function containsLocation(point: LatLng, polygon: Polygon): boolean;
function isLocationOnEdge(
point: LatLng,
poly: Polygon | Polyline,
tolerance?: number
): boolean;
function isLocationOnEdge(point: LatLng, poly: Polygon | Polyline, tolerance?: number): boolean;
}
}
@@ -3154,7 +3101,7 @@ declare namespace google.maps {
SQUARE,
VERTICAL_BANNER,
WIDE_SKYSCRAPER,
X_LARGE_VERTICAL_LINK_UNIT
X_LARGE_VERTICAL_LINK_UNIT,
}
}
@@ -3230,14 +3177,11 @@ declare namespace google.maps {
constructor();
getPlacePredictions(
request: AutocompletionRequest,
callback: (result: AutocompletePrediction[], status: PlacesServiceStatus) => void
callback: (result: AutocompletePrediction[], status: PlacesServiceStatus) => void,
): void;
getQueryPredictions(
request: QueryAutocompletionRequest,
callback: (
result: QueryAutocompletePrediction[],
status: PlacesServiceStatus
) => void
callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void,
): void;
}
@@ -3352,23 +3296,23 @@ declare namespace google.maps {
constructor(attrContainer: HTMLDivElement | Map);
findPlaceFromPhoneNumber(
request: FindPlaceFromPhoneNumberRequest,
callback: (results: PlaceResult[], status: PlacesServiceStatus) => void
callback: (results: PlaceResult[], status: PlacesServiceStatus) => void,
): void;
findPlaceFromQuery(
request: FindPlaceFromQueryRequest,
callback: (results: PlaceResult[], status: PlacesServiceStatus) => void
callback: (results: PlaceResult[], status: PlacesServiceStatus) => void,
): void;
getDetails(
request: PlaceDetailsRequest,
callback: (result: PlaceResult, status: PlacesServiceStatus) => void
callback: (result: PlaceResult, status: PlacesServiceStatus) => void,
): void;
nearbySearch(
request: PlaceSearchRequest,
callback: (
results: PlaceResult[],
status: PlacesServiceStatus,
pagination: PlaceSearchPagination
) => void
pagination: PlaceSearchPagination,
) => void,
): void;
/**
* @deprecated Radar search is deprecated as of June 30, 2018. After that
@@ -3376,15 +3320,15 @@ declare namespace google.maps {
*/
radarSearch(
request: RadarSearchRequest,
callback: (results: PlaceResult[], status: PlacesServiceStatus) => void
callback: (results: PlaceResult[], status: PlacesServiceStatus) => void,
): void;
textSearch(
request: TextSearchRequest,
callback: (
results: PlaceResult[],
status: PlacesServiceStatus,
pagination: PlaceSearchPagination
) => void
pagination: PlaceSearchPagination,
) => void,
): void;
}
@@ -3396,7 +3340,7 @@ declare namespace google.maps {
NOT_FOUND,
REQUEST_DENIED,
UNKNOWN_ERROR,
ZERO_RESULTS
ZERO_RESULTS,
}
interface QueryAutocompletePrediction {
@@ -3426,7 +3370,7 @@ declare namespace google.maps {
enum RankBy {
DISTANCE,
PROMINENCE
PROMINENCE,
}
class SearchBox extends MVCObject {
@@ -3569,7 +3513,7 @@ declare namespace google.maps {
* Specifies that the DrawingManager creates rectangles, and that the
* overlay given in the overlaycomplete event is a rectangle.
*/
RECTANGLE
RECTANGLE,
}
}
@@ -3621,16 +3565,14 @@ declare namespace google.maps {
enum MapsEngineStatus {
INVALID_LAYER,
OK,
UNKNOWN_ERROR
UNKNOWN_ERROR,
}
class HeatmapLayer extends MVCObject {
constructor(opts?: HeatmapLayerOptions);
getData(): MVCArray<LatLng | WeightedLocation>;
getMap(): Map;
setData(
data: MVCArray<LatLng | WeightedLocation> | LatLng[] | WeightedLocation[]
): void;
setData(data: MVCArray<LatLng | WeightedLocation> | LatLng[] | WeightedLocation[]): void;
setMap(map: Map | null): void;
setOptions(options: HeatmapLayerOptions): void;
}