L'API JavaScript de Google Maps a été chargée directement sans chargement = async

Created on 13 March 2024, 4 months ago

Problem/Motivation

When loading a view containing a geofield_map field with the Google Maps API, a warning is displayed: "L'API JavaScript de Google Maps a été chargée directement sans chargement = async"

Steps to reproduce

Get a Google Maps Key
In a Drupal website on DEV environment:

  • Install the views, geogield and geofield_map modules.
  • Configure the geofield map settings with the Googme Maps key.
  • Create a content type with a "location" geofield fields, as WKT.
  • Save de content type.
  • Create 2 or 3 contents of this content type, with the location.
  • Create a view page of the created content
  • Add an attached file
  • Format: Geofield MAp, behaviour "Empty Map centered at the default center"
  • Check "Lazy load map"
  • Parameter the filters on your content type.
  • Add an url.
  • Display the view
  • Check the console. It displays "L'API JavaScript de Google Maps a été chargée directement sans chargement = async" in your brawser language.

Proposed resolution

In the js/geofield_map_gmap_formatter.js file
line 158, add '&loading=async' to the end of the scriptpath variable value.

Remaining tasks

Propose a patch

🐛 Bug report
Status

Closed: duplicate

Version

3.0

Component

User interface

Created by

🇫🇷France frondeau Nantes, FRANCE

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024