小编jam*_*vey的帖子

如何在两个Google Map本机标记之间划一条线?(科尔多瓦离子3号)

如何在两个Google Maps本机标记之间划一条线?在我的项目中,我需要一个动态标记和一个固定标记。

addMarker() {
  this.map.addMarker({
    title: 'My Marker',
    icon: 'blue',
    animation: 'DROP',
    position: {
      lat: this.place.lat,
      lng: this.place.lng
    }
  })
  .then(marker => {
    marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
      alert('Marker Clicked');
    });
  });
}
Run Code Online (Sandbox Code Playgroud)

第二标记:

addMarker2() {
          this.map.addMarker({
            title: 'My Marker',
            icon: 'blue',
            animation: 'DROP',
            position: {
              lat: -33,
              lng: 773231
            }
          })
          .then(marker => {
            marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
              alert('Marker Clicked');
            });
          });
        }
Run Code Online (Sandbox Code Playgroud)

怎样用一条线显示两个标记之间的路线?

提前致谢,

google-maps cordova ionic-framework cordova-plugins ionic3

3
推荐指数
1
解决办法
2024
查看次数