Use method from angular-google-maps agmCircle into typescript file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Use method from angular-google-maps agmCircle into typescript file



I want to get the bounds of a circle when it is changed. From here https://angular-maps.com/api-docs/agm-core/directives/AgmCircle.html I can see it has a "getBounds" method, how can I access it from my typescript file to log this data? Currently my html circle component looks like this:


<agm-circle [latitude]="lat + 0.3" [longitude]="lng"
[radius]="10000"
[fillColor]="'blue'"
[circleDraggable]="true"
[editable]="true"
(dragEnd)="test($event)"
>
</agm-circle>



And I expect to have a function like this:


test(m){
// get bounds from circle in some way
}




1 Answer
1



Just add it as a ViewChild in your component


ViewChild


@ViewChild(AgmCircle) child;

test(m) {
console.log(this.child.getBounds())
}






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Visual Studio Code: How to configure includePath for better IntelliSense results

Spring cloud config client Could not locate PropertySource

Makefile test if variable is not empty