(
map: google.maps.Map,
polygonConstructor: typeof google.maps.Polygon,
options: google.maps.PolygonOptions,
)
| 160 | } |
| 161 | |
| 162 | private _initialize( |
| 163 | map: google.maps.Map, |
| 164 | polygonConstructor: typeof google.maps.Polygon, |
| 165 | options: google.maps.PolygonOptions, |
| 166 | ) { |
| 167 | // Create the object outside the zone so its events don't trigger change detection. |
| 168 | // We'll bring it back in inside the `MapEventManager` only for the events that the |
| 169 | // user has subscribed to. |
| 170 | this._ngZone.runOutsideAngular(() => { |
| 171 | this.polygon = new polygonConstructor(options); |
| 172 | this._assertInitialized(); |
| 173 | this.polygon.setMap(map); |
| 174 | this._eventManager.setTarget(this.polygon); |
| 175 | this.polygonInitialized.emit(this.polygon); |
| 176 | this._watchForOptionsChanges(); |
| 177 | this._watchForPathChanges(); |
| 178 | }); |
| 179 | } |
| 180 | |
| 181 | ngOnDestroy() { |
| 182 | this._eventManager.destroy(); |
no test coverage detected