'Google maps only showing first time my android app is installed

I can not give much information, I just followed the tutorial from https://developers.google.com/maps/documentation/javascript/overview#js_api_loader_package to show a basic map.

the code is working properly on browser.

As requested, the code that is not working on mobile device:

let position;
    this.geolocalizationService.getCurrentPosition().then(
      p => {
        position = { lat: p.coords.latitude, lng: p.coords.longitude};
      },
      err => this.logger.err(`Error in poisition obtaining ${err}`)
    );

    const loader = new Loader({
      apiKey: 'MY_API_KEY',
      version: 'weekly'
    });

    loader.load().then(() => {
      this.map = new google.maps.Map(document.getElementById('map'), {
        center: position,
        zoom: 10,
      });
    });

The geolocalization method is correctly returning the position of the device.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source