This commit is contained in:
Ibby Hadeed 2016-08-13 11:21:46 -04:00
commit b8d7806843

View File

@ -129,7 +129,7 @@ export class GoogleMap {
* @return {Promise<MyLocation>} * @return {Promise<MyLocation>}
*/ */
@CordovaInstance() @CordovaInstance()
getMyLocation(options?:MyLocationOptions): Promise<MyLocation> { getMyLocation(options?: MyLocationOptions): Promise<MyLocation> {
return; return;
} }
@ -1038,13 +1038,24 @@ export interface GeocoderRequest {
* @private * @private
*/ */
export interface GeocoderResult { export interface GeocoderResult {
adminArea?: string;
country?: string;
countryCode?: string;
extra?: {
featureName?: string;
lines?: Array<string>;
permises?: string;
phone?: string;
url?: string
},
locale?: string;
locality?: string;
position?: { lat: number; lng: number }; position?: { lat: number; lng: number };
postalCode?: string;
subAdminArea?: string;
subLocality?: string;
subThoroughfare?: string; subThoroughfare?: string;
thoroughfare?: string; thoroughfare?: string;
locality?: string;
adminArea?: string;
postalCode?: string;
country?: string;
} }
/** /**
* @private * @private
@ -1057,8 +1068,11 @@ export class Geocoder {
*/ */
static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> { static geocode(request: GeocoderRequest): Promise<GeocoderResult[]> {
return new Promise<GeocoderResult[]>((resolve, reject) => { return new Promise<GeocoderResult[]>((resolve, reject) => {
if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) reject({ error: 'plugin_not_installed' }); if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) {
else plugin.google.maps.Geocoder.geocode(request, resolve); reject({ error: 'plugin_not_installed' });
} else {
plugin.google.maps.Geocoder.geocode(request, resolve);
}
}); });
} }
} }