UNPKG

2.28 kBTypeScriptView Raw
1import { NgZone } from '@angular/core';
2import { Observable } from 'rxjs/Observable';
3import * as mapTypes from './google-maps-types';
4import { Polyline } from './google-maps-types';
5import { PolylineOptions } from './google-maps-types';
6import { MapsAPILoader } from './maps-api-loader/maps-api-loader';
7/**
8 * Wrapper class that handles the communication with the Google Maps Javascript
9 * API v3
10 */
11export declare class GoogleMapsAPIWrapper {
12 private _loader;
13 private _zone;
14 private _map;
15 private _mapResolver;
16 constructor(_loader: MapsAPILoader, _zone: NgZone);
17 createMap(el: HTMLElement, mapOptions: mapTypes.MapOptions): Promise<void>;
18 setMapOptions(options: mapTypes.MapOptions): void;
19 /**
20 * Creates a google map marker with the map context
21 */
22 createMarker(options?: mapTypes.MarkerOptions): Promise<mapTypes.Marker>;
23 createInfoWindow(options?: mapTypes.InfoWindowOptions): Promise<mapTypes.InfoWindow>;
24 /**
25 * Creates a google.map.Circle for the current map.
26 */
27 createCircle(options: mapTypes.CircleOptions): Promise<mapTypes.Circle>;
28 createPolyline(options: PolylineOptions): Promise<Polyline>;
29 createPolygon(options: mapTypes.PolygonOptions): Promise<mapTypes.Polyline>;
30 /**
31 * Determines if given coordinates are insite a Polygon path.
32 */
33 containsLocation(latLng: mapTypes.LatLngLiteral, polygon: mapTypes.Polygon): Promise<boolean>;
34 subscribeToMapEvent<E>(eventName: string): Observable<E>;
35 setCenter(latLng: mapTypes.LatLngLiteral): Promise<void>;
36 getZoom(): Promise<number>;
37 getBounds(): Promise<mapTypes.LatLngBounds>;
38 setZoom(zoom: number): Promise<void>;
39 getCenter(): Promise<mapTypes.LatLng>;
40 panTo(latLng: mapTypes.LatLng | mapTypes.LatLngLiteral): Promise<void>;
41 fitBounds(latLng: mapTypes.LatLngBounds | mapTypes.LatLngBoundsLiteral): Promise<void>;
42 panToBounds(latLng: mapTypes.LatLngBounds | mapTypes.LatLngBoundsLiteral): Promise<void>;
43 /**
44 * Returns the native Google Maps Map instance. Be careful when using this instance directly.
45 */
46 getNativeMap(): Promise<mapTypes.GoogleMap>;
47 /**
48 * Triggers the given event name on the map instance.
49 */
50 triggerMapEvent(eventName: string): Promise<void>;
51}