Skip to content

Load google maps api's Places after page becomes online  #206

@OscarCR88

Description

@OscarCR88

Environment details

  1. Loading places library
  2. Windows 10 Home
  3. Library version: 1.11.2

Steps to reproduce

  1. Create Angular component (any SPA would work)
  2. Create function to load google maps SDK (loader.load....)
  3. Browse the component offline (Obviously, google maps won't load)
  4. Turn your connection ON
  5. Reload the component without reloading the page
  6. Google maps fail to load

Code example

 loadGoogleMapsSDK() {
    //configure google maps javascript API
    this.loader = new Loader({
      apiKey: "API_KEY",
      version: "weekly",
      libraries: ["places"],
    });
    //load google maps js API
    this.loader
      .load()
      .then(() => {
        this.displayGoogleMap();
      })
      .catch((error) => { });
  }

 reloadPage() {
    this.loader.deleteScript();
    this.loadGoogleMapsSDK();
  }

Stack trace

Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match.

common.js and utils.js are loaded, but not the rest of js files necessary to display the map. Any help?
1

Metadata

Metadata

Assignees

Labels

needs more infoThis issue needs more information from the customer to proceed.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions