<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
async defer>
</script>
$this->registerJsFile('https://maps.googleapis.com/maps/api/js?key='.Yii::$app->params['google']['map_api_key'].'&callback=initMap', ['position' => $this::POS_END]);