GoogleMaps class
November 6, 2018 ยท View on GitHub
import { Platform } from 'ionic-angular';
import {
GoogleMaps,
GoogleMap,
GoogleMapOptions
} from '@ionic-native/google-maps';
export class MapPage {
map: GoogleMap;
constructor(private platform: Platform) {
this.platform.ready(()=> {
this.loadMap();
});
}
loadMap() {
let options: GoogleMapOptions = {
controls: {
compass: true,
myLocation: true,
myLocationButton: true,
mapToolbar: true
}
};
this.map = GoogleMaps.create('map_canvas', options);
}
}
API Reference
Static method
-
create(element, options?)
Generate an instance of GoogleMap class.
Params Type Details element string | HTMLElement Specifies the container of map div options GoogleMapOptions (optional)Initial option :arrow_right: returns instance of GoogleMap class
-
createPanorama(element, options?)
Generate an instance of StreetViewPanorama class.
Params Type Details element string | HTMLElement Specifies the container of panorama div options StreetViewOptions (optional)Initial option :arrow_right: returns instance of StreetViewPanorama class