question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

help(google-maps): Can't get circle radius after radiusChanged

See original GitHub issue

What are you trying to do?

Get the circle radius after radiuous change

What troubleshooting steps have you tried?

First approach .html

<map-circle
    (radiusChanged) = circleRedim()
    [center]="center" 
    [options] = circleOptions >
</map-circle>

.ts

circleRedim(){ //<-void
 console.log(?) //<- I would like to log the new circle radius
}

Second approach

.html

<map-circle #circleRef
  [center]="center" 
  [options] = circleOptions >
</map-circle>

.ts

@ViewChild('circleRef') circleRef: google.maps.Circle;
  ngAfterViewInit() {
   console.log(this.circleRef); //<- circle ref isn't an istance of  google.maps.Circle
  }

circleref is an ElementRef image

In some way I would like to access to the Circle istance so I could manage the event radius_changed

google.maps.event.addListener(circle, 'radius_changed', function() {
  console.log(circle.getRadius());
});

Thanks in advance

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
malizia-gcommented, Oct 18, 2021

Thanks!, it works like a charm!

0reactions
angular-automatic-lock-bot[bot]commented, Nov 21, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't get circle radius after circleRedim in angular2 google ...
I found a solution here <map-circle (radiusChanged) = radiusChanged() [center]="center" [options] = circleOptions > </map-circle> ...
Read more >
How Do I Show a Radius On Google Maps? - Atlist
Step 1: Locate your place on the Google Maps. Pinpoint the location you want to draw a circle around on Google Maps. I'll...
Read more >
Zoom in when radius is changed in editable circle
Hi, I need to zoom in when radius is reduced and zoom out when radius is increased in editable circles using Google maps...
Read more >
2 Easy Ways to Draw a Radius on a Map
You can simply click on the Draw a Circle button and then start drawing a radius on its map. With this feature, you...
Read more >
Places Library | Maps JavaScript API - Google Developers
a location and a radius ; the former takes a google.maps.LatLng object, and the latter takes a simple integer, representing the circle's radius...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found