Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google places sdk web - remove scr script #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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