javascriptangulargoogle-mapsangular-google-mapsagm-map

How to use tilesLoaded in angular 8?


How to use tilesLoaded in agm angular google map. I want to do some action after map has fully loaded. Is there any example to use tilesLoaded in angular (v8)?

https://github.com/SebastianM/angular-google-maps/commit/d4f1371


Solution

  • Add the tilesLoaded event to your agm-map as follows:

    <agm-map  
      [latitude]=51.673858
      [longitude]=7.815982
      [zoom]=8
      (tilesLoaded)="handleOnTilesLoaded()">
    </agm-map>
    

    Then add your own behavior within that function, e.g.:

    handleOnTilesLoaded(){
        console.log("Tiles have loaded.");
    }
    

    Hope this helps you!