Attempting to make a function call with parameters is giving me the error mentioned in the subject. The function declaration and call should be correct based on how I'm doing it below.
I have tried the following methods but none seem to work:
- infoWindowFunction =function( infoWindow, content, marker, map){...}
- infoWindowFunction( infoWindow, content, marker, map){...}
- infoWindowFunction=( infoWindow, content, marker, map) => {...}
- and even the changes below, which seem to fix the error but the function is still not working as intended:
let obj={infoWindowFunction: function( infoWindow, content, marker, map) {
marker.addListener("click", function (e) {
infoWindow.setContent(content);
infoWindow.open(map, marker);
});
}}
obj.infoWindowFunction( infoWindow,content, map, marker);
Below is a self-contained sample code snippet:
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
// Code snippet continues...
The error message I'm receiving is:
Error: this.infoWindowFunction is not a function