离子2目的地路径

时间:2017-03-14 21:40:30

标签: angularjs google-maps ionic2

map-page.ts有我的目的地地址,我希望从中获取路径 我在哪里,我必须做什么。

initMap(){
    let latLng = new google.maps.LatLng(this.lat, this.lng);
        let mapOptions = {
        center: latLng,
        zoom: 19,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);

    let marker = new google.maps.Marker({
    map: this.map,
    animation: google.maps.Animation.DROP,
    position: this.map.getCenter()
  });

  let content = this.msj;          

  this.addInfoWindow(marker, content);

}

1 个答案:

答案 0 :(得分:0)

我实现了一个基本的ionic-2 app,用于显示2个位置之间的路径,从here获取功能。 请参阅此example