What I want to implement is a piechart marker like this link I cant figure out how to draw the overlay.I saw a similiar question here, but none of these answers work for me. I am getting this error - "Type 'any' is not a constructor function type. class google.maps.OverlayView"
import { Component, Input, Output, EventEmitter } from '@angular/core';
const chartsApi = 'https://www.google.com/jsapi';
declare var google: any;
declare var $: any;
import { } from '@types/googlemaps'
@Component({
selector: 'chart-marker',
templateUrl: './chart-marker.component.html',
styleUrls: ['./chart-marker.styles.scss']
})
export class ChartMarkerComponent {
@Input() options: Object;
@Input() data: Object;
@Output() chartReady: EventEmitter<boolean> = new EventEmitter();
private divToDraw: any;
private innerDiv: any;
private chart: any;
constructor() {
this.loadCharts();
}
// the code below is giving me this error
USGSOverlay = class extends google.maps.OverlayView {
bounds_: any;
image_: any;
map_: any;
div_: any;
constructor(bounds, image, private map) {
super();
// Initialize all properties.
}
/**
* onAdd is called when the map's panes are ready and the overlay has been
* added to the map.
*/
onAdd() {
};
draw() {
};
// The onRemove() method will be called automatically from the API if
// we ever set the overlay's map property to 'null'.
onRemove() {
};
};
private loadCharts() {
if (typeof google === "undefined" || typeof google.charts === "undefined") {
let node = document.createElement('script');
node.src = chartsApi;
node.type = 'text/javascript';
document.getElementsByTagName('body')[0].appendChild(node);
node.onload = () => {
google.load("visualization", "1", { packages: ['corechart'], "callback": this.drawChart.bind(this) });
}
}
}
private drawChart() {
this.chartReady.emit(true);
}
}