leaflet-geosearch icon indicating copy to clipboard operation
leaflet-geosearch copied to clipboard

"Google Maps JavaScript API has been loaded directly without loading=async"

Open mugu-fatman opened this issue 1 year ago • 2 comments
trafficstars

Hi , Thanks for the lovely plugin !!! I am using GeoSearchControl in my svelte application with google provider

        const provider = new GoogleProvider({ apiKey: "" })
	const searchControl = new GeoSearchControl({
				marker: { icon: icon},
				style: "bar",
				searchLabel: "search",
				resetButton: mdiMagnify,
				provider: provider,
				resultList: resultList
			});
			map.addControl(searchControl);
			map.on("geosearch/showlocation", (result) => getCoordinates(result));

Started getting warning from google api "Google Maps JavaScript API has been loaded directly without loading=async" and it has impact on the performance takes 10 - 30 secs for the map to load.

image

Could you suggest any fixes for this ?

Thank you

mugu-fatman avatar Feb 05 '24 11:02 mugu-fatman

Found that issue is coming from this plugin

not sure how to fix it

mugu-fatman avatar Feb 05 '24 12:02 mugu-fatman

Please provide some suggestion

mugu-fatman avatar Feb 08 '24 12:02 mugu-fatman

I'm going to guess, but I think it originates from the library we use, @googlemaps/js-api-loader.

smeijer avatar Feb 13 '24 12:02 smeijer

Issue has been fixed in the latest version v1.16.6 is there any possibility to update ? @smeijer https://github.com/googlemaps/js-api-loader/commit/2d05217cd728175724e1fcf024e33e21cd9cc4b2

mugu-fatman avatar Feb 20 '24 07:02 mugu-fatman

Sure. Happy to merge any pull request fixing this. Please tag me in the PR.

smeijer avatar Feb 20 '24 12:02 smeijer

:tada: This issue has been resolved in version 3.11.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

smeijer avatar Feb 20 '24 20:02 smeijer