ionic-team / capacitor-google-maps

12 stars 16 forks source link

@googlemaps/js-api-loader: Refactor to importLibrary method #22

Open AE1NS opened 2 months ago

AE1NS commented 2 months ago

Feature Request

Plugin

@capacitor/google-maps

Description

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.

Additional Context

https://github.com/ionic-team/capacitor/discussions/6576