Solvedangular google maps Setting strokeWeight on a circle throws an error and doesn't add the stroke

Issue description
If you add the strokeWeight property google maps throws an error:

Uncaught TypeError: f[r] is not a function

Steps to reproduce and a minimal demo of the problem

http://plnkr.co/edit/EjWE2hRU9q3DwQh90BCE?p=preview

What steps should we try in your demo to see the problem?

Run it and open the console.

Current behavior
An error is thrown.

Expected/desired behavior
The circle shows a stroke with the defined weight

angular2 & angular2-google-maps version
angular 2.2 and angular2-google-maps 0.16.0

Other information
This happens because you are passing the stroke position value as CENTER string but that is not valid for google maps since it is expecting google.maps.StrokePosition.CENTER (OUTSIDE or INSIDE) which behind the scenes is an enum with some numeric value not a string.

12 Answers

✔️Accepted Answer

@SebastianM any progress with that regarding information @cesarp provided? this issue is quite old...

As a workaround you can pass enum to strokePosition input instead of string. For instance

google.maps.StrokePosition.CENTER // outputs 0

then pass 0:

<agm-circle
  [latitude]="55.6713442"
  [longitude]="12.5237847"
  [radius]="1000"
  [strokeOpacity]="1"
  [strokePosition]="0" <-- here's the trick
  [strokeWeight]="2"
  [strokeColor]="'#706bd6'"
  [fillColor]="'#706bd6'"
  [fillOpacity]="0.5">
</agm-circle>

Other Answers:

Any update or work-around? I've run into the same issue.

More Issues: