setCenter not working in angular2-google-maps

后端 未结 3 1918
挽巷
挽巷 2021-01-31 11:53
import { GoogleMapsAPIWrapper } from \'@agm/core\';
import { Component, Input } from \'@angular/core\';

@Component({
  selector: \'core-map\',
  styleUrls: [ \'./map.co         


        
3条回答
  •  孤城傲影
    2021-01-31 12:18

    google.maps.Map is accessible on MapReady event

    
    
    

    In code "event" contains an instance of google.maps.Map:

    onMapReady(event: any)
      {
        this.diagramOverlay = new ShotDiagramOverlay();
        this.diagramOverlay.setMap(event);
        this.drawDiagramOnGeoMapSubscription = this.diagramOverlay.readyToDrawAction$.subscribe(() => this.drawDiagramOnGeoMap())
      }
    

提交回复
热议问题