Skip to content Skip to sidebar Skip to footer

Failed To Execute 'write' On 'document' Error In Loading Angular Google Map

i am using angularjs in a web development project and using Angular Google Maps api was recommended to me for adding google map to my project. it was very useful api but when i lo

Solution 1:

Specify &callback=someWindowFunction in your api request and document.write won't get called

var _this = this;
window["googleMapsLoad"] = function () {
    _this.googleMapsLoaded = true;

    if (_this.initialized) {
        _this.reportReady();
        _this.createMap();
    }
}; 

this.initialize = function (reportReady) {
    this._super(false);

    if (this.googleMapsLoaded) {
        this.reportReady();
        this.createMap();
    }
};

var script = document.createElement("script");
    script.src = "//maps.googleapis.com/maps/api/js?callback=googleMapsLoad";

document.head.appendChild(script);

Post a Comment for "Failed To Execute 'write' On 'document' Error In Loading Angular Google Map"