Currently, I have integrated Google maps into my Ionic project using the code snippet below:
this.geolocation.getCurrentPosition().then((position) => {
let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
let mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
}, (err) => {
console.log(err);
});
However, upon implementation of the above code, I encountered the following error message:
Geolocation has been disabled in this document by Feature Policy
Does anyone have any suggestions on how to tackle this issue?
Appreciate any help provided!