0

When I am trying to create a new google Map in angular 2 zone.js is giving me a maximum callstack exceeded. Has anybody experienced this?

Error in zone.js when loading google map on angular2

Map Component:

    import { Component,  OnInit} from '@angular/core';
    import { Map, MapOptions, LatLng} from '../../models/map.model';
    @Component({
        moduleId: module.id,
        selector: 'map',
        templateUrl: 'map.component.html',
        styleUrls: ['map.component.css']
    })
    export class MapComponent implements OnInit {
        private _map: Map;
        private _mapOptions: MapOptions;
    
        constructor() {
    
        }
    
        ngOnInit() {
            this._mapOptions = new MapOptions();
            this._mapOptions.center = new LatLng(35.9273232, 14.413077);
            this._map = new Map(document.getElementById('googleMap'), this._mapOptions);
        }
    
    }
Sangwin Gawande
  • 7,658
  • 8
  • 48
  • 66
Moddinu
  • 185
  • 1
  • 7

1 Answers1

0
  1. It was an issue with browser sync that caused zone.js to trough the maximum call stack exceeded I end up launching the app using different engine . I used iis express and the map loaded without any issues.

  2. I tried to extend google maps map class to my own map model . I then used google map directly and this worked.

Moddinu
  • 185
  • 1
  • 7