console.warn: Native: tried accessing the GoogleMaps plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
See original GitHub issueThat is the error appearing in the console, i run the project in my mobile phone so i dont understand why cordova is unavailable.
This is my code:
import { Component } from '@angular/core';
import { NavController, NavParams, Platform } from 'ionic-angular';
import {
GoogleMaps,
GoogleMap,
GoogleMapsEvent,
LatLng,
CameraPosition,
MarkerOptions,
Marker
} from '@ionic-native/google-maps';
@Component({
selector: 'page-map',
templateUrl: 'map.html',
})
export class MapPage {
latitud: any;
longitud: any;
map: GoogleMap;
constructor(public navCtrl: NavController, public navParams: NavParams, private googleMaps: GoogleMaps, public platform: Platform) {
this.latitud = "-38.007681";
this.longitud = "-57.543674";
}
ionViewDidLoad() {
this.loadMap();
}
loadMap() {
let mapOptions = {
camera: {
target: {
lat: Number(this.latitud),
lng: Number(this.longitud)
},
zoom: 18,
tilt: 30
}
};
this.map = GoogleMaps.create('map', mapOptions);
// listen to MAP_READY event
// You must wait for this event to fire before adding something to the map or modifying it in anyway
this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
console.log('Map is ready!');
});
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:32 (17 by maintainers)
Top Results From Across the Web
Tried accessing the GoogleMaps plugin but Cordova is not ...
util.js:63 Native: tried accessing the GoogleMaps plugin but Cordova is not available. Make sure to include cordova.js or run in a device/ ......
Read more >Ionic 2: Cordova is not available. Make sure to include ...
First try to add browser by running below command ionic platform add browser and then run command ionic run browser . which is...
Read more >cordova-plugin-geolocation
This plugin provides information about the device's location, such as latitude and longitude. Common sources of location information include Global Positioning ...
Read more >cordova not available ionic 4
This happens when you try to call a native plugin, but Cordova isn't available. Thankfully, Ionic Native will print out a nice warning,...
Read more >error: uncaught (in promise): cordova_not_available - You.com
Native : tried calling PluginName.prepare, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, very weird. I haven’t experienced this situation. But the problem is definitely ionic problem.
By the way, this presentation might help you use this plugin through
@ionic-native/google-maps
. https://docs.google.com/presentation/d/1zlkmoSY4AzDJc_P4IqWLnzct41IqHyzGkLeyhlAxMDE/edit#slide=id.pjust solved. thanks guys,
wf9a5m75 Masashi Katsumata ndrake Nate Drake felipevencato Felipe Vencato for the helpful example. GOOD JOB!