| 32 | exportAs: 'mapRectangle', |
| 33 | }) |
| 34 | export class MapRectangle implements OnInit, OnDestroy { |
| 35 | private readonly _map = inject(GoogleMap); |
| 36 | private readonly _ngZone = inject(NgZone); |
| 37 | private _eventManager = new MapEventManager(inject(NgZone)); |
| 38 | private readonly _options = new BehaviorSubject<google.maps.RectangleOptions>({}); |
| 39 | private readonly _bounds = new BehaviorSubject< |
| 40 | google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral | undefined |
| 41 | >(undefined); |
| 42 | |
| 43 | private readonly _destroyed = new Subject<void>(); |
| 44 | |
| 45 | /** |
| 46 | * The underlying google.maps.Rectangle object. |
| 47 | * |
| 48 | * See developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle |
| 49 | */ |
| 50 | rectangle?: google.maps.Rectangle; |
| 51 | |
| 52 | @Input() |
| 53 | set options(options: google.maps.RectangleOptions) { |
| 54 | this._options.next(options || {}); |
| 55 | } |
| 56 | |
| 57 | @Input() |
| 58 | set bounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral) { |
| 59 | this._bounds.next(bounds); |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * See |
| 64 | * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.boundsChanged |
| 65 | */ @Output() readonly boundsChanged: Observable<void> = |
| 66 | this._eventManager.getLazyEmitter<void>('bounds_changed'); |
| 67 | |
| 68 | /** |
| 69 | * See |
| 70 | * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.click |
| 71 | */ |
| 72 | @Output() readonly rectangleClick: Observable<google.maps.MapMouseEvent> = |
| 73 | this._eventManager.getLazyEmitter<google.maps.MapMouseEvent>('click'); |
| 74 | |
| 75 | /** |
| 76 | * See |
| 77 | * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dblclick |
| 78 | */ |
| 79 | @Output() readonly rectangleDblclick: Observable<google.maps.MapMouseEvent> = |
| 80 | this._eventManager.getLazyEmitter<google.maps.MapMouseEvent>('dblclick'); |
| 81 | |
| 82 | /** |
| 83 | * See |
| 84 | * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.drag |
| 85 | */ |
| 86 | @Output() readonly rectangleDrag: Observable<google.maps.MapMouseEvent> = |
| 87 | this._eventManager.getLazyEmitter<google.maps.MapMouseEvent>('drag'); |
| 88 | |
| 89 | /** |
| 90 | * See |
| 91 | * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dragend |
nothing calls this directly
no test coverage detected