Search code examples
angulargoogle-mapsagm

How to disable pegman and fullscreen options in agm angular?


I am using AGM Google map for my angular applications and trying to remove pegman and fullscreen options from the code. here is my code.

<agm-map [latitude]="lat" [longitude]="lng" [styles]="styles" [zoom]="zoom" [disableFullscreen]="true" [disablePegman]="true">
    <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>

Any idea? what i am doing wrong here?


Solution

  • HTML

    <agm-map (mapReady)="onMapReady($event)"
    

    TS

    onMapReady(map?: google.maps.Map ){
       if(map)
         map.setOptions({
           streetViewControl: false,
           fullscreenControl: false
         });
     }