當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript GoogleMap.on方法代碼示例

本文整理匯總了TypeScript中ionic-native.GoogleMap.on方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript GoogleMap.on方法的具體用法?TypeScript GoogleMap.on怎麽用?TypeScript GoogleMap.on使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ionic-native.GoogleMap的用法示例。


在下文中一共展示了GoogleMap.on方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: loadMap

    loadMap(){
 
        let location = new GoogleMapsLatLng(-34.9290,138.6010);
 
        this.map = new GoogleMap('map', {
          'backgroundColor': 'white',
          'controls': {
            'compass': true,
            'myLocationButton': true,
            'indoorPicker': true,
            'zoom': true
          },
          'gestures': {
            'scroll': true,
            'tilt': true,
            'rotate': true,
            'zoom': true
          },
          'camera': {
            'latLng': location,
            'tilt': 30,
            'zoom': 15,
            'bearing': 50
          }
        });
 
        this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
            console.log('Map is ready!');
        });
 
    }
開發者ID:tbehunin,項目名稱:kulepool,代碼行數:31,代碼來源:routeDetail.ts

示例2: loadMap

  loadMap(){
    let location = new GoogleMapsLatLng(-34.9290,138.6010);
    //-34.9290,138.6010

    this.map = new GoogleMap('map', {
      'backgroundColor': 'white',
      'controls': {
        'compass': true,
        'myLocationButton': true,
        'indoorPicker': true,
        'zoom': true
      },
      'gestures': {
        'scroll': true,
        'tilt': true,
        'rotate': true,
        'zoom': true
      },
      'camera': {
        'latLng': location,
        'tilt': 30,
        'zoom': 15,
        'bearing': 50
      }
    });

    this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
      console.log('Map is ready!');


      console.log(this.lat + ' ' + this.long);

      Geolocation.getCurrentPosition().then(pos => {
        console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
        this.lat = pos.coords.latitude;
        this.long = pos.coords.longitude;

        let coord = new GoogleMapsLatLng(this.lat, this.long);
        this.map.setCenter(coord);

        //this.map.animateCamera({
        //  'target': coord,
        //  'tilt': 60,
        //  'zoom': 18,
        //  'bearing': 140
        //});

        this.map.addMarker({
          'position':coord,
          'title': "The TagOn Project HeadQuarters"}).then(marker => {
          marker.addEventListener(GoogleMapsEvent.INFO_CLICK).subscribe(() => {
            console.log("Info window was clicked");
          });
        });
      });
    });

  }
開發者ID:kolexinfos,項目名稱:tag,代碼行數:58,代碼來源:home.ts

示例3: onPlatformReady

 private onPlatformReady(): void {
   this.map = new GoogleMap('map');
   this.map.on(GoogleMapsEvent.MAP_READY)
     .subscribe(() => this.onMapReady());
 }
開發者ID:armandozabala,項目名稱:ionic2-google-maps,代碼行數:5,代碼來源:map.ts

示例4: constructor

 constructor(){
     let map = new GoogleMap('googleMap');
     map.on(GoogleMapsEvent.MAP_READY).subscribe(() => console.log("Map is ready!"));
 }
開發者ID:ralphowino,項目名稱:ionic-native-kitchen-sink,代碼行數:4,代碼來源:googlemaps.ts


注:本文中的ionic-native.GoogleMap.on方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。