When I put this code in a script.js file and include it, it works fine,
but when I implement this code in a javascript file loaded by requirejs, the createMapOnOverlay function is not found, which is called from the outside, like this:
var overlay = new AlarmOverlay(...); overlay.createMapOnOverlay(..);
alarmoverlay.js:
AlarmOverlay.prototype = new google.maps.OverlayView(); function AlarmOverlay(bounds, alarmNumber, alarmCssClass) {
I have to put the above code in this script.js file below that requirejs loads: but the code below does not work
define(function() { return function AlarmOverlay(bounds, alarmNumber, alarmCssClass) { var self = this; self.prototype = new google.maps.OverlayView(); self.bounds = bounds; self.alarmNumber = alarmNumber; self.alarmCssClass = alarmCssClass;
How can I extract from Google OverlayView that I can call the createMapOnOverlay function from outside, which should call setMap from the base class?
source share