如何在两个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)
怎样用一条线显示两个标记之间的路线?
提前致谢,