Reputation: 748
In angular 6. I am using flowing code for agm-polyline. I want to add Arrow Symbols (Polyline) (https://developers.google.com/maps/documentation/javascript/examples/overlay-symbol-arrow) in agm-polyline. But compiler shows error like Can't bind to 'icon' since it isn't a known property of '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>
For agm-polyline Arrow Symbols (Polyline) what should I do?
Upvotes: 4
Views: 2480
Reputation: 579
<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>
Upvotes: 3
Reputation: 126
agm uses [iconUrl] instead of [icon].Try that and set the Url in the .ts file like this:
public icon = {
url: 'http://earth.google.com/images/kml-icons/track-directional/track-4.png',
scaledSize: {
width: 30,
height: 30
}
}
Upvotes: 0