Instead of the load method, the new importLibrary method should be used to import the google maps instance. This prevents interferences when the developer wants to use @googlemaps/js-api-loader in the main project with different libraries, i.e. to use the geometry API of google.
Platform(s)
Web
Preferred Solution
Instead of setting up the needed libraries in the constructor of the loader and calling the .load() method, its possible to leave the libraries in the loader empty and use the .importLibrary() method with the parameter maps. The result of the method will be the MapsLibrary.
Feature Request
Plugin
@capacitor/google-maps
Description
Instead of the
load
method, the newimportLibrary
method should be used to import the google maps instance. This prevents interferences when the developer wants to use @googlemaps/js-api-loader in the main project with different libraries, i.e. to use the geometry API of google.Platform(s)
Web
Preferred Solution
Instead of setting up the needed libraries in the constructor of the
loader
and calling the.load()
method, its possible to leave the libraries in the loader empty and use the.importLibrary()
method with the parametermaps
. The result of the method will be the MapsLibrary.Additional Context
https://github.com/ionic-team/capacitor/discussions/6576