Skip to content

Commit

Permalink
Merge pull request #49 from googleinterns/display-image
Browse files Browse the repository at this point in the history
Change order of parameters
  • Loading branch information
NoyFlat authored Dec 31, 2020
2 parents 2694eb6 + 634fd91 commit 5704044
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class MapComponent implements OnInit {
map: this.gMap,
position: new google.maps.LatLng(marker.lat, marker.lng)
});
this.generateInfoWindow(markerForDisplay, marker);
this.generateInfoWindow(marker, markerForDisplay);
this.addMarkerForDisplay(marker, markerForDisplay);
}
this.chartsService.getChartsData();
Expand Down Expand Up @@ -230,23 +230,23 @@ export class MapComponent implements OnInit {
this.markerService.pushMarker([markerForDisplay, marker]);

google.maps.event.addListener(markerForDisplay, 'click', () => {
this.generateInfoWindow(marker, markerForDisplay)
const markerData = this.markerService.getMarker(markerForDisplay);
this.generateInfoWindow(markerData, markerForDisplay)
});

}

// Checks if there is a blob key and calls generates the info window
// Checks if there is a blob key and calls generates the info window
generateInfoWindow(marker, markerForDisplay){
const markerData = this.markerService.getMarker(markerForDisplay);
if (marker.blobKey) {
this.getBlobFromKey(marker.blobKey)
.then((blob) => {
const imageUrl = MapComponent.getUrlFromBlob(blob);
this.displayInfoWindow(markerForDisplay, markerData, imageUrl);
this.displayInfoWindow(markerForDisplay, marker, imageUrl);
});
}
else {
this.displayInfoWindow(markerForDisplay, markerData);
this.displayInfoWindow(markerForDisplay, marker);
}
}

Expand Down

0 comments on commit 5704044

Please sign in to comment.