Angular 8上的@ agm / core库问题(Google地图中的空白)

我在@ agm / core库中遇到此问题。这是我的地图的样子:

Angular 8上的@ agm / core库问题(Google地图中的空白)

有很多空格!

这是我的伴侣结构:

google-map.component.html:

<div #googleMap class=google-map></div>

google-map.component.ts:

export class GoogleMapComponent implements OnInit {
    @ViewChild('googleMap',{static: true}) googleMap: ElementRef;
    @Input() lat: any;
    @Input() lng: any;
    zoom = 15;
    address: any;
    marker: google.maps.Marker;
    map: google.maps.Map;
    geocoder: google.maps.Geocoder;

    constructor(){}

    ngOnInit() {
        this.initMap();
    }

    initMap(){
        const lat = parseFloat(this.lat) || 10.484676;
        const lng = parseFloat(this.lng) || -66.831576;
        const mapDOM = this.googleMap.nativeElement;
        this.geocoder = new google.maps.Geocoder;
        this.map = new google.maps.Map(mapDOM,{
            center: {lat,lng},zoom: self.zoom,zoomControl: false,mapTypeControl: false,scaleControl: false,streetViewControl: false,rotateControl: false,fullscreenControl: false
        });

        this.marker = new google.maps.Marker({
            position: {lat,map: self.map,draggable: self.markerDraggable
        });
    }

google-map.component.module.ts:

@NgModule({
    declarations: [
        GoogleMapComponent
    ],imports: [
        Commonmodule,],exports: [
        GoogleMapComponent
    ]
})

任何帮助将不胜感激! 谢谢

nathansgl 回答:Angular 8上的@ agm / core库问题(Google地图中的空白)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2727946.html

大家都在问