| 31 | exportAs: 'mapCircle', |
| 32 | }) |
| 33 | export class MapCircle implements OnInit, OnDestroy { |
| 34 | private readonly _map = inject(GoogleMap); |
| 35 | private readonly _ngZone = inject(NgZone); |
| 36 | private _eventManager = new MapEventManager(inject(NgZone)); |
| 37 | private readonly _options = new BehaviorSubject<google.maps.CircleOptions>({}); |
| 38 | private readonly _center = new BehaviorSubject< |
| 39 | google.maps.LatLng | google.maps.LatLngLiteral | undefined |
| 40 | >(undefined); |
| 41 | private readonly _radius = new BehaviorSubject<number | undefined>(undefined); |
| 42 | private readonly _destroyed = new Subject<void>(); |
| 43 | |
| 44 | /** |
| 45 | * Underlying google.maps.Circle object. |
| 46 | * |
| 47 | * @see developers.google.com/maps/documentation/javascript/reference/polygon#Circle |
| 48 | */ |
| 49 | circle?: google.maps.Circle; // initialized in ngOnInit |
| 50 | |
| 51 | @Input() |
| 52 | set options(options: google.maps.CircleOptions) { |
| 53 | this._options.next(options || {}); |
| 54 | } |
| 55 | |
| 56 | @Input() |
| 57 | set center(center: google.maps.LatLng | google.maps.LatLngLiteral) { |
| 58 | this._center.next(center); |
| 59 | } |
| 60 | |
| 61 | @Input() |
| 62 | set radius(radius: number) { |
| 63 | this._radius.next(radius); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @see |
| 68 | * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.center_changed |
| 69 | */ |
| 70 | @Output() readonly centerChanged: Observable<void> = |
| 71 | this._eventManager.getLazyEmitter<void>('center_changed'); |
| 72 | |
| 73 | /** |
| 74 | * @see |
| 75 | * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.click |
| 76 | */ |
| 77 | @Output() readonly circleClick: Observable<google.maps.MapMouseEvent> = |
| 78 | this._eventManager.getLazyEmitter<google.maps.MapMouseEvent>('click'); |
| 79 | |
| 80 | /** |
| 81 | * @see |
| 82 | * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dblclick |
| 83 | */ |
| 84 | @Output() readonly circleDblclick: Observable<google.maps.MapMouseEvent> = |
| 85 | this._eventManager.getLazyEmitter<google.maps.MapMouseEvent>('dblclick'); |
| 86 | |
| 87 | /** |
| 88 | * @see |
| 89 | * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.drag |
| 90 | */ |
nothing calls this directly
no test coverage detected