Skip to content

How can I dismiss this warning "Google Maps already loaded outside @googlemaps/js-api-loader #244

@artworkjpm

Description

@artworkjpm

Thanks for stopping by to let us know something could be better!


PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


Please be sure to include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ...")
  2. OS type and version
  3. Library version and other environment information

Steps to reproduce

  1. ?

Code example

Using Angular:

import { Component, Input, OnInit } from '@angular/core';
import { Loader } from '@googlemaps/js-api-loader';
import { googleMapsApi } from 'apikeys';

@Component({
  selector: 'app-googlemaps',
  templateUrl: './googlemaps.component.html',
  styleUrls: ['./googlemaps.component.scss'],
})
export class GooglemapsComponent implements OnInit {
  @Input() data: { lat: string; long: string } = { lat: '', long: '' };
  loader = new Loader({
    apiKey: googleMapsApi,
  });
  constructor() {}

  ngOnInit(): void {
    this.loader.load().then(() => {
      new google.maps.Map(document.getElementById('map') as HTMLElement, {
        center: {
          lat: parseFloat(this.data.lat),
          lng: parseFloat(this.data.long),
        },
        zoom: 10,
      });
    });
  }
}

example


#### Stack trace
I get this message because I create a map on each open of a dialog, the map appears in the dialog:

<div class="map" id="map"></div>

How can I remove this message from appearing?
**"Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."**

example


Following these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

Labels

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