| 32 | exportAs: 'mapPolygon', |
| 33 | }) |
| 34 | export class MapPolygon 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.PolygonOptions>({}); |
| 39 | private readonly _paths = new BehaviorSubject< |
| 40 | | google.maps.MVCArray<google.maps.MVCArray<google.maps.LatLng>> |
| 41 | | google.maps.MVCArray<google.maps.LatLng> |
| 42 | | google.maps.LatLng[] |
| 43 | | google.maps.LatLngLiteral[] |
| 44 | | undefined |
| 45 | >(undefined); |
| 46 | |
| 47 | private readonly _destroyed = new Subject<void>(); |
| 48 | |
| 49 | /** |
| 50 | * The underlying google.maps.Polygon object. |
| 51 | * |
| 52 | * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon |
| 53 | */ |
| 54 | polygon?: google.maps.Polygon; |
| 55 | |
| 56 | @Input() |
| 57 | set options(options: google.maps.PolygonOptions) { |
| 58 | this._options.next(options || {}); |
| 59 | } |
| 60 | |
| 61 | @Input() |
| 62 | set paths( |
| 63 | paths: |
| 64 | | google.maps.MVCArray<google.maps.MVCArray<google.maps.LatLng>> |
| 65 | | google.maps.MVCArray<google.maps.LatLng> |
| 66 | | google.maps.LatLng[] |
| 67 | | google.maps.LatLngLiteral[], |
| 68 | ) { |
| 69 | this._paths.next(paths); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.click |
| 74 | */ |
| 75 | @Output() readonly polygonClick: Observable<google.maps.PolyMouseEvent> = |
| 76 | this._eventManager.getLazyEmitter<google.maps.PolyMouseEvent>('click'); |
| 77 | |
| 78 | /** |
| 79 | * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dblclick |
| 80 | */ |
| 81 | @Output() readonly polygonDblclick: Observable<google.maps.PolyMouseEvent> = |
| 82 | this._eventManager.getLazyEmitter<google.maps.PolyMouseEvent>('dblclick'); |
| 83 | |
| 84 | /** |
| 85 | * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.drag |
| 86 | */ |
| 87 | @Output() readonly polygonDrag: Observable<google.maps.MapMouseEvent> = |
| 88 | this._eventManager.getLazyEmitter<google.maps.MapMouseEvent>('drag'); |
| 89 | |
| 90 | /** |
| 91 | * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dragend |
nothing calls this directly
no test coverage detected