在角度6中,我正在为agm-polyline使用流动代码。 我想在agm-polyline中添加箭头符号(折线)(https://developers.google.com/maps/documentation/javascript/examples/overlay-symbol-arrow)。 但是编译器显示错误,例如不能绑定到“ icon”,因为它不是“ agm-polyline”的已知属性。...
<agm-polyline [strokeColor]="color" [icon]="icon" >
<agm-polyline-point *ngFor="let marker of markers ; let i=index" [latitude]="marker.lat" [longitude]="marker.lng">
</agm-polyline-point>
</agm-polyline>
对于agm-polyline箭头符号(折线),我该怎么办?
答案 0 :(得分:0)
agm使用[iconUrl]而不是[icon]。尝试这样做,然后在.ts文件中设置网址,如下所示:
public icon = {
url: 'http://earth.google.com/images/kml-icons/track-directional/track-4.png',
scaledSize: {
width: 30,
height: 30
}
}
答案 1 :(得分:0)
<agm-polyline [strokeColor]="'red'" [strokeWeight]="'1.5'">
<agm-icon-sequence [fixedRotation]="false"
[repeat]= "'50px'"
[offset]="100"
[path]="'FORWARD_OPEN_ARROW'">
</agm-icon-sequence>
<agm-polyline-point *ngFor="let line of circles_path"
[latitude]="line.lat"
[longitude]="line.long" >
</agm-polyline-point>
</agm-polyline>