当我使用此
时this.nativeGeocoder.reverseGeocode(parseFloat(this.myLat),parseFloat( this.myLong))
.then((result: NativeGeocoderReverseResult) =>
{ console.log('The address is ' + result.street + ' in ' + result.countryCode)
在我获取的构造函数中称为
的函数中地址为未命名的 in Result.Street 不起作用!
您必须更新结果。它将起作用
这个
this.nativeGeocoder.reverseGeocode(parseFloat(this.myLat),parseFloat( this.myLong))
.then((result: NativeGeocoderReverseResult) =>
{ console.log('The address is ' + result.street + ' in ' + result.countryCode)
to
this.nativeGeocoder.reverseGeocode(parseFloat(this.myLat),parseFloat( this.myLong))
.then((result: NativeGeocoderReverseResult) =>
{ console.log('The address is ' + result[0].street + ' in ' + result[0].countryCode)