@f3n2x wrote:
Hi
I encountered this error when tried Google Map Reserve Geocode. Any idea?
Unhandled Promise rejection: Cannot read property ‘Geocoder’ of null ; Zone: ; Task: Promise.then ; Value: TypeError: Cannot read property ‘Geocoder’ of null
See below my code:
import { GoogleMaps, GoogleMap, GoogleMapsEvent,
GoogleMapOptions, CameraPosition, MarkerOptions, Marker,
Geocoder,GeocoderRequest, LatLng, GeocoderResult
} from ‘@ionic-native/google-maps’;
…export class GMapSearchPage {
@ViewChild(‘map’) mapElement: ElementRef;
map: any;
startP: string;
endP: string;
indicator: string;
dateTm : string;constructor(private navCtrl: NavController, private navParams: NavParams
, private platform :Platform, private geolocation: Geolocation
, private geocoder: Geocoder) {
this.indicator=“start”;}
…let req : GeocoderRequest = { position: new LatLng( 1.3563415021796763, 103.98829936981201) } ; Geocoder.geocode(req).then((results: GeocoderResult[])=>{ let address = [ (results[0].thoroughfare || "") + " " + (results[0].subThoroughfare || ""), results[0].locality ].join(", "); console.log("data_: ", address); })…
Thank you
Posts: 1
Participants: 1