Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting strokeWeight on a circle throws an error and doesn't add the stroke #770

Closed
cesarp opened this issue Nov 25, 2016 · 11 comments · Fixed by #1665
Closed

Setting strokeWeight on a circle throws an error and doesn't add the stroke #770

cesarp opened this issue Nov 25, 2016 · 11 comments · Fixed by #1665

Comments

@cesarp
Copy link

cesarp commented Nov 25, 2016

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.

cesarp pushed a commit to cesarp/angular2-google-maps that referenced this issue Nov 25, 2016
… error

When setting strokeWeight property google maps throws an error because the strokePosition option is set with an invalid value
@sebholstein
Copy link
Owner

@cesarp thank you! Added one comment.

@rg1220
Copy link

rg1220 commented Sep 7, 2017

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

@santosmken
Copy link

Any update with this issue? I've encounter the same issue also.

@shuchow
Copy link

shuchow commented Nov 6, 2017

@santosmken

I added [strokePosition]="1" to my agm-circle tag. That adds the circle. However, now I have a different problem in that strokeColor and fillColor values are not being honored. The stroke and the fill is black and cannot be changed.

@santosmken
Copy link

@shuchow did you paste the code directly on your node_modules directory? Because mine is working properly and the behavior I want is correct. The code should be pasted on

node_modules/@agm/services/google-maps.api-wrapper.js LINE 46-51

@poltorak
Copy link

poltorak commented Nov 29, 2017

@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>

@Pitkox
Copy link

Pitkox commented Oct 10, 2018

@SebastianM Why this is still open? Please change it on docs or in code. I lost much time on this.

@vguleaev
Copy link

I run into same issue, a fix is needed, string doesn't work but number work 👍

@stale
Copy link

stale bot commented Jan 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 14, 2019
@stale stale bot closed this as completed Jan 21, 2019
@dockleryxk
Copy link

This is still an issue (I'm using beta.5). It should stay open

@ghost ghost reopened this Jun 23, 2019
@stale stale bot removed the stale label Jun 23, 2019
@ghost ghost added the P1: urgent label Jun 23, 2019
@ghost
Copy link

ghost commented Jun 23, 2019

#772 tried to fix it, but wasn't complete

@ghost ghost closed this as completed in #1665 Jun 24, 2019
ghost pushed a commit that referenced this issue Jun 24, 2019
fixes circle error when strokeWeight is enabled by using the correct values
for strokePosition

fixes: #770
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants