You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not quite sure why but for some reason the markerData in the following code is getting read as undefined, even if I default the input of [leafletMarkerCluster]. markerData is undefined on the first pass of ngOnChanges, followed by ngOnInit, and finally it is defined on the second pass of ngOnChanges. This throws 2 of the above errors in the console.
classLeafletMarkerClusterDirective{constructor(leafletDirective){// Hexbin data bindingthis.markerData=[];// Fired when the marker cluster is createdthis.markerClusterReady=newEventEmitter();this.leafletDirective=newLeafletDirectiveWrapper(leafletDirective);}ngOnInit(){this.leafletDirective.init();constmap=this.leafletDirective.getMap();this.markerClusterGroup=L.markerClusterGroup(this.markerClusterOptions);// Add the marker cluster group to the mapthis.markerClusterGroup.addTo(map);// Set the data now that the markerClusterGroup existsthis.setData(this.markerData);// Fire the ready eventthis.markerClusterReady.emit(this.markerClusterGroup);}ngOnChanges(changes){// Set the new dataif(changes['markerData']){this.setData(this.markerData);}}
Could this be fixed by adding a check for undefined in the spots where this is called? For now I'll just have to let my developers know not to worry about the errors.
I have no issues running ngx markercluster, but I keep getting a nagging error in my console.
I'm not quite sure why but for some reason the markerData in the following code is getting read as undefined, even if I default the input of [leafletMarkerCluster]. markerData is undefined on the first pass of ngOnChanges, followed by ngOnInit, and finally it is defined on the second pass of ngOnChanges. This throws 2 of the above errors in the console.
Could this be fixed by adding a check for undefined in the spots where this is called? For now I'll just have to let my developers know not to worry about the errors.
The text was updated successfully, but these errors were encountered: