@@ -215,33 +215,35 @@ export class DeprecatedMapMarkerClusterer
215215 new EventEmitter < MarkerClustererInstance > ( ) ;
216216
217217 ngOnInit ( ) {
218- if ( this . _canInitialize ) {
219- this . _ngZone . runOutsideAngular ( ( ) => {
220- this . _googleMap . _resolveMap ( ) . then ( map => {
221- if (
222- typeof MarkerClusterer !== 'function' &&
223- ( typeof ngDevMode === 'undefined' || ngDevMode )
224- ) {
225- throw Error (
218+ if ( ! this . _canInitialize ) {
219+ return ;
220+ }
221+
222+ this . _ngZone . runOutsideAngular ( ( ) => {
223+ this . _googleMap . _resolveMap ( ) . then ( map => {
224+ if ( typeof MarkerClusterer !== 'function' ) {
225+ if ( typeof ngDevMode === 'undefined' || ngDevMode ) {
226+ console . error (
226227 'MarkerClusterer class not found, cannot construct a marker cluster. ' +
227228 'Please install the MarkerClustererPlus library: ' +
228229 'https://github.com/googlemaps/js-markerclustererplus' ,
229230 ) ;
230231 }
232+ return ;
233+ }
231234
232- // Create the object outside the zone so its events don't trigger change detection.
233- // We'll bring it back in inside the `MapEventManager` only for the events that the
234- // user has subscribed to.
235- this . markerClusterer = this . _ngZone . runOutsideAngular ( ( ) => {
236- return new MarkerClusterer ( map , [ ] , this . _combineOptions ( ) ) ;
237- } ) ;
238-
239- this . _assertInitialized ( ) ;
240- this . _eventManager . setTarget ( this . markerClusterer ) ;
241- this . markerClustererInitialized . emit ( this . markerClusterer ) ;
235+ // Create the object outside the zone so its events don't trigger change detection.
236+ // We'll bring it back in inside the `MapEventManager` only for the events that the
237+ // user has subscribed to.
238+ this . markerClusterer = this . _ngZone . runOutsideAngular ( ( ) => {
239+ return new MarkerClusterer ( map , [ ] , this . _combineOptions ( ) ) ;
242240 } ) ;
241+
242+ this . _assertInitialized ( ) ;
243+ this . _eventManager . setTarget ( this . markerClusterer ) ;
244+ this . markerClustererInitialized . emit ( this . markerClusterer ) ;
243245 } ) ;
244- }
246+ } ) ;
245247 }
246248
247249 ngAfterContentInit ( ) {
0 commit comments