Skip to content

Conversation

@anggaaryas
Copy link

rather than we include the src in the library, we can tell user to add the script by himself. So we can add another google maps api.

remove src

Signed-off-by: Angga Arya Saputra <[email protected]>
Signed-off-by: Angga Arya Saputra <[email protected]>
@matanshukry
Copy link
Owner

@anggaaryas I don't follow; Why would we want the user to do it instead of us? what is the advantage?

@anggaaryas
Copy link
Author

because we want to use other library too. For example: google maps + Google places, the script will be:

<script
            src="https://maps.googleapis.com/maps/api/js?key={YOUR_APIKEY}&libraries=drawing,places">
</script>

we can not have multiple google api sdk script like this issue: #93

doc:
https://developers.google.com/maps/documentation/javascript/libraries#libraries-for-dynamic-library-import

@matanshukry
Copy link
Owner

matanshukry commented Aug 14, 2024

@anggaaryas I don't think we should remove this script like that, it's useful for many people. Instead:

  1. We should get an object that would define the options related to script, e.g. ScriptInitOptions.
  2. It will include fields like assumeExists flag, and additionalLibraries.

In your specific case / for a quick solution, can you just create your own script with id = flutter_google_places_sdk_web_script_id, before calling the initialize?

That should make the initialize code skip the script element creation.

@alenas
Copy link

alenas commented Aug 18, 2024

Even google_maps_flutter_web does not add script. And I am sure Google thought about it a lot.
For example it could be related to API_KEY management, where it is quite different for web and android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants