Update Example for Google Map

This commit is contained in:
Shamsher Ansari 2016-11-02 16:44:06 +05:30 committed by GitHub
parent fa03fa544f
commit e6beaa49a4

View File

@ -41,23 +41,37 @@ export const GoogleMapsAnimation = {
* @description This plugin uses the native Google Maps SDK * @description This plugin uses the native Google Maps SDK
* @usage * @usage
* ``` * ```
* import { GoogleMap, GoogleMapsEvent } from 'ionic-native'; * import {
* GoogleMap,
* GoogleMapsEvent,
* GoogleMapsLatLng,
* CameraPosition,
* GoogleMapsMarkerOptions,
* GoogleMapsMarker
* } from 'ionic-native';
* *
* // create a new map using element ID * export class MapPage {
* let map = new GoogleMap('elementID'); * constructor() {}
* *
* // or create a new map by passing HTMLElement * // Load map only after view is initialize
* let element: HTMLElement = document.getElementById('elementID'); * ngAfterViewInit() {
* this.loadMap();
* }
* *
* // In Angular 2 or Ionic 2, if we have this element in html: <div #map></div> * loadMap() {
* // then we can use @ViewChild to find the element and pass it to GoogleMaps * // make sure to create following structure in your view.html file
* @ViewChild('map') mapElement; * // <ion-content>
* let map = new GoogleMap(mapElement); * // <div #map id="map"></div>
* // </ion-content>
*
* // create a new map by passing HTMLElement
* let element: HTMLElement = document.getElementById('map');
*
* let map = new GoogleMap(element);
* *
* // listen to MAP_READY event * // listen to MAP_READY event
* map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!')); * map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
* *
*
* // create LatLng object * // create LatLng object
* let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802); * let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
* *
@ -81,6 +95,9 @@ export const GoogleMapsAnimation = {
* .then((marker: GoogleMapsMarker) => { * .then((marker: GoogleMapsMarker) => {
* marker.showInfoWindow(); * marker.showInfoWindow();
* }); * });
* }
*
* }
* ``` * ```
*/ */
@Plugin({ @Plugin({