Hi,
i try to start run a google maps native, but maps cant show to me.
I started from scetch.
- ionic start test --ts --v2
- ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID=“AIza…” --variable API_KEY_FOR_IOS=“AIza…”
- then update page1
page1.ts
import {Component} from "@angular/core";
import {GoogleMap, GoogleMapsEvent, GoogleMapsLatLng} from 'ionic-native';
@Component({
templateUrl: 'build/pages/page1/page1.html',
})
export class Page1 {
constructor() {
}
onViewDidEnter(){
// somewhere in your component
let map = new GoogleMap('map');
// var GOOGLE = new GoogleMapsLatLng(37.422858, -122.085065);
map.on(GoogleMapsEvent.MAP_READY).subscribe(() => console.log("Map is ready!"));
}
}
page1.html
<ion-navbar *navbar>
<ion-title>Tab 1</ion-title>
</ion-navbar>
<ion-content padding class="page1">
<h2>Welcome to Ionic!</h2>
<div id="map" style="width: 400px; height:400px; background-color: #999"></div>
</ion-content>
- ionic run android (with connected device - android 5.1.1)
Now i see only gray div without maps.
Anyone help me? I dont know what im doing wrong.
Thanks for help.