Hello again,
i’ve a problem getting the native google maps plugin working. If i use ionic serve i’m getting a “plugin is not defined” error.
As soon as i run it on android the “map is ready” is called as long as i don’t have setDebuggable
to true
.
The Map is not displayed and only the background is filled with the color. I don’t get any errors in the console.
onViewDidEnter() {
GoogleMap.isAvailable().then(
(resolved) => {
console.log("maps available");
},
(error) => {
console.error("maps not available", error);
}
);
let map = new GoogleMap('map_canvas');
map.setDebuggable(true);
map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
console.log("Map is ready!");
map.setCenter(new GoogleMapsLatLng(LOCATION_DESTINATION_LAT, LOCATION_DESTINATION_LONG));
map.addMarker({ icon: null, title: 'milchbar', snippet: null, position: new GoogleMapsLatLng(LOCATION_DESTINATION_LAT, LOCATION_DESTINATION_LONG) });
});
}
and
<ion-item>
<div id="map_canvas" style="width: 400px; height:400px; background-color: #999"></div>
</ion-item>
ionic plugin list
cordova-plugin-actionsheet 2.2.2 "ActionSheet"
cordova-plugin-app-version 0.1.8 "AppVersion"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-crosswalk-webview 1.7.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-facebook4 1.7.1 "Facebook Connect"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-file-transfer 1.5.1 "File Transfer"
cordova-plugin-geolocation 2.2.0 "Geolocation"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-network-information 1.2.1 "Network Information"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
cordova-plugin-x-socialsharing 5.0.12 "SocialSharing"
cordova-sqlite-storage 1.4.1 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.0.1 "Keyboard"
phonegap-plugin-barcodescanner 5.0.0 "BarcodeScanner"
phonegap-plugin-push 1.7.0 "PushPlugin"
plugin.google.maps 1.3.9 "phonegap-googlemaps-plugin"
uk.co.workingedge.phonegap.plugin.launchnavigator 3.1.1 "Launch Navigator"
finally ionic info
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.8
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
OS:
Node Version: v6.2.0